-
Notifications
You must be signed in to change notification settings - Fork 7
/
eslint.config.mjs
47 lines (46 loc) · 1.16 KB
/
eslint.config.mjs
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
import eslintJs from '@eslint/js'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import globals from 'globals'
import pluginJest from 'eslint-plugin-jest'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
ignores: ['coverage/**', 'dist/**'],
},
{
languageOptions: {
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: import.meta.dirname,
},
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
'sort-imports': 'error',
},
},
{
files: ['tests/**/*.spec.*'],
plugins: {
jest: pluginJest,
},
languageOptions: {
globals: pluginJest.environments.globals.globals,
},
rules: {
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
},
},
eslintJs.configs.recommended,
tseslint.configs.eslintRecommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
eslintPluginPrettierRecommended,
)