@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 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', ...extendsSuffix],
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: globalRulesPrefix,
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
- case: 'pascalCase',
224
+ cases: {
225
+ kebabCase: true,
226
+ pascalCase: true,
227
+ },
228
+ ignore: ['^\\[slug\\]\\.astro$'],
195
229
  },
196
230
  ],
197
231
  },
@@ -15,6 +15,7 @@ bower_components/
15
15
  build/
16
16
  coverage/
17
17
  dist/
18
+ env.d.ts
18
19
  node_modules/
19
20
  vendor/
20
21
 
@@ -1,6 +1,7 @@
1
+ /* eslint-disable perfectionist/sort-objects */
1
2
  /* @type {import('eslint').Linter.Config} */
2
3
  module.exports = {
3
- extends: ['@kitschpatrol/eslint-config'],
4
4
  root: true,
5
+ extends: ['@kitschpatrol/eslint-config'],
5
6
  // Overrides
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitschpatrol/eslint-config",
3
- "version": "4.1.3",
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.4.0",
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",