voss-node-configs 1.0.72 → 1.0.73
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/base.js +12 -1
- package/package.json +1 -1
package/base.js
CHANGED
|
@@ -13,6 +13,17 @@ export const noConditionalPropertyValue = {
|
|
|
13
13
|
'Extract the conditional into a named const instead of using it as an object property value.',
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
// Alias-only types re-name a type that already has a name, usually one
|
|
17
|
+
// imported from the repo's api-types package:
|
|
18
|
+
// export type InvokeResult = InvokePromptRunResponse;
|
|
19
|
+
// Generic aliases, type applications, intersections and unions stay allowed:
|
|
20
|
+
// type Wrapped<T> = Box<T>; type Row = ReturnType<typeof f>; type A = B & { x: number };
|
|
21
|
+
export const noAliasOnlyType = {
|
|
22
|
+
selector:
|
|
23
|
+
'TSTypeAliasDeclaration:not([typeParameters]) > TSTypeReference.typeAnnotation:not([typeArguments])',
|
|
24
|
+
message: 'Import and use the referenced type directly instead of aliasing it.',
|
|
25
|
+
};
|
|
26
|
+
|
|
16
27
|
export default [
|
|
17
28
|
js.configs.recommended,
|
|
18
29
|
{
|
|
@@ -74,7 +85,7 @@ export default [
|
|
|
74
85
|
'object-shorthand': ['error', 'properties'],
|
|
75
86
|
'prefer-destructuring': 'off',
|
|
76
87
|
|
|
77
|
-
'no-restricted-syntax': ['error', noConditionalPropertyValue],
|
|
88
|
+
'no-restricted-syntax': ['error', noConditionalPropertyValue, noAliasOnlyType],
|
|
78
89
|
},
|
|
79
90
|
},
|
|
80
91
|
// Turn off ESLint rules that conflict with Prettier (must come after other configs)
|