@kitschpatrol/eslint-config 4.2.0 → 4.2.2

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} */
@@ -101,13 +126,14 @@ module.exports = {
101
126
  ecmaVersion: 2022,
102
127
  extraFileExtensions: ['.svelte', '.astro'], // Essential for these file types to make it to the override
103
128
  project: 'tsconfig.eslint.json',
129
+ tsconfigRootDir: process.cwd(), // Look for tsconfig in the consuming project's root
104
130
  sourceType: 'module',
105
131
  },
106
132
  rules: globalRulesPrefix,
107
133
  overrides: [
108
134
  // Markdown
109
135
  {
110
- extends: ['plugin:mdx/recommended', ...extendsSuffix],
136
+ extends: ['plugin:mdx/recommended'],
111
137
  files: ['*.md'],
112
138
  parser: 'eslint-mdx',
113
139
  rules: globalRulesPrefix,
@@ -118,6 +144,7 @@ module.exports = {
118
144
  files: ['*.mdx'],
119
145
  parser: 'eslint-mdx',
120
146
  rules: {
147
+ ...globalRulesPrefix,
121
148
  'no-unused-expressions': 'off',
122
149
  'no-unused-vars': 'off',
123
150
 
@@ -153,7 +180,7 @@ module.exports = {
153
180
  ],
154
181
  parser: '@typescript-eslint/parser',
155
182
  parserOptions: {
156
- project: true,
183
+ project: 'tsconfig.eslint.json', // Not sure why this isn't inherited
157
184
  },
158
185
  rules: {
159
186
  ...globalRulesPrefix,
@@ -164,7 +191,10 @@ module.exports = {
164
191
  {
165
192
  extends: [...extendsSuffix],
166
193
  files: ['*.jsx', '*.mjs', '*.cjs', '.js'],
167
- rules: globalRulesPrefix,
194
+ rules: {
195
+ ...globalRulesPrefix,
196
+ ...globalRulesTypescript,
197
+ },
168
198
  },
169
199
  // Astro
170
200
  {
@@ -179,7 +209,7 @@ module.exports = {
179
209
  parserOptions: {
180
210
  extraFileExtensions: ['.astro'],
181
211
  parser: '@typescript-eslint/parser',
182
- project: true,
212
+ project: 'tsconfig.eslint.json', // Not sure why this isn't inherited
183
213
  sourceType: 'module',
184
214
  },
185
215
  rules: {
@@ -187,11 +217,16 @@ module.exports = {
187
217
  ...globalRulesTypescript,
188
218
  '@typescript-eslint/no-unsafe-assignment': 'off', // Crashing
189
219
  '@typescript-eslint/no-unsafe-return': 'off', // Happens in templates
190
- // Astro components are PascalCase
220
+ // Astro components are usually PascalCase,
221
+ // but when used as pages they are kebab-case
191
222
  'unicorn/filename-case': [
192
223
  'error',
193
224
  {
194
- case: 'pascalCase',
225
+ cases: {
226
+ kebabCase: true,
227
+ pascalCase: true,
228
+ },
229
+ ignore: ['^\\[slug\\]\\.astro$'],
195
230
  },
196
231
  ],
197
232
  },
@@ -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.2.0",
3
+ "version": "4.2.2",
4
4
  "type": "module",
5
5
  "description": "Eslint config for @kitschpatrol/shared-config",
6
6
  "repository": {