-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
88 lines (85 loc) · 2.08 KB
/
eslint.config.mjs
File metadata and controls
88 lines (85 loc) · 2.08 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
83
84
85
86
87
88
// @ts-check
import eslint from '@eslint/js'
import { defineConfig } from 'eslint/config'
import eslintConfigPrettier from 'eslint-config-prettier'
import importX from 'eslint-plugin-import-x'
import tseslint from 'typescript-eslint'
import { fileURLToPath } from 'node:url'
import { dirname } from 'node:path'
const __dirname = dirname(fileURLToPath(import.meta.url))
export default defineConfig(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
ignores: [
'**/dist/**',
'**/node_modules/**',
'**/coverage/**',
'eslint.config.mjs',
'examples/react/vite.config.ts',
],
},
{
files: ['packages/haystack/src/**/*.ts', 'packages/haystack/tests/**/*.ts'],
languageOptions: {
parserOptions: {
project: './packages/haystack/tsconfig.json',
tsconfigRootDir: __dirname,
},
},
plugins: {
// @ts-expect-error https://github.com/typescript-eslint/typescript-eslint/issues/11543
'import-x': importX,
},
rules: {
'import-x/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
'type',
],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
},
{
files: ['packages/haystack/tests/**/*.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
},
},
{
files: ['examples/node-cli/src/**/*.ts'],
languageOptions: {
parserOptions: {
project: './examples/node-cli/tsconfig.json',
tsconfigRootDir: __dirname,
},
},
},
{
files: ['examples/react/src/**/*.ts', 'examples/react/src/**/*.tsx'],
languageOptions: {
parserOptions: {
project: './examples/react/tsconfig.json',
tsconfigRootDir: __dirname,
},
},
},
eslintConfigPrettier,
)