-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.js
78 lines (77 loc) · 2.1 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
import eslint from '@eslint/js';
import vitest from 'eslint-plugin-vitest';
import prettierConfig from 'eslint-config-prettier';
import tsdocPlugin from 'eslint-plugin-tsdoc';
import tseslint from 'typescript-eslint';
import playwright from 'eslint-plugin-playwright';
export default tseslint.config(
{
ignores: [
'.DS_Store',
'node_modules',
'**/node_modules/**',
'dist',
'/package',
'tests/e2e',
'.env',
'.env.*',
'!.env.example',
'pnpm-lock.yaml',
'package-lock.json',
'yarn.lock',
'external',
'examples',
'legacy',
'coverage',
'ideas',
'docs',
],
},
{
// TypeScript files
files: ['{src,tests}/**/*.ts'],
extends: [
eslint.configs.recommended,
...tseslint.configs.stylisticTypeChecked,
...tseslint.configs.strictTypeChecked,
],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: 'tsconfig.json',
projectService: true,
ecmaVersion: 'latest',
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': tseslint.plugin,
tsdoc: tsdocPlugin,
},
rules: {
'tsdoc/syntax': 'warn',
'@typescript-eslint/no-inferrable-types': 'off',
},
},
{
// JavaScript files
files: ['**/*.js'],
...tseslint.configs.disableTypeChecked,
},
{
// Vitest test files
files: ['tests/unit/**/*.{test,spec}.ts'],
plugins: { vitest },
rules: vitest.configs.recommended.rules,
languageOptions: {
globals: vitest.environments.env.globals,
},
},
{
// Playwright test files
files: ['tests/e2e/**/*.{test,spec}.ts'],
plugins: { playwright },
rules: playwright.configs.recommended.rules,
},
prettierConfig,
);