-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
90 lines (90 loc) · 3.31 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
module.exports = {
root: true,
extends: [
"airbnb",
"airbnb-typescript",
"airbnb/hooks",
"eslint:recommended",
"plugin:import/recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:prettier/recommended"
],
plugins: ["react", "@typescript-eslint", "jest"],
ignorePatterns: ["*.js"],
env: {
browser: true,
es6: true,
jest: true
},
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
parser: "@typescript-eslint/parser",
parserOptions: {
// Make sure eslint and VS Code use the same path for the tsconfig.json:
// https://github.com/typescript-eslint/typescript-eslint/issues/251
tsconfigRootDir: __dirname,
project: "./tsconfig.json",
ecmaVersion: 2018,
sourceType: 'module'
},
rules: {
// Disables jsx-a11y https://github.com/import-js/eslint-plugin-import/blob/v2.25.4/docs/rules/no-webpack-loader-syntax.md
...Object.keys(require('eslint-plugin-jsx-a11y').rules).reduce((acc, rule) => { acc[`jsx-a11y/${rule}`] = 'off'; return acc }, {}),
"class-methods-use-this":"off",
"linebreak-style": "off",
"no-continue": "off",
"no-multi-assign": "warn",
"no-nested-ternary": "off",
"no-param-reassign": ["error", { "props": false }],
"no-return-assign": "warn",
"no-restricted-syntax": "off",
"no-plusplus": "off",
"no-prototype-builtins": "warn",
"no-minusminus": "off",
"no-underscore-dangle": "off",
"max-classes-per-file": "off",
"no-param-reassign": "warn",
"import/no-extraneous-dependencies": "off",
// Disable the following 2 lines because to allow webpack file-loaders syntax
"import/no-webpack-loader-syntax": "off",
"import/no-unresolved": "off",
"import/prefer-default-export": "off",
"import/order": "error",
"prefer-destructuring": ["warn", {"object": true, "array": false}],
"prefer-promise-reject-errors": "warn",
"prefer-spread": "warn",
"@typescript-eslint/ban-ts-comment": "warn",
"react/destructuring-assignment": "warn",
"react/jsx-props-no-spreading": "off",
"react/no-unused-class-component-methods": "warn",
"react/prop-types": "off",
"react/require-default-props": "off",
"no-await-in-loop": "off",
"eslint/no-shadow": "off",
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/default-param-last": "off",
"no-bitwise": "off",
"@typescript-eslint/no-explicit-any": "off",
"func-names": "off",
"@typescript-eslint/naming-convention": "off",
"no-param-reassign": "off",
"@typescript-eslint/no-useless-constructor": "off",
"@typescript-eslint/no-empty-function": "off",
"react/destructuring-assignment": "off",
"guard-for-in": "off",
"@typescript-eslint/ban-ts-comment": "off",
"no-alert": "off",
"no-console": "off",
"@typescript-eslint/ban-types": "off",
"react/static-property-placement": ["warn", "property assignment", {
childContextTypes: "static getter",
contextTypes: "static public field",
contextType: "static public field",
displayName: "static public field",
}]
}
};