Created
November 21, 2020 13:06
-
-
Save sarthology/9beb8ae4a6d90d90d9f7e3462a05c5eb to your computer and use it in GitHub Desktop.
My ESLint Config: https://xenox.dev/eslint-the-easy-but-complete-guide/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
parserOptions: { | |
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features | |
sourceType: 'module', // Allows for the use of imports | |
ecmaFeatures: { | |
jsx: true // Allows for the parsing of JSX | |
} | |
}, | |
env: { | |
browser: true, | |
node: true, | |
es6: true | |
}, | |
plugins: ['simple-import-sort'], | |
settings: { | |
react: { | |
version: 'detect' // Tells eslint-plugin-react to automatically detect the version of React to use | |
} | |
}, | |
extends: [ | |
'eslint:recommended', | |
'plugin:jsx-a11y/recommended', | |
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react | |
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. | |
'plugin:sonarjs/recommended', | |
'plugin:unicorn/recommended', | |
'plugin:security/recommended', | |
'plugin:react-hooks/recommended' | |
], | |
rules: { | |
'no-console': 'error', | |
'react/react-in-jsx-scope': 'off', | |
'react/prop-types': 'off', | |
'simple-import-sort/sort': 'error', | |
'unicorn/prevent-abbreviations': [ | |
'error', | |
{ | |
whitelist: { | |
getStaticProps: true | |
} | |
} | |
], | |
'unicorn/filename-case': [ | |
'error', | |
{ | |
cases: { | |
camelCase: true | |
} | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment