Fixed some lint problems

This commit is contained in:
Stefano Falda 2019-10-31 22:11:39 +01:00
parent 08e992626b
commit da598c1485
3 changed files with 11 additions and 11 deletions

View File

@ -52,9 +52,11 @@ var LocalizedStrings = function () {
function LocalizedStrings(props, options) {
_classCallCheck(this, LocalizedStrings);
//Compatibility fix with previous version
// Compatibility fix with previous version
if (typeof options === "function") {
/* eslint-disable no-param-reassign */
options = { customLanguageInterface: options };
/* eslint-enable */
}
this._opts = _extends({}, {
customLanguageInterface: utils.getInterfaceLanguage,

View File

@ -29,9 +29,11 @@ export default class LocalizedStrings {
* @param {Boolean} options.logsEnabled - Enable/Disable console.log outputs (default=true)
*/
constructor(props, options) {
//Compatibility fix with previous version
// Compatibility fix with previous version
if (typeof options === "function") {
/* eslint-disable no-param-reassign */
options = { customLanguageInterface: options };
/* eslint-enable */
}
this._opts = Object.assign(
{},
@ -153,9 +155,7 @@ export default class LocalizedStrings {
strings[key] = defaultStrings[key]; // eslint-disable-line no-param-reassign
if (this._opts.logsEnabled) {
console.log(
`🚧 👷 key '${key}' not found in localizedStrings for language ${
this._language
} 🚧`
`🚧 👷 key '${key}' not found in localizedStrings for language ${this._language} 🚧`
);
}
} else if (typeof strings[key] !== "string") {
@ -267,9 +267,7 @@ export default class LocalizedStrings {
} catch (ex) {
if (!omitWarning && this._opts.logsEnabled) {
console.log(
`No localization found for key '${key}' and language '${language}', failed on ${
ex.message
}`
`No localization found for key '${key}' and language '${language}', failed on ${ex.message}`
);
}
}

View File

@ -2404,9 +2404,9 @@ set-value@^0.4.3:
is-plain-object "^2.0.1"
to-object-path "^0.3.0"
set-value@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274"
set-value@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b"
dependencies:
extend-shallow "^2.0.1"
is-extendable "^0.1.1"