@sarj/eslint-plugin 16.35.0 → 16.36.0
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/{_docs-Bq5OCcWF.d.cts → _docs-IZjowAEc.d.cts} +21 -1
- package/dist/{_docs-Bq5OCcWF.d.ts → _docs-IZjowAEc.d.ts} +21 -1
- package/dist/index.cjs +341 -337
- package/dist/index.d.cts +175 -502
- package/dist/index.d.ts +175 -502
- package/dist/index.js +341 -337
- package/dist/rule-examples.cjs +49 -0
- package/dist/rule-examples.js +49 -0
- package/package.json +1 -1
|
@@ -13,6 +13,24 @@ interface ExampleFile {
|
|
|
13
13
|
readonly path: string;
|
|
14
14
|
readonly source: string;
|
|
15
15
|
}
|
|
16
|
+
interface ExamplePoint {
|
|
17
|
+
readonly line: number;
|
|
18
|
+
readonly column: number;
|
|
19
|
+
}
|
|
20
|
+
interface ExampleLocation extends ExamplePoint {
|
|
21
|
+
readonly end?: ExamplePoint;
|
|
22
|
+
}
|
|
23
|
+
interface SuggestionExpectation {
|
|
24
|
+
readonly messageId: string;
|
|
25
|
+
readonly output: string;
|
|
26
|
+
}
|
|
27
|
+
interface DiagnosticExpectation {
|
|
28
|
+
readonly messageId: string;
|
|
29
|
+
readonly message: string;
|
|
30
|
+
readonly location: ExampleLocation;
|
|
31
|
+
readonly automaticFix: boolean;
|
|
32
|
+
readonly suggestions: readonly SuggestionExpectation[];
|
|
33
|
+
}
|
|
16
34
|
/** A reviewed example. It remains private unless `public: true` is explicit. */
|
|
17
35
|
interface RuleExample<Options extends readonly unknown[] = readonly unknown[]> {
|
|
18
36
|
readonly ruleOptions?: Readonly<Options>;
|
|
@@ -27,9 +45,11 @@ interface RuleExample<Options extends readonly unknown[] = readonly unknown[]> {
|
|
|
27
45
|
readonly files: readonly ExampleFile[];
|
|
28
46
|
readonly focusPath: string;
|
|
29
47
|
readonly expectedCount: number;
|
|
48
|
+
readonly expectedDiagnostics?: readonly DiagnosticExpectation[];
|
|
30
49
|
readonly public?: boolean;
|
|
31
50
|
readonly fixedFiles?: readonly ExampleFile[];
|
|
32
51
|
}
|
|
52
|
+
type PublicRuleExample = Omit<RuleExample, "expectedDiagnostics">;
|
|
33
53
|
/** Human-authored fields that cannot be derived from the ESLint rule module. */
|
|
34
54
|
interface RuleDocumentation<Options extends readonly unknown[] = readonly unknown[]> {
|
|
35
55
|
readonly summary: string;
|
|
@@ -76,7 +96,7 @@ interface PublicRuleSpec {
|
|
|
76
96
|
readonly since: string | null;
|
|
77
97
|
readonly messageIds: readonly string[];
|
|
78
98
|
readonly optionsSchema: object | null;
|
|
79
|
-
readonly examples: readonly
|
|
99
|
+
readonly examples: readonly PublicRuleExample[];
|
|
80
100
|
}
|
|
81
101
|
declare const eslintCreateRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener> & {
|
|
82
102
|
name: string;
|
|
@@ -13,6 +13,24 @@ interface ExampleFile {
|
|
|
13
13
|
readonly path: string;
|
|
14
14
|
readonly source: string;
|
|
15
15
|
}
|
|
16
|
+
interface ExamplePoint {
|
|
17
|
+
readonly line: number;
|
|
18
|
+
readonly column: number;
|
|
19
|
+
}
|
|
20
|
+
interface ExampleLocation extends ExamplePoint {
|
|
21
|
+
readonly end?: ExamplePoint;
|
|
22
|
+
}
|
|
23
|
+
interface SuggestionExpectation {
|
|
24
|
+
readonly messageId: string;
|
|
25
|
+
readonly output: string;
|
|
26
|
+
}
|
|
27
|
+
interface DiagnosticExpectation {
|
|
28
|
+
readonly messageId: string;
|
|
29
|
+
readonly message: string;
|
|
30
|
+
readonly location: ExampleLocation;
|
|
31
|
+
readonly automaticFix: boolean;
|
|
32
|
+
readonly suggestions: readonly SuggestionExpectation[];
|
|
33
|
+
}
|
|
16
34
|
/** A reviewed example. It remains private unless `public: true` is explicit. */
|
|
17
35
|
interface RuleExample<Options extends readonly unknown[] = readonly unknown[]> {
|
|
18
36
|
readonly ruleOptions?: Readonly<Options>;
|
|
@@ -27,9 +45,11 @@ interface RuleExample<Options extends readonly unknown[] = readonly unknown[]> {
|
|
|
27
45
|
readonly files: readonly ExampleFile[];
|
|
28
46
|
readonly focusPath: string;
|
|
29
47
|
readonly expectedCount: number;
|
|
48
|
+
readonly expectedDiagnostics?: readonly DiagnosticExpectation[];
|
|
30
49
|
readonly public?: boolean;
|
|
31
50
|
readonly fixedFiles?: readonly ExampleFile[];
|
|
32
51
|
}
|
|
52
|
+
type PublicRuleExample = Omit<RuleExample, "expectedDiagnostics">;
|
|
33
53
|
/** Human-authored fields that cannot be derived from the ESLint rule module. */
|
|
34
54
|
interface RuleDocumentation<Options extends readonly unknown[] = readonly unknown[]> {
|
|
35
55
|
readonly summary: string;
|
|
@@ -76,7 +96,7 @@ interface PublicRuleSpec {
|
|
|
76
96
|
readonly since: string | null;
|
|
77
97
|
readonly messageIds: readonly string[];
|
|
78
98
|
readonly optionsSchema: object | null;
|
|
79
|
-
readonly examples: readonly
|
|
99
|
+
readonly examples: readonly PublicRuleExample[];
|
|
80
100
|
}
|
|
81
101
|
declare const eslintCreateRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener> & {
|
|
82
102
|
name: string;
|