-
-
Save sokna7/a718490aebe53ff6100ada777ace42c7 to your computer and use it in GitHub Desktop.
react js 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, | |
}, | |
parserOptions: { | |
ecmaFeatures: { | |
jsx: true, | |
}, | |
sourceType: 'module', | |
}, | |
extends: [ | |
'eslint:recommended', | |
'plugin:react/recommended', | |
'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', 'prettier'], | |
settings: { | |
react: { | |
version: 'detect', | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment