@flint.fyi/plugin-flint 0.5.2 → 0.6.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/lib/index.d.ts +14 -17
- package/lib/index.js +0 -2
- package/lib/plugin.d.ts +0 -1
- package/lib/rules/getStartSourceFile.d.ts +0 -1
- package/lib/rules/invalidCodeLines.d.ts +0 -1
- package/lib/rules/missingPlaceholders.d.ts +0 -1
- package/lib/rules/nodePropertyInChecks.d.ts +0 -1
- package/lib/rules/placeholderFormats.d.ts +0 -1
- package/lib/rules/pluginRuleOrdering.d.ts +0 -1
- package/lib/rules/ruleCreationMethods.d.ts +0 -1
- package/lib/rules/ruleCreator.d.ts +0 -1
- package/lib/rules/testCaseDuplicates.d.ts +0 -1
- package/lib/rules/testCaseNameDuplicates.d.ts +0 -1
- package/lib/rules/testCaseNonStaticCode.d.ts +0 -1
- package/lib/rules/testCaseOnlyFlags.d.ts +0 -1
- package/lib/rules/testShorthands.d.ts +0 -1
- package/lib/rules/unusedMessageIds.d.ts +0 -1
- package/lib/utils/findProperty.d.ts +0 -1
- package/lib/utils/getRuleTesterCaseArrays.d.ts +0 -1
- package/lib/utils/getRuleTesterDescribedCases.d.ts +0 -1
- package/lib/utils/importHelpers.d.ts +0 -1
- package/lib/utils/isTypeFromTS.d.ts +0 -1
- package/lib/utils/messageHelpers.d.ts +0 -1
- package/lib/utils/parseTestCases.d.ts +0 -1
- package/lib/utils/ruleCreatorHelpers.d.ts +0 -1
- package/lib/utils/tsAstToLiteral.d.ts +0 -1
- package/lib/utils/types.d.ts +0 -1
- package/package.json +6 -7
package/lib/index.d.ts
CHANGED
|
@@ -1,91 +1,89 @@
|
|
|
1
|
-
import * as _flint_fyi_core0 from "@flint.fyi/core";
|
|
2
|
-
|
|
3
1
|
//#region src/plugin.d.ts
|
|
4
|
-
declare const flint:
|
|
2
|
+
declare const flint: import("@flint.fyi/core").Plugin<import("@flint.fyi/core").RuleAbout<string>, string | undefined, [import("@flint.fyi/core").Rule<{
|
|
5
3
|
readonly description: "Requires passing `sourceFile` to `getStart()` for better performance.";
|
|
6
4
|
readonly id: "getStartSourceFile";
|
|
7
5
|
readonly presets: readonly ["logical"];
|
|
8
6
|
} & {
|
|
9
7
|
readonly pluginId: string;
|
|
10
8
|
readonly url: string;
|
|
11
|
-
}, "missingSourceFile", undefined>,
|
|
9
|
+
}, "missingSourceFile", undefined>, import("@flint.fyi/core").Rule<{
|
|
12
10
|
readonly description: "Reports cases for invalid code that isn't formatted across lines.";
|
|
13
11
|
readonly id: "invalidCodeLines";
|
|
14
12
|
readonly presets: readonly ["logical"];
|
|
15
13
|
} & {
|
|
16
14
|
readonly pluginId: string;
|
|
17
15
|
readonly url: string;
|
|
18
|
-
}, "singleLineTest", undefined>,
|
|
16
|
+
}, "singleLineTest", undefined>, import("@flint.fyi/core").Rule<{
|
|
19
17
|
readonly description: "Reports `context.report()` calls missing data for message placeholders.";
|
|
20
18
|
readonly id: "missingPlaceholders";
|
|
21
19
|
readonly presets: readonly ["logical"];
|
|
22
20
|
} & {
|
|
23
21
|
readonly pluginId: string;
|
|
24
22
|
readonly url: string;
|
|
25
|
-
}, "missingPlaceholders", undefined>,
|
|
23
|
+
}, "missingPlaceholders", undefined>, import("@flint.fyi/core").Rule<{
|
|
26
24
|
readonly description: "Disallows using the `in` operator to check properties on TypeScript nodes.";
|
|
27
25
|
readonly id: "nodePropertyInChecks";
|
|
28
26
|
readonly presets: readonly ["logical"];
|
|
29
27
|
} & {
|
|
30
28
|
readonly pluginId: string;
|
|
31
29
|
readonly url: string;
|
|
32
|
-
}, "nodePropertyInChecks", undefined>,
|
|
30
|
+
}, "nodePropertyInChecks", undefined>, import("@flint.fyi/core").Rule<{
|
|
33
31
|
readonly description: "Reports and auto-fixes message placeholders that are not formatted as `{{ placeholder }}`.";
|
|
34
32
|
readonly id: "placeholderFormats";
|
|
35
33
|
readonly presets: readonly ["stylistic", "stylisticStrict"];
|
|
36
34
|
} & {
|
|
37
35
|
readonly pluginId: string;
|
|
38
36
|
readonly url: string;
|
|
39
|
-
}, "placeholderFormats", undefined>,
|
|
37
|
+
}, "placeholderFormats", undefined>, import("@flint.fyi/core").Rule<{
|
|
40
38
|
readonly description: "Reports Flint plugin `rules` arrays that are not sorted alphabetically.";
|
|
41
39
|
readonly id: "pluginRuleOrdering";
|
|
42
40
|
readonly presets: readonly ["stylisticStrict"];
|
|
43
41
|
} & {
|
|
44
42
|
readonly pluginId: string;
|
|
45
43
|
readonly url: string;
|
|
46
|
-
}, "pluginRuleOrdering", undefined>,
|
|
44
|
+
}, "pluginRuleOrdering", undefined>, import("@flint.fyi/core").Rule<{
|
|
47
45
|
readonly description: "Reports plugin rules created directly with language instead of through RuleCreator.";
|
|
48
46
|
readonly id: "ruleCreationMethods";
|
|
49
47
|
readonly presets: readonly ["logical"];
|
|
50
48
|
} & {
|
|
51
49
|
readonly pluginId: string;
|
|
52
50
|
readonly url: string;
|
|
53
|
-
}, "ruleCreationMethods", undefined>,
|
|
51
|
+
}, "ruleCreationMethods", undefined>, import("@flint.fyi/core").Rule<{
|
|
54
52
|
readonly description: "Reports test cases that are identical to previous test cases.";
|
|
55
53
|
readonly id: "testCaseDuplicates";
|
|
56
54
|
readonly presets: readonly ["logical"];
|
|
57
55
|
} & {
|
|
58
56
|
readonly pluginId: string;
|
|
59
57
|
readonly url: string;
|
|
60
|
-
}, "duplicateTest", undefined>,
|
|
58
|
+
}, "duplicateTest", undefined>, import("@flint.fyi/core").Rule<{
|
|
61
59
|
readonly description: "Reports test cases that have the same name as a previous test case.";
|
|
62
60
|
readonly id: "testCaseNameDuplicates";
|
|
63
61
|
readonly presets: readonly ["logical"];
|
|
64
62
|
} & {
|
|
65
63
|
readonly pluginId: string;
|
|
66
64
|
readonly url: string;
|
|
67
|
-
}, "duplicateTestName", undefined>,
|
|
65
|
+
}, "duplicateTestName", undefined>, import("@flint.fyi/core").Rule<{
|
|
68
66
|
readonly description: "Test case code should be a static string literal.";
|
|
69
67
|
readonly id: "testCaseNonStaticCode";
|
|
70
68
|
readonly presets: readonly ["logical"];
|
|
71
69
|
} & {
|
|
72
70
|
readonly pluginId: string;
|
|
73
71
|
readonly url: string;
|
|
74
|
-
}, "nonStaticTestCaseCode", undefined>,
|
|
72
|
+
}, "nonStaticTestCaseCode", undefined>, import("@flint.fyi/core").Rule<{
|
|
75
73
|
readonly description: "Reports test cases that are marked `only: true`.";
|
|
76
74
|
readonly id: "testCaseOnlyFlags";
|
|
77
75
|
readonly presets: readonly ["logical"];
|
|
78
76
|
} & {
|
|
79
77
|
readonly pluginId: string;
|
|
80
78
|
readonly url: string;
|
|
81
|
-
}, "testCaseOnly", undefined>,
|
|
79
|
+
}, "testCaseOnly", undefined>, import("@flint.fyi/core").Rule<{
|
|
82
80
|
readonly description: "Test cases with only a code property can use string shorthand syntax instead of object literal syntax.";
|
|
83
81
|
readonly id: "testShorthands";
|
|
84
82
|
readonly presets: readonly ["logical"];
|
|
85
83
|
} & {
|
|
86
84
|
readonly pluginId: string;
|
|
87
85
|
readonly url: string;
|
|
88
|
-
}, "testShorthands", undefined>,
|
|
86
|
+
}, "testShorthands", undefined>, import("@flint.fyi/core").Rule<{
|
|
89
87
|
readonly description: "Reports message IDs defined in the messages object that are never used in recognized report calls.";
|
|
90
88
|
readonly id: "unusedMessageIds";
|
|
91
89
|
readonly presets: readonly ["logical"];
|
|
@@ -94,5 +92,4 @@ declare const flint: _flint_fyi_core0.Plugin<_flint_fyi_core0.RuleAbout<string>,
|
|
|
94
92
|
readonly url: string;
|
|
95
93
|
}, "unusedMessageIds", undefined>]>;
|
|
96
94
|
//#endregion
|
|
97
|
-
export { flint };
|
|
98
|
-
//# sourceMappingURL=index.d.ts.map
|
|
95
|
+
export { flint };
|
package/lib/index.js
CHANGED
package/lib/plugin.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { RuleCreator } from "@flint.fyi/core";
|
|
2
2
|
export declare const ruleCreator: RuleCreator<"logical" | "logicalStrict" | "stylistic" | "stylisticStrict", import("@flint.fyi/core").RuleAbout<"logical" | "logicalStrict" | "stylistic" | "stylisticStrict">>;
|
|
3
|
-
//# sourceMappingURL=ruleCreator.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type ts from "typescript";
|
|
2
2
|
import type { AST } from "@flint.fyi/typescript-language";
|
|
3
3
|
export declare function findProperty<Node extends AST.Expression>(properties: ts.NodeArray<AST.ObjectLiteralElementLike>, name: string, predicate: (node: AST.Expression) => node is Node): (AST.Expression & Node) | undefined;
|
|
4
|
-
//# sourceMappingURL=findProperty.d.ts.map
|
|
@@ -2,4 +2,3 @@ import { type Node } from "typescript";
|
|
|
2
2
|
import type { AST } from "@flint.fyi/typescript-language";
|
|
3
3
|
export declare function isImportedBindingFromModule(declaration: Node, moduleName: string): declaration is AST.ImportSpecifier | AST.NamespaceImport;
|
|
4
4
|
export declare function isImportedSpecifierFromModule(declaration: Node, moduleName: string, importedName: string): declaration is AST.ImportSpecifier;
|
|
5
|
-
//# sourceMappingURL=importHelpers.d.ts.map
|
|
@@ -9,4 +9,3 @@ export declare function findMessagesProperty(node: AST.CallExpression): AST.Prop
|
|
|
9
9
|
export declare function forEachMessageString(messagesProperty: AST.PropertyAssignment): Generator<MessageStringVisitorContext>;
|
|
10
10
|
export declare function getStringOriginalQuote(node: AST.StringLiteral, sourceFile: AST.SourceFile): string;
|
|
11
11
|
export {};
|
|
12
|
-
//# sourceMappingURL=messageHelpers.d.ts.map
|
|
@@ -2,4 +2,3 @@ import type { AST, Checker } from "@flint.fyi/typescript-language";
|
|
|
2
2
|
export declare function isLanguageCreateRule(node: AST.CallExpression, typeChecker: Checker): boolean;
|
|
3
3
|
export declare const isRuleCreatorCreateRule: (node: AST.CallExpression, typeChecker: Checker) => boolean;
|
|
4
4
|
export declare const isRuleContextReport: (node: AST.CallExpression, typeChecker: Checker) => boolean;
|
|
5
|
-
//# sourceMappingURL=ruleCreatorHelpers.d.ts.map
|
|
@@ -3,4 +3,3 @@ import type { AST } from "@flint.fyi/typescript-language";
|
|
|
3
3
|
export declare function tsAstToLiteral(node: AST.ArrayLiteralExpression): unknown[];
|
|
4
4
|
export declare function tsAstToLiteral(node: AST.ObjectLiteralExpression): object;
|
|
5
5
|
export declare function tsAstToLiteral(node: ts.Node): unknown;
|
|
6
|
-
//# sourceMappingURL=tsAstToLiteral.d.ts.map
|
package/lib/utils/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flint.fyi/plugin-flint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "[Experimental] A Flint plugin for linting Flint plugins.",
|
|
5
5
|
"homepage": "https://flint.fyi/rules/flint",
|
|
6
6
|
"repository": {
|
|
@@ -19,17 +19,16 @@
|
|
|
19
19
|
".": "./lib/index.js"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
|
-
"lib/"
|
|
23
|
-
"!lib/**/*.map"
|
|
22
|
+
"lib/"
|
|
24
23
|
],
|
|
25
24
|
"dependencies": {
|
|
26
|
-
"typescript": "^
|
|
27
|
-
"@flint.fyi/
|
|
25
|
+
"typescript": "^6.0.0",
|
|
26
|
+
"@flint.fyi/core": "^0.23.3",
|
|
28
27
|
"@flint.fyi/utils": "^0.14.1",
|
|
29
|
-
"@flint.fyi/
|
|
28
|
+
"@flint.fyi/typescript-language": "^0.18.4"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
32
|
-
"tsdown": "0.
|
|
31
|
+
"tsdown": "0.22.3",
|
|
33
32
|
"vitest": "4.1.0",
|
|
34
33
|
"@flint.fyi/rule-tester": "^0.16.4"
|
|
35
34
|
},
|