-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.ts
More file actions
95 lines (91 loc) · 1.8 KB
/
eslint.config.ts
File metadata and controls
95 lines (91 loc) · 1.8 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
89
90
91
92
93
94
95
import { includeIgnoreFile } from '@eslint/compat'
import {
comments,
defineConfig,
imports,
javascript,
jsdoc,
jsonc,
markdown,
prettier,
promise,
regexp,
stylistic,
typescript,
unicorn,
vitest,
yaml
} from '@kazupon/eslint-config'
import { globalIgnores } from 'eslint/config'
import { fileURLToPath, URL } from 'node:url'
import type { Linter } from 'eslint'
const gitignorePath = fileURLToPath(new URL('.gitignore', import.meta.url))
const config: ReturnType<typeof defineConfig> = defineConfig(
javascript(),
stylistic(),
comments({
kazupon: {
ignores: [
'./scripts/**',
'./deno/**',
'./playground/**',
'./src/**/*.test-d.ts',
'./src/**/*.test.ts'
]
}
}),
jsdoc({
typescript: 'syntax',
ignores: ['./playground/**', './src/types.ts']
}),
imports({
typescript: true,
rules: {
'import/extensions': ['error', 'always', { ignorePackages: true }]
}
}),
promise(),
regexp(),
unicorn({
rules: {
'unicorn/filename-case': 'off',
'unicorn/no-null': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/prefer-string-replace-all': 'off'
}
}),
typescript({
parserOptions: {
tsconfigRootDir: import.meta.dirname,
project: true
}
}),
jsonc({
json: true,
json5: true,
jsonc: true,
prettier: true
}),
yaml({
prettier: true
}),
markdown({
preferences: true
}),
vitest(),
prettier(),
includeIgnoreFile(gitignorePath),
globalIgnores([
'.vscode',
'deno/**',
'docs/**',
'tsconfig.json',
'src/locale.ts',
'pnpm-lock.yaml',
'playground/**',
'CHANGELOG.md',
'.github/FUNDING.yml'
]) as Linter.Config
)
export default config