-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy patheslint.config.js
More file actions
102 lines (94 loc) · 3.24 KB
/
Copy patheslint.config.js
File metadata and controls
102 lines (94 loc) · 3.24 KB
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
import js from '@eslint/js';
import prettier from 'eslint-plugin-prettier';
import react from 'eslint-plugin-react';
import prettierConfig from 'eslint-config-prettier';
import globals from 'globals';
import vitest from '@vitest/eslint-plugin';
import tseslint from 'typescript-eslint';
export default [
{
ignores: ['dist/**', 'build/**', 'node_modules/**', 'public/**', '*.config.js', '*.config.ts', '*.config.cjs'],
},
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
vitest.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
globals: {
__COMMIT_HASH__: 'readonly',
...globals.browser,
},
},
plugins: {
prettier,
react,
vitest,
},
settings: {
vitest: {
typeCheck: true,
},
react: {
version: 'detect',
},
},
rules: {
'prettier/prettier': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
// Some of these rules can be removed as we increase type safety
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/await-thenable': 'warn',
'@typescript-eslint/no-redundant-type-constituents': 'warn',
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-unnecessary-type-assertion': 'off', // has false positives
'no-unused-vars': 'off',
'no-shadow': 'off',
'linebreak-style': ['error', 'unix'],
'no-irregular-whitespace': ['error', {skipComments: true}],
'no-alert': 'off',
'prefer-const': 'error',
'no-return-assign': 'error',
'no-useless-call': 'error',
'no-useless-concat': 'error',
'no-console': 'off',
'no-undef': 'off',
'no-unreachable': 'off',
'no-prototype-builtins': 'warn',
'react/react-in-jsx-scope': 'off',
'react/no-deprecated': 'warn',
'react/no-string-refs': 'warn',
'react/no-find-dom-node': 'warn',
'react/no-unescaped-entities': 'off',
'react/prop-types': 'off',
'vitest/no-commented-out-tests': 'off',
},
},
prettierConfig,
{
files: ['**/*.js'],
...tseslint.configs.disableTypeChecked,
},
];