Skip to content

Instantly share code, notes, and snippets.

@sokna7
Last active November 1, 2020 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sokna7/e5d607a4160ed5f68b758c1066f6377a to your computer and use it in GitHub Desktop.
Save sokna7/e5d607a4160ed5f68b758c1066f6377a to your computer and use it in GitHub Desktop.
react ts eslintrc example
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