Last active
March 30, 2021 02:24
-
-
Save diondree/1de24e93c354b7986f4010cd0beec230 to your computer and use it in GitHub Desktop.
My React Typescript ESLint configuration using prettier and jsx-a11y
This file contains 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 = { | |
root: true, | |
parser: '@typescript-eslint/parser', | |
parserOptions: { | |
ecmaFeatures: { jsx: true }, | |
}, | |
env: { | |
browser: true, | |
node: true, | |
}, | |
extends: [ | |
'eslint:recommended', | |
'plugin:@typescript-eslint/eslint-recommended', | |
'plugin:@typescript-eslint/recommended', | |
'plugin:react/recommended', | |
'plugin:react-hooks/recommended', | |
'plugin:jsx-a11y/recommended', | |
// Prettier plugin and recommended rules | |
'prettier/@typescript-eslint', | |
'plugin:prettier/recommended', | |
], | |
rules: { | |
// Include .prettierrc.js rules | |
'prettier/prettier': ['error', {}, { usePrettierrc: true }], | |
'react/prop-types': 'off', | |
'react/react-in-jsx-scope': 'off', | |
'@typescript-eslint/explicit-function-return-type': 'off', | |
'@typescript-eslint/ban-ts-ignore': 'off', | |
'jsx-a11y/label-has-associated-control': [ | |
'error', | |
{ | |
labelComponents: [], | |
labelAttributes: [], | |
controlComponents: [], | |
assert: 'either', | |
depth: 25, | |
}, | |
], | |
'@typescript-eslint/no-explicit-any': 'off', | |
}, | |
settings: { | |
react: { | |
version: 'detect', | |
}, | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment