@kitschpatrol/eslint-config 4.1.3 → 4.2.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 +38 -4
- package/init/.eslintignore +1 -0
- package/init/.eslintrc.cjs +2 -1
- package/package.json +2 -2
package/eslint.config.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable unicorn/no-null */
|
|
1
2
|
/* eslint-disable perfectionist/sort-objects */
|
|
2
3
|
const extendsPrefix = [
|
|
3
4
|
'eslint:recommended',
|
|
@@ -83,6 +84,30 @@ const globalRulesTypescript = {
|
|
|
83
84
|
// https://typescript-eslint.io/linting/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
|
|
84
85
|
'no-undef': 'off',
|
|
85
86
|
'no-unused-vars': 'off',
|
|
87
|
+
'@typescript-eslint/naming-convention': [
|
|
88
|
+
'error',
|
|
89
|
+
{
|
|
90
|
+
selector: 'default',
|
|
91
|
+
format: ['camelCase', 'StrictPascalCase'],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
selector: 'default',
|
|
95
|
+
format: null,
|
|
96
|
+
modifiers: ['requiresQuotes'],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
selector: 'variable',
|
|
100
|
+
format: ['camelCase', 'StrictPascalCase'],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
selector: 'function',
|
|
104
|
+
format: ['camelCase'],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
selector: 'typeLike',
|
|
108
|
+
format: ['StrictPascalCase'],
|
|
109
|
+
},
|
|
110
|
+
],
|
|
86
111
|
}
|
|
87
112
|
|
|
88
113
|
/* @type {import('eslint').Linter.Config} */
|
|
@@ -107,7 +132,7 @@ module.exports = {
|
|
|
107
132
|
overrides: [
|
|
108
133
|
// Markdown
|
|
109
134
|
{
|
|
110
|
-
extends: ['plugin:mdx/recommended'
|
|
135
|
+
extends: ['plugin:mdx/recommended'],
|
|
111
136
|
files: ['*.md'],
|
|
112
137
|
parser: 'eslint-mdx',
|
|
113
138
|
rules: globalRulesPrefix,
|
|
@@ -118,6 +143,7 @@ module.exports = {
|
|
|
118
143
|
files: ['*.mdx'],
|
|
119
144
|
parser: 'eslint-mdx',
|
|
120
145
|
rules: {
|
|
146
|
+
...globalRulesPrefix,
|
|
121
147
|
'no-unused-expressions': 'off',
|
|
122
148
|
'no-unused-vars': 'off',
|
|
123
149
|
|
|
@@ -164,7 +190,10 @@ module.exports = {
|
|
|
164
190
|
{
|
|
165
191
|
extends: [...extendsSuffix],
|
|
166
192
|
files: ['*.jsx', '*.mjs', '*.cjs', '.js'],
|
|
167
|
-
rules:
|
|
193
|
+
rules: {
|
|
194
|
+
...globalRulesPrefix,
|
|
195
|
+
...globalRulesTypescript,
|
|
196
|
+
},
|
|
168
197
|
},
|
|
169
198
|
// Astro
|
|
170
199
|
{
|
|
@@ -187,11 +216,16 @@ module.exports = {
|
|
|
187
216
|
...globalRulesTypescript,
|
|
188
217
|
'@typescript-eslint/no-unsafe-assignment': 'off', // Crashing
|
|
189
218
|
'@typescript-eslint/no-unsafe-return': 'off', // Happens in templates
|
|
190
|
-
// Astro components are PascalCase
|
|
219
|
+
// Astro components are usually PascalCase,
|
|
220
|
+
// but when used as pages they are kebab-case
|
|
191
221
|
'unicorn/filename-case': [
|
|
192
222
|
'error',
|
|
193
223
|
{
|
|
194
|
-
|
|
224
|
+
cases: {
|
|
225
|
+
kebabCase: true,
|
|
226
|
+
pascalCase: true,
|
|
227
|
+
},
|
|
228
|
+
ignore: ['^\\[slug\\]\\.astro$'],
|
|
195
229
|
},
|
|
196
230
|
],
|
|
197
231
|
},
|
package/init/.eslintignore
CHANGED
package/init/.eslintrc.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/eslint-config",
|
|
3
|
-
"version": "4.1
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Eslint config for @kitschpatrol/shared-config",
|
|
6
6
|
"repository": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"eslint-plugin-astro": "^0.30.0",
|
|
45
45
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
46
46
|
"eslint-plugin-mdx": "^3.0.0",
|
|
47
|
-
"eslint-plugin-n": "^16.
|
|
47
|
+
"eslint-plugin-n": "^16.5.0",
|
|
48
48
|
"eslint-plugin-perfectionist": "^2.5.0",
|
|
49
49
|
"eslint-plugin-svelte": "^2.35.1",
|
|
50
50
|
"eslint-plugin-unicorn": "^49.0.0",
|