-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc
69 lines (66 loc) · 1.88 KB
/
.eslintrc
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
{
"env": {
"browser": true,
"es6": true,
"jest": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
// Avoid runtime error
"project": "./tsconfig.json"
},
"extends": [
// ESLint rules, including ECMAScript 6+ and React
"airbnb",
// Enable the linting rules for React hooks
"airbnb/hooks",
// Make all eslint core rules compatible with TypeScript
"eslint:recommended", // Rules which recommended for all projects by the ESLint Team
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
// Some highly valuable rules simply require type-checking in order to be implemented correctly
"plugin:@typescript-eslint/recommended-requiring-type-checking",
// Disable above code formatting related rules
"prettier",
// Required if a config uses a plugin
"prettier/@typescript-eslint",
"prettier/react",
"plugin:prettier/recommended"
],
"plugins": ["@typescript-eslint", "prettier"],
"settings": {
// Make CRA absolure import works with ESLint
"import/resolver": {
"node": {
"paths": ["src"],
"extensions": [".js", ".ts", ".tsx"]
}
}
},
"rules": {
// [FIX] JSX not allowed in files with extension '.tsx'
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
"react/jsx-filename-extension": [
1,
{
"extensions": [".ts", ".tsx"]
}
],
"import/no-extraneous-dependencies": 0,
"react/jsx-props-no-spreading": 0,
// [FIX] 'children' is missing in props validation
"react/prop-types": 0,
"prettier/prettier": [
"error",
{
"no-var-keyword": true,
"printWidth": 100,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"tabWidth": 2
}
]
}
}