@formspec/eslint-plugin 0.1.0-alpha.10
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/README.md +237 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +117 -0
- package/dist/index.js.map +1 -0
- package/dist/rules/consistent-constraints.d.ts +22 -0
- package/dist/rules/consistent-constraints.d.ts.map +1 -0
- package/dist/rules/consistent-constraints.js +178 -0
- package/dist/rules/consistent-constraints.js.map +1 -0
- package/dist/rules/constraints/allowed-field-types.d.ts +16 -0
- package/dist/rules/constraints/allowed-field-types.d.ts.map +1 -0
- package/dist/rules/constraints/allowed-field-types.js +133 -0
- package/dist/rules/constraints/allowed-field-types.js.map +1 -0
- package/dist/rules/constraints/allowed-layouts.d.ts +17 -0
- package/dist/rules/constraints/allowed-layouts.d.ts.map +1 -0
- package/dist/rules/constraints/allowed-layouts.js +83 -0
- package/dist/rules/constraints/allowed-layouts.js.map +1 -0
- package/dist/rules/constraints/index.d.ts +9 -0
- package/dist/rules/constraints/index.d.ts.map +1 -0
- package/dist/rules/constraints/index.js +9 -0
- package/dist/rules/constraints/index.js.map +1 -0
- package/dist/rules/decorator-allowed-field-types.d.ts +17 -0
- package/dist/rules/decorator-allowed-field-types.d.ts.map +1 -0
- package/dist/rules/decorator-allowed-field-types.js +71 -0
- package/dist/rules/decorator-allowed-field-types.js.map +1 -0
- package/dist/rules/decorator-field-type-mismatch.d.ts +14 -0
- package/dist/rules/decorator-field-type-mismatch.d.ts.map +1 -0
- package/dist/rules/decorator-field-type-mismatch.js +116 -0
- package/dist/rules/decorator-field-type-mismatch.js.map +1 -0
- package/dist/rules/enum-options-match-type.d.ts +26 -0
- package/dist/rules/enum-options-match-type.d.ts.map +1 -0
- package/dist/rules/enum-options-match-type.js +115 -0
- package/dist/rules/enum-options-match-type.js.map +1 -0
- package/dist/rules/index.d.ts +13 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +13 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/no-conflicting-decorators.d.ts +15 -0
- package/dist/rules/no-conflicting-decorators.d.ts.map +1 -0
- package/dist/rules/no-conflicting-decorators.js +72 -0
- package/dist/rules/no-conflicting-decorators.js.map +1 -0
- package/dist/rules/no-duplicate-decorators.d.ts +19 -0
- package/dist/rules/no-duplicate-decorators.d.ts.map +1 -0
- package/dist/rules/no-duplicate-decorators.js +59 -0
- package/dist/rules/no-duplicate-decorators.js.map +1 -0
- package/dist/rules/prefer-custom-decorator.d.ts +22 -0
- package/dist/rules/prefer-custom-decorator.d.ts.map +1 -0
- package/dist/rules/prefer-custom-decorator.js +72 -0
- package/dist/rules/prefer-custom-decorator.js.map +1 -0
- package/dist/rules/showwhen-field-exists.d.ts +21 -0
- package/dist/rules/showwhen-field-exists.d.ts.map +1 -0
- package/dist/rules/showwhen-field-exists.js +68 -0
- package/dist/rules/showwhen-field-exists.js.map +1 -0
- package/dist/rules/showwhen-suggests-optional.d.ts +19 -0
- package/dist/rules/showwhen-suggests-optional.d.ts.map +1 -0
- package/dist/rules/showwhen-suggests-optional.js +53 -0
- package/dist/rules/showwhen-suggests-optional.js.map +1 -0
- package/dist/utils/decorator-utils.d.ts +105 -0
- package/dist/utils/decorator-utils.d.ts.map +1 -0
- package/dist/utils/decorator-utils.js +216 -0
- package/dist/utils/decorator-utils.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/jsdoc-utils.d.ts +31 -0
- package/dist/utils/jsdoc-utils.d.ts.map +1 -0
- package/dist/utils/jsdoc-utils.js +81 -0
- package/dist/utils/jsdoc-utils.js.map +1 -0
- package/dist/utils/type-utils.d.ts +82 -0
- package/dist/utils/type-utils.d.ts.map +1 -0
- package/dist/utils/type-utils.js +216 -0
- package/dist/utils/type-utils.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for TypeScript type checking in ESLint rules.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Checks if a TypeScript type is a string type.
|
|
6
|
+
*
|
|
7
|
+
* Handles string primitives, string literals, and unions of string types.
|
|
8
|
+
*
|
|
9
|
+
* @param type - The TypeScript type to check
|
|
10
|
+
* @param checker - The TypeScript type checker instance
|
|
11
|
+
* @returns True if the type is string, a string literal, or a union of string types
|
|
12
|
+
*/
|
|
13
|
+
export function isStringType(type, checker) {
|
|
14
|
+
// Check for string primitive
|
|
15
|
+
if (type.flags & 4 /* ts.TypeFlags.String */) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
// Check for string literal
|
|
19
|
+
if (type.flags & 128 /* ts.TypeFlags.StringLiteral */) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
// Check for union of string literals (e.g., "a" | "b")
|
|
23
|
+
if (type.isUnion()) {
|
|
24
|
+
return type.types.every((t) => isStringType(t, checker));
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Checks if a TypeScript type is a number type.
|
|
30
|
+
*
|
|
31
|
+
* Handles number primitives, number literals, and unions of number types.
|
|
32
|
+
*
|
|
33
|
+
* @param type - The TypeScript type to check
|
|
34
|
+
* @param checker - The TypeScript type checker instance
|
|
35
|
+
* @returns True if the type is number, a number literal, or a union of number types
|
|
36
|
+
*/
|
|
37
|
+
export function isNumberType(type, checker) {
|
|
38
|
+
// Check for number primitive
|
|
39
|
+
if (type.flags & 8 /* ts.TypeFlags.Number */) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
// Check for number literal
|
|
43
|
+
if (type.flags & 256 /* ts.TypeFlags.NumberLiteral */) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
// Check for union of number literals
|
|
47
|
+
if (type.isUnion()) {
|
|
48
|
+
return type.types.every((t) => isNumberType(t, checker));
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Checks if a TypeScript type is a boolean type.
|
|
54
|
+
*
|
|
55
|
+
* Handles boolean primitives, boolean literals (true/false), and unions of boolean types.
|
|
56
|
+
*
|
|
57
|
+
* @param type - The TypeScript type to check
|
|
58
|
+
* @param checker - The TypeScript type checker instance
|
|
59
|
+
* @returns True if the type is boolean, true, false, or a union of boolean types
|
|
60
|
+
*/
|
|
61
|
+
export function isBooleanType(type, checker) {
|
|
62
|
+
// Check for boolean primitive
|
|
63
|
+
if (type.flags & 16 /* ts.TypeFlags.Boolean */) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
// Check for boolean literal (true or false)
|
|
67
|
+
if (type.flags & 512 /* ts.TypeFlags.BooleanLiteral */) {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
// Check for union of true | false
|
|
71
|
+
if (type.isUnion()) {
|
|
72
|
+
return type.types.every((t) => isBooleanType(t, checker));
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Checks if a TypeScript type is an array type.
|
|
78
|
+
*
|
|
79
|
+
* Handles Array<T>, T[], and readonly arrays.
|
|
80
|
+
*
|
|
81
|
+
* @param type - The TypeScript type to check
|
|
82
|
+
* @param checker - The TypeScript type checker instance
|
|
83
|
+
* @returns True if the type is an array type
|
|
84
|
+
*/
|
|
85
|
+
export function isArrayType(type, checker) {
|
|
86
|
+
// Check symbol name for Array
|
|
87
|
+
const symbol = type.getSymbol();
|
|
88
|
+
if (symbol?.name === "Array") {
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
// Check for array type node (T[])
|
|
92
|
+
const typeString = checker.typeToString(type);
|
|
93
|
+
if (typeString.endsWith("[]") || typeString.startsWith("Array<")) {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
// Check if it's a reference to Array
|
|
97
|
+
const typeRef = type;
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- target may not exist on non-reference types
|
|
99
|
+
if (typeRef.target && typeRef.target.symbol?.name === "Array") {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Strips `undefined` and `null` from a union type.
|
|
106
|
+
*
|
|
107
|
+
* Optional fields (`field?: string`) have type `string | undefined`. This
|
|
108
|
+
* function returns the non-nullish part so that type categorization works
|
|
109
|
+
* correctly for optional fields.
|
|
110
|
+
*
|
|
111
|
+
* If the type is not a union or all constituents are nullish, returns the
|
|
112
|
+
* original type unchanged.
|
|
113
|
+
*/
|
|
114
|
+
function stripNullishFromUnion(type) {
|
|
115
|
+
if (!type.isUnion())
|
|
116
|
+
return type;
|
|
117
|
+
const nonNullish = type.types.filter((t) => !((t.flags & (32768 | 65536)) /* ts.TypeFlags.Undefined | ts.TypeFlags.Null */));
|
|
118
|
+
if (nonNullish.length === 0)
|
|
119
|
+
return type;
|
|
120
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- length check above guarantees element exists
|
|
121
|
+
if (nonNullish.length === 1)
|
|
122
|
+
return nonNullish[0];
|
|
123
|
+
// Still a union after stripping — return original (union categorization applies)
|
|
124
|
+
return type;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Determines the field type category from a TypeScript type.
|
|
128
|
+
*
|
|
129
|
+
* Categories help determine which decorators are valid for a field.
|
|
130
|
+
*
|
|
131
|
+
* @param type - The TypeScript type to categorize
|
|
132
|
+
* @param checker - The TypeScript type checker instance
|
|
133
|
+
* @returns The field type category
|
|
134
|
+
*/
|
|
135
|
+
export function getFieldTypeCategory(type, checker) {
|
|
136
|
+
// Strip undefined/null from union types (e.g., optional fields: string | undefined → string)
|
|
137
|
+
const stripped = stripNullishFromUnion(type);
|
|
138
|
+
if (isStringType(stripped, checker))
|
|
139
|
+
return "string";
|
|
140
|
+
if (isNumberType(stripped, checker))
|
|
141
|
+
return "number";
|
|
142
|
+
if (isBooleanType(stripped, checker))
|
|
143
|
+
return "boolean";
|
|
144
|
+
if (isArrayType(stripped, checker))
|
|
145
|
+
return "array";
|
|
146
|
+
// Check for object types (but not arrays)
|
|
147
|
+
if (stripped.flags & 524288 /* ts.TypeFlags.Object */) {
|
|
148
|
+
return "object";
|
|
149
|
+
}
|
|
150
|
+
// Check for unions that aren't all strings/numbers
|
|
151
|
+
if (stripped.isUnion()) {
|
|
152
|
+
return "union";
|
|
153
|
+
}
|
|
154
|
+
return "unknown";
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Gets the TypeScript type of a class property.
|
|
158
|
+
*/
|
|
159
|
+
export function getPropertyType(node, services) {
|
|
160
|
+
try {
|
|
161
|
+
const checker = services.program.getTypeChecker();
|
|
162
|
+
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
|
|
163
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- map.get() can return undefined
|
|
164
|
+
if (!tsNode)
|
|
165
|
+
return null;
|
|
166
|
+
// Get the type from the type annotation or initializer
|
|
167
|
+
const type = checker.getTypeAtLocation(tsNode);
|
|
168
|
+
return type;
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Extracts string literal values from a union type.
|
|
176
|
+
* For type "a" | "b" | "c", returns ["a", "b", "c"].
|
|
177
|
+
*/
|
|
178
|
+
export function getStringLiteralUnionValues(type, _checker) {
|
|
179
|
+
if (!type.isUnion()) {
|
|
180
|
+
// Single string literal
|
|
181
|
+
if (type.isStringLiteral()) {
|
|
182
|
+
return [type.value];
|
|
183
|
+
}
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
const values = [];
|
|
187
|
+
for (const t of type.types) {
|
|
188
|
+
if (t.isStringLiteral()) {
|
|
189
|
+
values.push(t.value);
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
// Not all members are string literals
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return values.length > 0 ? values : null;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Checks if a field is marked as optional (has `?` modifier).
|
|
200
|
+
*/
|
|
201
|
+
export function isOptionalProperty(node) {
|
|
202
|
+
return node.optional;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Gets the type checker from parser services.
|
|
206
|
+
*/
|
|
207
|
+
export function getTypeChecker(services) {
|
|
208
|
+
return services.program.getTypeChecker();
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Converts a TypeScript type to a readable string.
|
|
212
|
+
*/
|
|
213
|
+
export function typeToString(type, checker) {
|
|
214
|
+
return checker.typeToString(type);
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=type-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-utils.js","sourceRoot":"","sources":["../../src/utils/type-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkBH;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,IAAa,EAAE,OAAuB;IACjE,6BAA6B;IAC7B,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,yBAAyB,EAAE,CAAC;QAC7C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,2BAA2B;IAC3B,IAAI,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,gCAAgC,EAAE,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,uDAAuD;IACvD,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,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AE,CAAC;YAC3B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE,CAAC;YACxB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,sCAAsC;YACtC,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAiC;IAClE,OAAO,IAAI,CAAC,QAAQ,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,QAA2C;IACxE,OAAO,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAa,EAAE,OAAuB;IACjE,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@formspec/eslint-plugin",
|
|
3
|
+
"version": "0.1.0-alpha.10",
|
|
4
|
+
"description": "ESLint rules for FormSpec decorator DSL type safety",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/eslint-plugin.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/eslint-plugin.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@typescript-eslint/utils": "^8.0.0",
|
|
19
|
+
"@formspec/constraints": "0.1.0-alpha.10",
|
|
20
|
+
"@formspec/core": "0.1.0-alpha.10"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"eslint": "^9.0.0",
|
|
24
|
+
"typescript": "^5.0.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@typescript-eslint/rule-tester": "^8.0.0",
|
|
28
|
+
"vitest": "^3.0.0"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"license": "UNLICENSED",
|
|
34
|
+
"keywords": [
|
|
35
|
+
"eslint",
|
|
36
|
+
"eslint-plugin",
|
|
37
|
+
"formspec",
|
|
38
|
+
"decorators",
|
|
39
|
+
"typescript"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc",
|
|
43
|
+
"clean": "rm -rf dist temp",
|
|
44
|
+
"typecheck": "tsc --noEmit",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"api-extractor": "api-extractor run",
|
|
47
|
+
"api-extractor:local": "api-extractor run --local",
|
|
48
|
+
"api-documenter": "api-documenter markdown -i temp -o docs"
|
|
49
|
+
}
|
|
50
|
+
}
|