@kitschpatrol/eslint-config 4.2.2 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/eslint.config.cjs +76 -6
- package/init/.vscode/settings.json +6 -5
- package/package.json +5 -2
package/eslint.config.cjs
CHANGED
|
@@ -85,33 +85,64 @@ const globalRulesTypescript = {
|
|
|
85
85
|
'no-undef': 'off',
|
|
86
86
|
'no-unused-vars': 'off',
|
|
87
87
|
'@typescript-eslint/naming-convention': [
|
|
88
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/naming-convention.md
|
|
88
89
|
'error',
|
|
90
|
+
// Group selectors
|
|
89
91
|
{
|
|
92
|
+
// Matches everything
|
|
90
93
|
selector: 'default',
|
|
91
|
-
format: ['camelCase'
|
|
94
|
+
format: ['camelCase'],
|
|
92
95
|
},
|
|
93
96
|
{
|
|
97
|
+
// Forgive quoted things
|
|
94
98
|
selector: 'default',
|
|
95
99
|
format: null,
|
|
96
100
|
modifiers: ['requiresQuotes'],
|
|
97
101
|
},
|
|
98
102
|
{
|
|
99
|
-
|
|
100
|
-
|
|
103
|
+
// Matches the same as class, enum, interface, typeAlias, typeParameter
|
|
104
|
+
selector: 'typeLike',
|
|
105
|
+
format: ['StrictPascalCase'],
|
|
101
106
|
},
|
|
102
107
|
{
|
|
103
|
-
|
|
108
|
+
// Matches the same as function, parameter and variable
|
|
109
|
+
selector: 'variableLike',
|
|
110
|
+
leadingUnderscore: 'allow',
|
|
111
|
+
trailingUnderscore: 'allow',
|
|
104
112
|
format: ['camelCase'],
|
|
105
113
|
},
|
|
114
|
+
// {
|
|
115
|
+
// // matches the same as accessor, enumMember, method, parameterProperty, property
|
|
116
|
+
// selector: 'memberLike'
|
|
117
|
+
// // format: []
|
|
118
|
+
// },
|
|
119
|
+
// {
|
|
120
|
+
// // matches the same as classMethod, objectLiteralMethod, typeMethod
|
|
121
|
+
// selector: 'method'
|
|
122
|
+
// // format: []
|
|
123
|
+
// },
|
|
124
|
+
// {
|
|
125
|
+
// // matches the same as classProperty, objectLiteralProperty, typeProperty
|
|
126
|
+
// selector: 'property'
|
|
127
|
+
// // format: []
|
|
128
|
+
// },
|
|
129
|
+
// Individual selectors
|
|
106
130
|
{
|
|
107
|
-
selector: '
|
|
108
|
-
format: ['StrictPascalCase'],
|
|
131
|
+
selector: 'import',
|
|
132
|
+
format: ['camelCase', 'StrictPascalCase'],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
// Allow Component import
|
|
136
|
+
selector: 'variable',
|
|
137
|
+
modifiers: ['destructured'],
|
|
138
|
+
format: ['camelCase', 'StrictPascalCase'],
|
|
109
139
|
},
|
|
110
140
|
],
|
|
111
141
|
}
|
|
112
142
|
|
|
113
143
|
/* @type {import('eslint').Linter.Config} */
|
|
114
144
|
module.exports = {
|
|
145
|
+
plugins: ['@html-eslint', 'html'],
|
|
115
146
|
extends: extendsPrefix,
|
|
116
147
|
env: {
|
|
117
148
|
browser: true,
|
|
@@ -131,6 +162,45 @@ module.exports = {
|
|
|
131
162
|
},
|
|
132
163
|
rules: globalRulesPrefix,
|
|
133
164
|
overrides: [
|
|
165
|
+
// HTML (and inline scripts)
|
|
166
|
+
{
|
|
167
|
+
files: ['*.html'],
|
|
168
|
+
parser: '@html-eslint/parser',
|
|
169
|
+
rules: {
|
|
170
|
+
// Best Practice
|
|
171
|
+
'@html-eslint/no-duplicate-attrs': 'error',
|
|
172
|
+
'@html-eslint/no-duplicate-id': 'error',
|
|
173
|
+
'@html-eslint/no-inline-styles': 'error',
|
|
174
|
+
'@html-eslint/no-obsolete-tags': 'error',
|
|
175
|
+
'@html-eslint/no-restricted-attr-values': 'error',
|
|
176
|
+
'@html-eslint/no-restricted-attrs': 'error',
|
|
177
|
+
'@html-eslint/no-script-style-type': 'error',
|
|
178
|
+
'@html-eslint/no-target-blank': 'error',
|
|
179
|
+
'@html-eslint/require-attrs': 'error',
|
|
180
|
+
'@html-eslint/require-button-type': 'error',
|
|
181
|
+
// '@html-eslint/require-closing-tags': 'error',
|
|
182
|
+
'@html-eslint/require-doctype': 'error',
|
|
183
|
+
'@html-eslint/require-li-container': 'error',
|
|
184
|
+
'@html-eslint/require-meta-charset': 'error',
|
|
185
|
+
// SEO
|
|
186
|
+
'@html-eslint/no-multiple-h1': 'error',
|
|
187
|
+
'@html-eslint/require-lang': 'error',
|
|
188
|
+
// '@html-eslint/require-meta-description': 'error',
|
|
189
|
+
// '@html-eslint/require-open-graph-protocol': 'error',
|
|
190
|
+
'@html-eslint/require-title': 'error',
|
|
191
|
+
// Accessibility
|
|
192
|
+
'@html-eslint/no-abstract-roles': 'error',
|
|
193
|
+
'@html-eslint/no-accesskey-attrs': 'error',
|
|
194
|
+
'@html-eslint/no-aria-hidden-body': 'error',
|
|
195
|
+
'@html-eslint/no-non-scalable-viewport': 'error',
|
|
196
|
+
'@html-eslint/no-positive-tabindex': 'error',
|
|
197
|
+
'@html-eslint/no-skip-heading-levels': 'error',
|
|
198
|
+
'@html-eslint/require-frame-title': 'error',
|
|
199
|
+
'@html-eslint/require-img-alt': 'error',
|
|
200
|
+
'@html-eslint/require-meta-viewport': 'error',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
|
|
134
204
|
// Markdown
|
|
135
205
|
{
|
|
136
206
|
extends: ['plugin:mdx/recommended'],
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
},
|
|
5
5
|
"eslint.enable": true,
|
|
6
6
|
"eslint.validate": [
|
|
7
|
+
"astro",
|
|
8
|
+
"html",
|
|
7
9
|
"javascript",
|
|
8
10
|
"javascriptreact",
|
|
9
|
-
"typescript",
|
|
10
|
-
"typescriptreact",
|
|
11
|
-
"svelte",
|
|
12
|
-
"astro",
|
|
13
11
|
"markdown",
|
|
14
|
-
"mdx"
|
|
12
|
+
"mdx",
|
|
13
|
+
"svelte",
|
|
14
|
+
"typescript",
|
|
15
|
+
"typescriptreact"
|
|
15
16
|
]
|
|
16
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/eslint-config",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Eslint config for @kitschpatrol/shared-config",
|
|
6
6
|
"repository": {
|
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
"eslint": ">=8.52.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
+
"@html-eslint/eslint-plugin": "^0.22.0",
|
|
38
|
+
"@html-eslint/parser": "^0.22.0",
|
|
37
39
|
"@pinojs/json-colorizer": "^4.0.0",
|
|
38
40
|
"@typescript-eslint/eslint-plugin": "^6.15.0",
|
|
39
41
|
"@typescript-eslint/parser": "^6.15.0",
|
|
@@ -42,8 +44,9 @@
|
|
|
42
44
|
"eslint-config-xo": "^0.43.1",
|
|
43
45
|
"eslint-config-xo-typescript": "^1.0.1",
|
|
44
46
|
"eslint-plugin-astro": "^0.30.0",
|
|
47
|
+
"eslint-plugin-html": "^7.1.0",
|
|
45
48
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
46
|
-
"eslint-plugin-mdx": "^3.0.
|
|
49
|
+
"eslint-plugin-mdx": "^3.0.1",
|
|
47
50
|
"eslint-plugin-n": "^16.5.0",
|
|
48
51
|
"eslint-plugin-perfectionist": "^2.5.0",
|
|
49
52
|
"eslint-plugin-svelte": "^2.35.1",
|