Last active
June 19, 2020 13:29
-
-
Save alevosia/8ac93031d21e73e6deb180e3eac1d3fb to your computer and use it in GitHub Desktop.
An eslint configuration for React projects that use TypeScript
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
{ | |
"root": true, | |
"parser": "@typescript-eslint/parser", // Specifies the ESLint parser | |
"extends": [ | |
"react-app", | |
"plugin:react/recommended", // Uses the recommended rules from [eslint-plugin-react] | |
// Uses the recommended rules from the [@typescript-eslint/eslint-plugin] | |
"plugin:@typescript-eslint/recommended", | |
// Uses [eslint-config-prettier] to disable ESLint rules | |
// from @typescript-eslint/eslint-plugin that would conflict with prettier | |
"prettier/@typescript-eslint", | |
// Enables [eslint-plugin-prettier] and displays prettier errors as ESLint errors. | |
// Make sure this is always the last configuration in the extends array. | |
"plugin:prettier/recommended" | |
], | |
"parserOptions": { | |
"ecmaVersion": 2018, // Allows for the parsing of modern ECMAScript features | |
"sourceType": "module", // Allows for the use of imports | |
"ecmaFeatures": { | |
"jsx": true | |
} | |
}, | |
"rules": { | |
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs | |
// e.g. "@typescript-eslint/explicit-function-return-type": "off", | |
"react/prop-types": [0] | |
}, | |
"settings": { | |
"react": { | |
"version": "detect" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment