-
-
Notifications
You must be signed in to change notification settings - Fork 184
/
.eslintrc.js
102 lines (102 loc) · 2.88 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
91
92
93
94
95
96
97
98
99
100
101
102
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
project: './tsconfig.json',
},
settings: {
version: 'detect',
},
plugins: [
'@typescript-eslint',
'chai-friendly',
'jest',
'import',
'prettier',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:unicorn/recommended',
'xo/browser',
'xo-typescript/space',
'xo-react/space',
'plugin:jest/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'prettier',
],
overrides: [
{
files: ['src/**/*.ts', 'tests/**/*.ts'],
rules: {
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0, maxBOF: 0 }],
'no-undef': 2,
'no-console': 'error',
'capitalized-comments': 0,
'func-style': ['error', 'declaration'],
'no-constant-binary-expression': 0,
'import/no-unresolved': 'error',
'import/no-relative-parent-imports': 'error',
'import/newline-after-import': 'error',
'import/no-anonymous-default-export': 'error',
'unicorn/filename-case': ['error', { case: 'camelCase' }],
'unicorn/prefer-optional-catch-binding': 0, // Doubleup
'unicorn/consistent-destructuring': 0,
'unicorn/prefer-node-protocol': 0,
'unicorn/import-style': 0,
'unicorn/prefer-array-flat': 0,
'unicorn/no-array-for-each': 0,
'unicorn/prevent-abbreviations': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
disallowTypeAnnotations: true,
},
],
},
},
{
files: ['tests/**/*test.ts'],
rules: {
'@typescript-eslint/no-require-imports': 0,
'unicorn/prefer-module': 0,
'jest/no-conditional-expect': 0,
},
},
{
files: ['types/tests/**/*.ts', 'types/tests/**/*.tsx'],
rules: {
'import/no-unassigned-import': 0,
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/no-unsafe-call': 0,
},
},
{
files: ['**/types/**/*.ts'],
rules: {
'import/no-relative-parent-imports': 0,
'unicorn/prefer-export-from': 0,
},
},
],
ignorePatterns: [
'/tests/plugin.test.js',
'/tests/stitches.config.js',
'/tests/__fixtures__',
'/types/macro.d.ts',
'/types',
'/.eslintrc.js',
'/macro.js',
'/sandbox',
'/jest.config.ts',
],
globals: { JSX: true, AriaAttributes: true, process: true },
env: { browser: false, node: true, es6: true },
}