Skip to content

Commit

Permalink
Cleanup eslint config #1379
Browse files Browse the repository at this point in the history
  • Loading branch information
joelvdavies committed Mar 19, 2024
1 parent 38139cc commit 4da835b
Showing 1 changed file with 19 additions and 32 deletions.
51 changes: 19 additions & 32 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
env: {
browser: true,
jest: true,
es6: true,
node: true,
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
plugins: [
'react',
'react-hooks',
'@typescript-eslint',
'cypress',
'prettier',
],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/stylistic',
'prettier',
'plugin:cypress/recommended',
'prettier',
],
plugins: ['prettier', 'cypress'],
rules: {
'react/react-in-jsx-scope': 'off',
'react/jsx-filename-extension': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'prettier/prettier': [
'error',
{
Expand All @@ -28,8 +42,6 @@ module.exports = {
endOfLine: 'auto',
},
],
// disable for all files - this means we can have plain JS files not causing errors
'@typescript-eslint/explicit-function-return-type': 'off',
// Emulate typescript style for unused variables, see
// https://typescript-eslint.io/rules/no-unused-vars/
'@typescript-eslint/no-unused-vars': [
Expand All @@ -46,34 +58,9 @@ module.exports = {
],
},
overrides: [
{
// and enable again specifically for TS files
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
allowTypedFunctionExpressions: true,
},
],
},
},
{
files: ['**/?*test.*'],
extends: ['plugin:testing-library/react'],
},
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
allowImportExportEverywhere: true,
sourceType: 'module',
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
};

0 comments on commit 4da835b

Please sign in to comment.