voss-node-configs 1.0.72 → 1.0.74

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.
Files changed (3) hide show
  1. package/back-end.js +5 -0
  2. package/base.js +12 -1
  3. package/package.json +1 -1
package/back-end.js CHANGED
@@ -66,6 +66,11 @@ export default [
66
66
  {
67
67
  // Override for scripts/cli/migrations - allow sync operations and process.exit() for proper CLI/script error handling
68
68
  files: ['scripts/**/*', 'cli/**/*', 'migrations/**/*'],
69
+ languageOptions: {
70
+ globals: {
71
+ ...globals.node,
72
+ },
73
+ },
69
74
  rules: {
70
75
  'no-sync': 'off',
71
76
  'no-process-exit': 'off',
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voss-node-configs",
3
- "version": "1.0.72",
3
+ "version": "1.0.74",
4
4
  "description": "Shared TypeScript and ESLint configs for Node.js projects",
5
5
  "exports": {
6
6
  "./tsconfig.base": "./tsconfig.base.json",