Answer the question
In order to leave comments, you need to log in
How to connect ESLint to a project?
I'm trying to connect ESLint to a React project. Created a config (eslintrc.js):
module.exports = {
env: {
browser: true,
es2020: true,
node: true,
jest: true,
},
extends: [
'plugin:react/recommended',
'airbnb',
],
settings: {
'import/resolver': {
node: {
paths: ['src'],
},
},
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 11,
sourceType: 'module',
},
plugins: [
'react',
'@typescript-eslint',
],
rules: {
'react/prop-types': 'off',
indent: [2, 'tab'],
'react/jsx-indent': [2, 'tab'],
'react/jsx-indent-props': [2, 'tab'],
'no-tabs': 'off',
'import/no-unresolved': 'warn',
'object-curly-spacing': 'off',
'react/jsx-filename-extension': [1, {extensions: ['.js', '.jsx']}],
},
};
Error: Plugin "react" was conflicted between ".eslintrc.js" and "../.eslintrc".
Error: Plugin "react" was conflicted between ".eslintrc.js" and "../.eslintrc".
at mergePlugins (/Users/account/Documents/web-km-client/node_modules/eslint/lib/cli-engine/config-array/config-array.js:202:19)
at createConfig (/Users/account/Documents/web-km-client/node_modules/eslint/lib/cli-engine/config-array/config-array.js:305:9)
at ConfigArray.extractConfig (/Users/account/Documents/web-km-client/node_modules/eslint/lib/cli-engine/config-array/config-array.js:481:33)
at CLIEngine.isPathIgnored (/Users/account/Documents/web-km-client/node_modules/eslint/lib/cli-engine/cli-engine.js:954:18)
at ESLintPlugin.invokeESLint (/Applications/WebStorm.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js:100:23)
at ESLintPlugin.getErrors (/Applications/WebStorm.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js:78:21)
at ESLintPlugin.onMessage (/Applications/WebStorm.app/Contents/plugins/JavaScriptLanguage/languageService/eslint/bin/eslint-plugin.js:52:64)
at Interface.<anonymous> (/Applications/WebStorm.app/Contents/plugins/JavaScriptLanguage/jsLanguageServicesImpl/js-language-service.js:105:39)
at Interface.emit (events.js:315:20)
at Interface._onLine (readline.js:329:10)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question