Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const reactAppConfig = require("eslint-config-react-app");
const rules = {};
// Is the rule part of an eslint plugin?
const isPluginRule = ruleName => {
for (const plugin of plugins) {
if (ruleName.indexOf(`${plugin.rulePrefix}/`) !== -1) {
return true;
}
}
return false;
};
// Renames the plugins rules prefixing them with 'react-app'
Object.keys(reactAppConfig.rules).forEach(ruleName => {
if (isPluginRule(ruleName)) {
rules[`react-app/${ruleName}`] = reactAppConfig.rules[ruleName];
} else {
rules[ruleName] = reactAppConfig.rules[ruleName];
}
});
module.exports = {
parser: reactAppConfig.parser,
plugins: ["react-app"],
rules,
settings: reactAppConfig.settings,
env: reactAppConfig.env,
root: reactAppConfig.root,
parserOptions: reactAppConfig.parserOptions,
overrides: reactAppConfig.overrides
Object.keys(reactAppConfig.rules).forEach(ruleName => {
if (isPluginRule(ruleName)) {
rules[`react-app/${ruleName}`] = reactAppConfig.rules[ruleName];
} else {
rules[ruleName] = reactAppConfig.rules[ruleName];
}
});
import reactAppConfig from 'eslint-config-react-app';
export default {
...reactAppConfig,
rules: {
...reactAppConfig.rules,
strict: [0],
'no-sequences': [0],
'no-mixed-operators': [0],
'react/react-in-jsx-scope': [0],
'no-useless-escape': [0],
},
settings: {
react: {
version: '16.8',
},
},
};