-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.ts
More file actions
99 lines (98 loc) · 2.87 KB
/
eslint.config.ts
File metadata and controls
99 lines (98 loc) · 2.87 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
96
97
98
99
/* eslint-disable import-x/no-named-as-default-member */
import { includeIgnoreFile } from '@eslint/compat';
import css from '@eslint/css';
import eslint from '@eslint/js';
import html from '@html-eslint/eslint-plugin';
import stylistic from '@stylistic/eslint-plugin';
import { importX } from 'eslint-plugin-import-x';
import jsonc from 'eslint-plugin-jsonc';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import perfectionist from 'eslint-plugin-perfectionist';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import solidTsConfig from 'eslint-plugin-solid/configs/typescript';
import yml from 'eslint-plugin-yml';
import { defineConfig, globalIgnores } from 'eslint/config';
import { fileURLToPath } from 'node:url';
import tseslint from 'typescript-eslint';
export default defineConfig(
includeIgnoreFile(fileURLToPath(new URL('.gitignore', import.meta.url))),
globalIgnores(['pnpm-lock.yaml']),
{
languageOptions: {
parserOptions: {
...jsxA11y.flatConfigs.strict.languageOptions,
ecmaFeatures: {
jsx: true,
},
extraFileExtensions: ['.css'],
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
extends: [
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
jsxA11y.flatConfigs.strict,
// @ts-expect-error Types of property create are incompatible. (ts 2322)
solidTsConfig,
// @ts-expect-error Types of property languageOptions are incompatible. (ts 2322)
importX.flatConfigs.recommended,
// @ts-expect-error Types of property languageOptions are incompatible. (ts 2322)
importX.flatConfigs.typescript,
stylistic.configs.customize({
semi: true,
}),
perfectionist.configs['recommended-natural'],
prettierRecommended,
],
files: ['**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowNumber: true },
],
},
},
{
extends: [
jsonc.configs['flat/recommended-with-jsonc'],
prettierRecommended,
jsonc.configs['flat/prettier'],
],
files: ['**/*.json'],
},
{
extends: [
yml.configs['flat/recommended'],
prettierRecommended,
yml.configs['flat/prettier'],
],
files: ['**/*.{yml,yaml}'],
},
{
extends: ['css/recommended', prettierRecommended],
files: ['**/*.css'],
language: 'css/css',
plugins: { css },
rules: {
'css/no-invalid-at-rules': 'off',
},
},
{
extends: ['html/recommended'],
files: ['**/*.html'],
language: 'html/html',
plugins: { html },
rules: {
'html/attrs-newline': [
'error',
{ closeStyle: 'newline', ifAttrsMoreThan: 3 },
],
'html/indent': ['error', 2],
'html/no-trailing-spaces': 'error',
},
},
);