@wkovacs64/eslint-config 7.2.0 → 7.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +97 -99
  2. package/package.json +5 -4
package/index.js CHANGED
@@ -24,7 +24,7 @@ const hasReact = await has('react');
24
24
  const hasTestingLibrary = await has('@testing-library/dom');
25
25
  const hasJestDom = await has('@testing-library/jest-dom');
26
26
  const hasVitest = await has('vitest');
27
- const hasPlaywright = await has('playwright');
27
+ const hasPlaywright = await has('@playwright/test');
28
28
 
29
29
  const vitestFiles = ['**/__tests__/**/*', '**/*.test.*'];
30
30
  const testFiles = ['**/tests/**', '**/#tests/**', ...vitestFiles];
@@ -160,108 +160,106 @@ export const config = [
160
160
  // TODO: figure out how to switch to type-checked configs
161
161
  ...tseslint.configs.recommended,
162
162
  ...tseslint.configs.stylistic,
163
- ]
164
- : []),
165
- hasTypeScript
166
- ? {
167
- files: ['**/*.ts?(x)'],
168
- languageOptions: {
169
- parserOptions: {
170
- parser: tseslint.parser,
171
- projectService: true,
172
- },
173
- },
174
- plugins: {
175
- '@typescript-eslint': tseslint.plugin,
176
- },
177
- rules: {
178
- '@typescript-eslint/ban-ts-comment': OFF,
179
- '@typescript-eslint/consistent-type-assertions': [
180
- ERROR,
181
- {
182
- assertionStyle: 'as',
183
- objectLiteralTypeAssertions: 'allow-as-parameter',
184
- },
185
- ],
186
- '@typescript-eslint/consistent-type-definitions': OFF,
187
- 'import/consistent-type-specifier-style': [WARN, 'prefer-inline'],
188
- '@typescript-eslint/consistent-type-imports': [
189
- ERROR,
190
- {
191
- prefer: 'type-imports',
192
- disallowTypeAnnotations: true,
193
- fixStyle: 'inline-type-imports',
194
- },
195
- ],
196
- '@typescript-eslint/explicit-module-boundary-types': OFF,
197
- '@typescript-eslint/naming-convention': [
198
- ERROR,
199
- {
200
- selector: 'typeLike',
201
- format: ['PascalCase'],
202
- custom: { regex: '^I[A-Z]', match: false },
203
- },
204
- ],
205
- '@typescript-eslint/no-confusing-void-expression': [
206
- ERROR,
207
- {
208
- ignoreArrowShorthand: true,
209
- },
210
- ],
211
- '@typescript-eslint/no-explicit-any': OFF,
212
- '@typescript-eslint/no-floating-promises': [
213
- ERROR,
214
- {
215
- ignoreIIFE: true,
216
- },
217
- ],
218
- '@typescript-eslint/no-import-type-side-effects': ERROR,
219
- 'no-invalid-this': OFF,
220
- '@typescript-eslint/no-invalid-this': ERROR,
221
- 'no-redeclare': OFF,
222
- '@typescript-eslint/no-non-null-assertion': OFF,
223
- '@typescript-eslint/no-redeclare': ERROR,
224
- 'no-shadow': OFF,
225
- '@typescript-eslint/no-shadow': ERROR,
226
- '@typescript-eslint/no-unnecessary-type-constraint': 'warn',
227
- '@typescript-eslint/no-unused-vars': [
228
- ERROR,
229
- {
230
- vars: 'all',
231
- args: 'after-used',
232
- argsIgnorePattern: '^_',
233
- ignoreRestSiblings: true,
234
- },
235
- ],
236
- 'no-use-before-define': OFF,
237
- '@typescript-eslint/no-use-before-define': [
238
- ERROR,
239
- {
240
- functions: false,
241
- classes: true,
242
- variables: true,
243
- },
244
- ],
245
- '@typescript-eslint/prefer-nullish-coalescing': OFF,
246
- '@typescript-eslint/restrict-template-expressions': [
247
- ERROR,
248
- {
249
- allowBoolean: true,
250
- allowNullish: true,
163
+ {
164
+ files: ['**/*.ts?(x)'],
165
+ languageOptions: {
166
+ parserOptions: {
167
+ parser: tseslint.parser,
168
+ projectService: true,
251
169
  },
252
- ],
253
- '@typescript-eslint/require-await': OFF,
254
- '@typescript-eslint/unified-signatures': 'warn',
255
- },
256
- settings: {
257
- 'import/resolver': {
258
- typescript: {
259
- alwaysTryTypes: true,
170
+ },
171
+ plugins: {
172
+ '@typescript-eslint': tseslint.plugin,
173
+ },
174
+ rules: {
175
+ '@typescript-eslint/ban-ts-comment': OFF,
176
+ '@typescript-eslint/consistent-type-assertions': [
177
+ ERROR,
178
+ {
179
+ assertionStyle: 'as',
180
+ objectLiteralTypeAssertions: 'allow-as-parameter',
181
+ },
182
+ ],
183
+ '@typescript-eslint/consistent-type-definitions': OFF,
184
+ // Note: use this rule _OR_ verbatimModuleSyntax in tsconfig.json - not both
185
+ // '@typescript-eslint/consistent-type-imports': [
186
+ // ERROR,
187
+ // {
188
+ // prefer: 'type-imports',
189
+ // disallowTypeAnnotations: true,
190
+ // fixStyle: 'inline-type-imports',
191
+ // },
192
+ // ],
193
+ '@typescript-eslint/explicit-module-boundary-types': OFF,
194
+ '@typescript-eslint/naming-convention': [
195
+ ERROR,
196
+ {
197
+ selector: 'typeLike',
198
+ format: ['PascalCase'],
199
+ custom: { regex: '^I[A-Z]', match: false },
200
+ },
201
+ ],
202
+ '@typescript-eslint/no-confusing-void-expression': [
203
+ ERROR,
204
+ {
205
+ ignoreArrowShorthand: true,
206
+ },
207
+ ],
208
+ '@typescript-eslint/no-explicit-any': OFF,
209
+ '@typescript-eslint/no-floating-promises': [
210
+ ERROR,
211
+ {
212
+ ignoreIIFE: true,
213
+ },
214
+ ],
215
+ '@typescript-eslint/no-import-type-side-effects': ERROR,
216
+ 'no-invalid-this': OFF,
217
+ '@typescript-eslint/no-invalid-this': ERROR,
218
+ 'no-redeclare': OFF,
219
+ '@typescript-eslint/no-non-null-assertion': OFF,
220
+ '@typescript-eslint/no-redeclare': ERROR,
221
+ 'no-shadow': OFF,
222
+ '@typescript-eslint/no-shadow': ERROR,
223
+ '@typescript-eslint/no-unnecessary-type-constraint': 'warn',
224
+ '@typescript-eslint/no-unused-vars': [
225
+ ERROR,
226
+ {
227
+ vars: 'all',
228
+ args: 'after-used',
229
+ argsIgnorePattern: '^_',
230
+ ignoreRestSiblings: true,
231
+ },
232
+ ],
233
+ 'no-use-before-define': OFF,
234
+ '@typescript-eslint/no-use-before-define': [
235
+ ERROR,
236
+ {
237
+ functions: false,
238
+ classes: true,
239
+ variables: true,
240
+ },
241
+ ],
242
+ '@typescript-eslint/prefer-nullish-coalescing': OFF,
243
+ '@typescript-eslint/restrict-template-expressions': [
244
+ ERROR,
245
+ {
246
+ allowBoolean: true,
247
+ allowNullish: true,
248
+ },
249
+ ],
250
+ '@typescript-eslint/require-await': OFF,
251
+ '@typescript-eslint/unified-signatures': 'warn',
252
+ },
253
+ settings: {
254
+ 'import/resolver': {
255
+ typescript: {
256
+ alwaysTryTypes: true,
257
+ },
260
258
  },
261
259
  },
262
260
  },
263
- }
264
- : null,
261
+ ]
262
+ : []),
265
263
 
266
264
  // This assumes test files are those which are in the test directory or have
267
265
  // *.test.* in the filename. If a file doesn't match this assumption, then it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wkovacs64/eslint-config",
3
- "version": "7.2.0",
3
+ "version": "7.2.2",
4
4
  "description": "@wKovacs64 ESLint config",
5
5
  "keywords": [
6
6
  "eslint",
@@ -18,7 +18,8 @@
18
18
  "type": "module",
19
19
  "main": "index.js",
20
20
  "exports": {
21
- ".": "./index.js"
21
+ ".": "./index.js",
22
+ "./package.json": "./package.json"
22
23
  },
23
24
  "files": [
24
25
  "index.js"
@@ -65,12 +66,12 @@
65
66
  "@changesets/changelog-github": "0.5.0",
66
67
  "@changesets/cli": "2.27.5",
67
68
  "@types/eslint__js": "8.42.3",
68
- "@types/node": "20.14.1",
69
+ "@types/node": "20.14.2",
69
70
  "@types/react": "18.3.3",
70
71
  "@types/react-dom": "18.3.0",
71
72
  "@wkovacs64/prettier-config": "4.1.0",
72
73
  "eslint": "8.57.0",
73
- "prettier": "3.3.0",
74
+ "prettier": "3.3.1",
74
75
  "typescript": "5.4.5"
75
76
  }
76
77
  }