-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.eslintrc.js
45 lines (43 loc) · 1.7 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
extends: ["plugin:prettier/recommended"],
settings: {
react: {
version: "detect",
},
},
env: {
browser: true,
node: true,
es6: true,
},
plugins: ["@typescript-eslint", "react"],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of imports
},
rules: {
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
// This rule means that you do not need to declare the prop-types for a ReactJS component. These are annoying.
"react/prop-types": "off",
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-function-return-type.md
// This rule means that TypeScript functions must always declare a type, even when it's obvious, such as `() => 'hello'`, to avoid incorrect type returns.
"@typescript-eslint/explicit-function-return-type": "off",
// https://github.com/prettier/eslint-plugin-prettier
// This disables the errors for prettier, and replaces them with warnings. `-Wall`
"prettier/prettier": "warn",
},
overrides: [
{
files: ["*.js", "*.tsx"],
rules: {
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md
// This rule means you do not need to declare a type for exported functions. You can't do this without TypeScript!
"@typescript-eslint/explicit-module-boundary-types": "off",
},
},
],
}