@w5s/eslint-config 3.5.3 → 3.5.4
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/dist/index.d.ts +200 -148
- package/dist/index.js +34 -26
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/src/config/imports.ts +2 -2
- package/src/typegen/markdown.d.ts +9 -0
- package/src/typegen/test.d.ts +47 -1
- package/src/typegen/ts.d.ts +13 -0
- package/src/typegen/unicorn.d.ts +248 -145
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/eslint-config",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.4",
|
|
4
4
|
"description": "ESLint configuration presets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -42,19 +42,19 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@eslint/js": "^10.0.0",
|
|
45
|
-
"@eslint/markdown": "^
|
|
45
|
+
"@eslint/markdown": "^8.0.0",
|
|
46
46
|
"@stylistic/eslint-plugin": "^5.0.0",
|
|
47
47
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
48
48
|
"@typescript-eslint/parser": "^8.0.0",
|
|
49
49
|
"@vitest/eslint-plugin": "^1.0.0",
|
|
50
|
-
"@w5s/dev": "^3.
|
|
51
|
-
"@w5s/prettier-config": "^3.1.
|
|
50
|
+
"@w5s/dev": "^3.3.0",
|
|
51
|
+
"@w5s/prettier-config": "^3.1.4",
|
|
52
52
|
"eslint-merge-processors": "^2.0.0",
|
|
53
53
|
"eslint-plugin-import": "~2.32.0",
|
|
54
|
-
"eslint-plugin-jsdoc": "~62.
|
|
54
|
+
"eslint-plugin-jsdoc": "~62.9.0",
|
|
55
55
|
"eslint-plugin-jsonc": "~3.1.0",
|
|
56
56
|
"eslint-plugin-n": "~17.24.0",
|
|
57
|
-
"eslint-plugin-unicorn": "~
|
|
57
|
+
"eslint-plugin-unicorn": "~64.0.0",
|
|
58
58
|
"eslint-plugin-yml": "~3.3.0",
|
|
59
59
|
"find-up": "^8.0.0",
|
|
60
60
|
"globals": "^17.0.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"eslint": "9.x || 10.x",
|
|
67
|
-
"typescript": "4.x || 5.x"
|
|
67
|
+
"typescript": "4.x || 5.x || 6.x"
|
|
68
68
|
},
|
|
69
69
|
"peerDependenciesMeta": {
|
|
70
70
|
"eslint": {
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"engines": {
|
|
78
|
-
"node": ">=
|
|
78
|
+
"node": ">=22.0.0"
|
|
79
79
|
},
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
83
|
"sideEffect": false,
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "38cf5f5877af4c8a1c292b9b7039c5a11863fc00"
|
|
85
85
|
}
|
package/src/config/imports.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { interopDefault } from '@w5s/dev';
|
|
2
|
-
import { PluginOptionsBase, StylisticConfig, type Config } from '../type.js';
|
|
3
|
-
import {
|
|
2
|
+
import { type PluginOptionsBase, StylisticConfig, type Config } from '../type.js';
|
|
3
|
+
import type { RuleOptions } from '../typegen/import.js';
|
|
4
4
|
|
|
5
5
|
export async function imports(options: imports.Options = {}) {
|
|
6
6
|
const { rules = {}, stylistic = true } = options;
|
|
@@ -14,6 +14,11 @@ export interface RuleOptions {
|
|
|
14
14
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/fenced-code-language.md
|
|
15
15
|
*/
|
|
16
16
|
'markdown/fenced-code-language'?: Linter.RuleEntry<MarkdownFencedCodeLanguage>
|
|
17
|
+
/**
|
|
18
|
+
* Require or disallow metadata for fenced code blocks
|
|
19
|
+
* @see https://github.com/eslint/markdown/blob/main/docs/rules/fenced-code-meta.md
|
|
20
|
+
*/
|
|
21
|
+
'markdown/fenced-code-meta'?: Linter.RuleEntry<MarkdownFencedCodeMeta>
|
|
17
22
|
/**
|
|
18
23
|
* Enforce heading levels increment by one
|
|
19
24
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/heading-increment.md
|
|
@@ -116,6 +121,8 @@ export interface RuleOptions {
|
|
|
116
121
|
type MarkdownFencedCodeLanguage = []|[{
|
|
117
122
|
required?: string[]
|
|
118
123
|
}]
|
|
124
|
+
// ----- markdown/fenced-code-meta -----
|
|
125
|
+
type MarkdownFencedCodeMeta = []|[("always" | "never")]
|
|
119
126
|
// ----- markdown/heading-increment -----
|
|
120
127
|
type MarkdownHeadingIncrement = []|[{
|
|
121
128
|
frontmatterTitle?: string
|
|
@@ -124,6 +131,7 @@ type MarkdownHeadingIncrement = []|[{
|
|
|
124
131
|
type MarkdownNoDuplicateDefinitions = []|[{
|
|
125
132
|
allowDefinitions?: string[]
|
|
126
133
|
allowFootnoteDefinitions?: string[]
|
|
134
|
+
checkFootnoteDefinitions?: boolean
|
|
127
135
|
}]
|
|
128
136
|
// ----- markdown/no-duplicate-headings -----
|
|
129
137
|
type MarkdownNoDuplicateHeadings = []|[{
|
|
@@ -165,6 +173,7 @@ type MarkdownNoSpaceInEmphasis = []|[{
|
|
|
165
173
|
type MarkdownNoUnusedDefinitions = []|[{
|
|
166
174
|
allowDefinitions?: string[]
|
|
167
175
|
allowFootnoteDefinitions?: string[]
|
|
176
|
+
checkFootnoteDefinitions?: boolean
|
|
168
177
|
}]
|
|
169
178
|
// ----- markdown/table-column-count -----
|
|
170
179
|
type MarkdownTableColumnCount = []|[{
|
package/src/typegen/test.d.ts
CHANGED
|
@@ -251,7 +251,7 @@ export interface RuleOptions {
|
|
|
251
251
|
*/
|
|
252
252
|
'test/prefer-expect-resolves'?: Linter.RuleEntry<[]>
|
|
253
253
|
/**
|
|
254
|
-
* enforce using `
|
|
254
|
+
* enforce using `expect(...).toBeTypeOf(...)` instead of `expect(typeof ...).toBe(...)`
|
|
255
255
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-type-of.md
|
|
256
256
|
*/
|
|
257
257
|
'test/prefer-expect-type-of'?: Linter.RuleEntry<[]>
|
|
@@ -390,6 +390,11 @@ export interface RuleOptions {
|
|
|
390
390
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-top-level-describe.md
|
|
391
391
|
*/
|
|
392
392
|
'test/require-top-level-describe'?: Linter.RuleEntry<TestRequireTopLevelDescribe>
|
|
393
|
+
/**
|
|
394
|
+
* enforce unbound methods are called with their expected scope
|
|
395
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/unbound-method.md
|
|
396
|
+
*/
|
|
397
|
+
'test/unbound-method'?: Linter.RuleEntry<TestUnboundMethod>
|
|
393
398
|
/**
|
|
394
399
|
* enforce valid describe callback
|
|
395
400
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-describe-callback.md
|
|
@@ -420,36 +425,49 @@ export interface RuleOptions {
|
|
|
420
425
|
/* ======= Declarations ======= */
|
|
421
426
|
// ----- test/consistent-each-for -----
|
|
422
427
|
type TestConsistentEachFor = []|[{
|
|
428
|
+
|
|
423
429
|
test?: ("each" | "for")
|
|
430
|
+
|
|
424
431
|
it?: ("each" | "for")
|
|
432
|
+
|
|
425
433
|
describe?: ("each" | "for")
|
|
434
|
+
|
|
426
435
|
suite?: ("each" | "for")
|
|
427
436
|
}]
|
|
428
437
|
// ----- test/consistent-test-filename -----
|
|
429
438
|
type TestConsistentTestFilename = []|[{
|
|
439
|
+
|
|
430
440
|
pattern?: string
|
|
441
|
+
|
|
431
442
|
allTestPattern?: string
|
|
432
443
|
}]
|
|
433
444
|
// ----- test/consistent-test-it -----
|
|
434
445
|
type TestConsistentTestIt = []|[{
|
|
446
|
+
|
|
435
447
|
fn?: ("test" | "it")
|
|
448
|
+
|
|
436
449
|
withinDescribe?: ("test" | "it")
|
|
437
450
|
}]
|
|
438
451
|
// ----- test/consistent-vitest-vi -----
|
|
439
452
|
type TestConsistentVitestVi = []|[{
|
|
453
|
+
|
|
440
454
|
fn?: ("vi" | "vitest")
|
|
441
455
|
}]
|
|
442
456
|
// ----- test/expect-expect -----
|
|
443
457
|
type TestExpectExpect = []|[{
|
|
458
|
+
|
|
444
459
|
assertFunctionNames?: string[]
|
|
460
|
+
|
|
445
461
|
additionalTestBlockFunctions?: string[]
|
|
446
462
|
}]
|
|
447
463
|
// ----- test/max-expects -----
|
|
448
464
|
type TestMaxExpects = []|[{
|
|
465
|
+
|
|
449
466
|
max?: number
|
|
450
467
|
}]
|
|
451
468
|
// ----- test/max-nested-describe -----
|
|
452
469
|
type TestMaxNestedDescribe = []|[{
|
|
470
|
+
|
|
453
471
|
max?: number
|
|
454
472
|
}]
|
|
455
473
|
// ----- test/no-conditional-expect -----
|
|
@@ -459,6 +477,7 @@ type TestNoConditionalExpect = []|[{
|
|
|
459
477
|
}]
|
|
460
478
|
// ----- test/no-focused-tests -----
|
|
461
479
|
type TestNoFocusedTests = []|[{
|
|
480
|
+
|
|
462
481
|
fixable?: boolean
|
|
463
482
|
}]
|
|
464
483
|
// ----- test/no-hooks -----
|
|
@@ -468,8 +487,11 @@ type TestNoHooks = []|[{
|
|
|
468
487
|
}]
|
|
469
488
|
// ----- test/no-large-snapshots -----
|
|
470
489
|
type TestNoLargeSnapshots = []|[{
|
|
490
|
+
|
|
471
491
|
maxSize?: number
|
|
492
|
+
|
|
472
493
|
inlineMaxSize?: number
|
|
494
|
+
|
|
473
495
|
allowedSnapshots?: {
|
|
474
496
|
[k: string]: unknown[] | undefined
|
|
475
497
|
}
|
|
@@ -484,50 +506,74 @@ type TestNoRestrictedViMethods = []|[{
|
|
|
484
506
|
}]
|
|
485
507
|
// ----- test/no-standalone-expect -----
|
|
486
508
|
type TestNoStandaloneExpect = []|[{
|
|
509
|
+
|
|
487
510
|
additionalTestBlockFunctions?: string[]
|
|
488
511
|
}]
|
|
489
512
|
// ----- test/prefer-expect-assertions -----
|
|
490
513
|
type TestPreferExpectAssertions = []|[{
|
|
514
|
+
|
|
491
515
|
onlyFunctionsWithAsyncKeyword?: boolean
|
|
516
|
+
|
|
492
517
|
onlyFunctionsWithExpectInLoop?: boolean
|
|
518
|
+
|
|
493
519
|
onlyFunctionsWithExpectInCallback?: boolean
|
|
494
520
|
}]
|
|
495
521
|
// ----- test/prefer-import-in-mock -----
|
|
496
522
|
type TestPreferImportInMock = []|[{
|
|
523
|
+
|
|
497
524
|
fixable?: boolean
|
|
498
525
|
}]
|
|
499
526
|
// ----- test/prefer-lowercase-title -----
|
|
500
527
|
type TestPreferLowercaseTitle = []|[{
|
|
528
|
+
|
|
501
529
|
ignore?: ("describe" | "test" | "it")[]
|
|
530
|
+
|
|
502
531
|
allowedPrefixes?: string[]
|
|
532
|
+
|
|
503
533
|
ignoreTopLevelDescribe?: boolean
|
|
534
|
+
|
|
504
535
|
lowercaseFirstCharacterOnly?: boolean
|
|
505
536
|
}]
|
|
506
537
|
// ----- test/prefer-snapshot-hint -----
|
|
507
538
|
type TestPreferSnapshotHint = []|[("always" | "multi")]
|
|
508
539
|
// ----- test/require-hook -----
|
|
509
540
|
type TestRequireHook = []|[{
|
|
541
|
+
|
|
510
542
|
allowedFunctionCalls?: string[]
|
|
511
543
|
}]
|
|
512
544
|
// ----- test/require-mock-type-parameters -----
|
|
513
545
|
type TestRequireMockTypeParameters = []|[{
|
|
546
|
+
|
|
514
547
|
checkImportFunctions?: boolean
|
|
515
548
|
}]
|
|
516
549
|
// ----- test/require-top-level-describe -----
|
|
517
550
|
type TestRequireTopLevelDescribe = []|[{
|
|
551
|
+
|
|
518
552
|
maxNumberOfTopLevelDescribes?: number
|
|
519
553
|
}]
|
|
554
|
+
// ----- test/unbound-method -----
|
|
555
|
+
type TestUnboundMethod = []|[{
|
|
556
|
+
|
|
557
|
+
ignoreStatic?: boolean
|
|
558
|
+
}]
|
|
520
559
|
// ----- test/valid-expect -----
|
|
521
560
|
type TestValidExpect = []|[{
|
|
561
|
+
|
|
522
562
|
alwaysAwait?: boolean
|
|
563
|
+
|
|
523
564
|
asyncMatchers?: string[]
|
|
565
|
+
|
|
524
566
|
minArgs?: number
|
|
567
|
+
|
|
525
568
|
maxArgs?: number
|
|
526
569
|
}]
|
|
527
570
|
// ----- test/valid-title -----
|
|
528
571
|
type TestValidTitle = []|[{
|
|
572
|
+
|
|
529
573
|
ignoreTypeOfDescribeName?: boolean
|
|
574
|
+
|
|
530
575
|
allowArguments?: boolean
|
|
576
|
+
|
|
531
577
|
disallowedWords?: string[]
|
|
532
578
|
[k: string]: (string | [string]|[string, string] | {
|
|
533
579
|
[k: string]: (string | [string]|[string, string]) | undefined
|
package/src/typegen/ts.d.ts
CHANGED
|
@@ -1706,6 +1706,19 @@ type TsPreferOptionalChain = []|[{
|
|
|
1706
1706
|
// ----- ts/prefer-promise-reject-errors -----
|
|
1707
1707
|
type TsPreferPromiseRejectErrors = []|[{
|
|
1708
1708
|
|
|
1709
|
+
allow?: (string | {
|
|
1710
|
+
from: "file"
|
|
1711
|
+
name: (string | [string, ...(string)[]])
|
|
1712
|
+
path?: string
|
|
1713
|
+
} | {
|
|
1714
|
+
from: "lib"
|
|
1715
|
+
name: (string | [string, ...(string)[]])
|
|
1716
|
+
} | {
|
|
1717
|
+
from: "package"
|
|
1718
|
+
name: (string | [string, ...(string)[]])
|
|
1719
|
+
package: string
|
|
1720
|
+
})[]
|
|
1721
|
+
|
|
1709
1722
|
allowEmptyReject?: boolean
|
|
1710
1723
|
|
|
1711
1724
|
allowThrowingAny?: boolean
|