generated from allen-cell-animated/github-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc
104 lines (103 loc) · 3.32 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
{
"extends": ["eslint:recommended", "plugin:react/recommended"],
"env": {
"es6": true,
"browser": true,
"node": true
},
"ignorePatterns": ["/dist/**"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true,
"impliedStrict": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"overrides": [
{
// Use TypeScript-specific rules for TypeScript files
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{ "selector": "default", "format": ["camelCase"], "leadingUnderscore": "allow" },
{
"selector": ["enumMember"],
"format": ["camelCase", "UPPER_CASE"],
"leadingUnderscore": "allow"
},
// Allow function components to use PascalCase
{ "selector": "function", "format": ["camelCase", "PascalCase"] },
// Allow const variables to use PascalCase (specifically for styled-components)
{
"selector": ["variable"],
"modifiers": ["const"],
"format": ["camelCase", "UPPER_CASE", "PascalCase"],
"leadingUnderscore": "allow"
},
{ "selector": "objectLiteralProperty", "format": ["camelCase", "PascalCase"] },
{ "selector": "typeLike", "format": ["PascalCase"] }
]
},
"parserOptions": {
"project": ["./tsconfig.json"]
}
}
],
"plugins": ["@typescript-eslint", "simple-import-sort"],
"rules": {
"comma-style": [1, "last"],
"curly": [1, "multi-line"],
"eol-last": 1,
"eqeqeq": 1,
"new-cap": 1,
"no-undef": "error",
"no-array-constructor": 1,
"no-mixed-spaces-and-tabs": 1,
"no-new-object": 1,
"no-shadow-restricted-names": 1,
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"no-unused-vars": 0, // Rely on typescript-eslint rule above
"@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true }],
"@typescript-eslint/no-duplicate-enum-values": "error",
"@typescript-eslint/typedef": ["error", { "parameters": true }],
"prefer-const": 1,
"radix": 1,
"react/prop-types": 0, // This relies specifically on React PropTypes and ignores other typing methods
"semi": 2,
"simple-import-sort/imports": [
"warn",
{
"groups": [
// Side effect imports.
["^\\u0000"],
// Node.js builtins prefixed with `node:`.
["^node:"],
// Packages.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
["^@?\\w"],
// Absolute imports and other imports such as Vue-style `@/foo`.
// Anything not matched in another group.
["^"],
// Relative imports - lowercase utilities and submodules
["^[.]+.*/[a-z]+[\\w]*$"],
// Relative imports - other classes and components
["^[./].*/[\\w?&]*$"],
// Relative imports - resource files
["^[.].*/[\\w?_\\-]*[.][\\w.?&_\\-]*$"]
]
}
],
"simple-import-sort/exports": "warn",
"space-before-blocks": [1, "always"]
}
}