-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
62 lines (61 loc) · 1.73 KB
/
Copy patheslint.config.js
File metadata and controls
62 lines (61 loc) · 1.73 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
import prettier from 'eslint-config-prettier'
import { defineConfig } from 'eslint/config'
import noOnlyTests from 'eslint-plugin-no-only-tests'
import tseslint from 'typescript-eslint'
export default defineConfig([
// Global ignores to keep linting fast and avoid vendor/build dirs
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'**/dist-npm/**',
'**/.husky/**',
'**/.git/**',
'tsdown.config.ts',
'eslint.config.js',
'.commitlintrc.js',
],
},
...tseslint.configs.recommended,
{
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'@typescript-eslint/only-throw-error': [
'error',
{
allow: [{ from: 'package', name: 'Error0', package: '@1gr14/error0' }],
},
],
'@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }],
curly: ['error', 'all'],
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-unnecessary-condition': ['error'], // slow rule
'@typescript-eslint/restrict-template-expressions': ['error'], // slow rule
'@typescript-eslint/switch-exhaustiveness-check': ['error'],
// overrides for enabled recommended rules
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
files: ['**/*.test.{js,jsx,ts,tsx}'],
plugins: {
'no-only-tests': noOnlyTests,
},
rules: {
'no-only-tests/no-only-tests': 'error',
},
},
prettier,
])