voss-node-configs 1.0.60 → 1.0.62
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/back-end.js +9 -0
- package/base.js +12 -0
- package/package.json +1 -1
package/back-end.js
CHANGED
|
@@ -48,6 +48,15 @@ export default [
|
|
|
48
48
|
'no-sync': 'error', // Warn about synchronous methods
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
|
+
{
|
|
52
|
+
// Test files run in Node; use full Node globals (e.g. fetch) like backend .js/.mjs
|
|
53
|
+
files: ['**/*.{test,spec}.ts', '**/__tests__/**/*.ts'],
|
|
54
|
+
languageOptions: {
|
|
55
|
+
globals: {
|
|
56
|
+
...globals.node,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
51
60
|
{
|
|
52
61
|
// Override for scripts/cli/migrations - allow sync operations and process.exit() for proper CLI/script error handling
|
|
53
62
|
files: ['scripts/**/*', 'cli/**/*', 'migrations/**/*'],
|
package/base.js
CHANGED
|
@@ -64,6 +64,18 @@ export default [
|
|
|
64
64
|
'no-use-before-define': ['error', { functions: false, classes: true }],
|
|
65
65
|
'object-shorthand': ['error', 'properties'],
|
|
66
66
|
'prefer-destructuring': 'off',
|
|
67
|
+
|
|
68
|
+
// Named const required when a conditional would otherwise be the property
|
|
69
|
+
// value. Spreads that optionally include a property stay allowed:
|
|
70
|
+
// ...(ready ? { status: 'ready' } : {})
|
|
71
|
+
'no-restricted-syntax': [
|
|
72
|
+
'error',
|
|
73
|
+
{
|
|
74
|
+
selector: 'Property[value.type="ConditionalExpression"]',
|
|
75
|
+
message:
|
|
76
|
+
'Extract the conditional into a named const instead of using it as an object property value.',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
67
79
|
},
|
|
68
80
|
},
|
|
69
81
|
// Turn off ESLint rules that conflict with Prettier (must come after other configs)
|