voss-node-configs 1.0.60 → 1.0.61

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 (2) hide show
  1. package/base.js +12 -0
  2. package/package.json +1 -1
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voss-node-configs",
3
- "version": "1.0.60",
3
+ "version": "1.0.61",
4
4
  "description": "Shared TypeScript and ESLint configs for Node.js projects",
5
5
  "exports": {
6
6
  "./tsconfig.base": "./tsconfig.base.json",