Repository navigation
Expand file tree
/
Copy patheslint.config.mjs
More file actions
82 lines (73 loc) · 2.47 KB
/
Copy patheslint.config.mjs
File metadata and controls
82 lines (73 loc) · 2.47 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
import js from '@eslint/js'
import tsPlugin from '@typescript-eslint/eslint-plugin'
import eslintComments from '@eslint-community/eslint-plugin-eslint-comments'
import noOnlyTests from 'eslint-plugin-no-only-tests'
import vitest from '@vitest/eslint-plugin'
import prettierRecommended from 'eslint-plugin-prettier/recommended'
import globals from 'globals'
export default [
{
ignores: ['dist/', 'node_modules/', 'coverage/', 'eslint.config.mjs', 'vitest.config.ts']
},
js.configs.recommended,
{
plugins: { '@eslint-community/eslint-comments': eslintComments },
rules: eslintComments.configs.recommended.rules
},
...tsPlugin.configs['flat/recommended-type-checked'],
...tsPlugin.configs['flat/stylistic-type-checked'],
{
files: ['**/*.ts'],
plugins: {
'no-only-tests': noOnlyTests
},
languageOptions: {
ecmaVersion: 2023,
parserOptions: {
project: ['./tsconfig.json', './tsconfig.test.json', './.github/linters/tsconfig.json'],
tsconfigRootDir: import.meta.dirname
},
globals: {
...globals.node
}
},
rules: {
camelcase: 'off',
'no-console': 'off',
'no-implicit-globals': 'error',
'no-only-tests/no-only-tests': 'error',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{ accessibility: 'no-public' }
],
'@typescript-eslint/explicit-function-return-type': [
'error',
{ allowExpressions: true }
],
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error'
}
},
{
files: ['**/*.test.ts', '__tests__/**/*.ts'],
...vitest.configs.recommended,
languageOptions: {
globals: vitest.environments.env.globals
},
rules: {
...vitest.configs.recommended.rules,
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/require-await': 'off'
}
},
prettierRecommended
]