Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"error",
{
requireReturn: false,
requireReturnDescription: false
}
],
"valid-typeof": "error",
"@swissquote/swissquote/sonarjs/no-duplicate-string": ["error", 10]
}
};
// Eslint can't load plugins transitively (from a shared config)
// So we have to include the file ourselves and include the rules as if they were ours.
// Solution proposed by @nzakas himself : https://github.com/eslint/eslint/issues/3458#issuecomment-257161846
// replaces `extends: "plugin:sonarjs/recommended",`
const sonarRules = require("eslint-plugin-sonarjs").configs.recommended.rules;
Object.keys(sonarRules).forEach(ruleName => {
// Only define the rules we don't have configured yet
const key = `@swissquote/swissquote/${ruleName}`;
if (!module.exports.rules.hasOwnProperty(key)) {
module.exports.rules[key] = sonarRules[ruleName];
}
});