-
-
Save sokna7/e5d607a4160ed5f68b758c1066f6377a to your computer and use it in GitHub Desktop.
react ts eslintrc example
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, | |
env: { | |
browser: true, | |
node: true, | |
es6: true, | |
}, | |
parser: '@typescript-eslint/parser', | |
parserOptions: { | |
ecmaFeatures: { | |
jsx: true, | |
}, | |
sourceType: 'module', | |
}, | |
extends: [ | |
'eslint:recommended', | |
'plugin:react/recommended', | |
'plugin:@typescript-eslint/recommended', | |
'prettier/@typescript-eslint', | |
'prettier', | |
], | |
rules: { | |
'prettier/prettier': 'error', | |
'react/jsx-uses-react': 'off', // only if using React version 17+ | |
'react/react-in-jsx-scope': 'off', // only if using React version 17+ | |
'react-hooks/rules-of-hooks': 'error', // if using hooks | |
'react-hooks/exhaustive-deps': 'warn', // if using hooks | |
}, | |
plugins: ['react', 'react-hooks', '@typescript-eslint', 'prettier'], | |
settings: { | |
react: { | |
version: 'detect', | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment