generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
84 lines (82 loc) · 1.86 KB
/
eslint.config.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
// @ts-nocheck
import eslint from '@eslint/js'
import vitest from '@vitest/eslint-plugin'
import eslintConfigPrettier from 'eslint-config-prettier'
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import globals from 'globals'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
ignores: [
'.vscode',
'.devcontainer',
'dist',
'node_modules',
'eslint.config.js',
'example',
'payload-examples',
'__generated__'
]
},
{
files: ['**/*.{js,mjs,cjs,ts}']
},
{
languageOptions: {
globals: globals.node,
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname
}
}
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintPluginUnicorn.configs['flat/all'],
{
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prevent-abbreviations': 'off',
'no-console': 'error'
}
},
eslintConfigPrettier,
{
files: ['**/*.test.ts'],
plugins: {
vitest,
eslintPluginUnicorn
},
settings: {
vitest: {
typecheck: true
}
},
languageOptions: {
globals: {
...vitest.environments.env.globals
}
},
rules: {
...vitest.configs.all.rules,
'vitest/consistent-test-it': ['error', {fn: 'test'}],
'vitest/no-hooks': [
'error',
{allow: ['afterEach', 'beforeEach', 'afterAll']}
],
'vitest/max-expects': 'off',
'vitest/no-mocks-import': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/no-null': 'off',
'@typescript-eslint/unbound-method': 'off'
}
},
{
files: ['__fixtures__/**'],
rules: {
'unicorn/no-null': 'off',
'unicorn/numeric-separators-style': 'off'
}
}
)