eslint-config-nodejs-pmb 0.3.8 → 0.3.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/rules.js +11 -2
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  { "name": "eslint-config-nodejs-pmb",
2
- "version": "0.3.8",
2
+ "version": "0.3.10",
3
3
  "description": "My favorite eslint rules",
4
4
  "keywords": [],
5
5
 
package/rules.js CHANGED
@@ -41,6 +41,13 @@ const lineLengthRules = {
41
41
  ignoreUrls: true,
42
42
  };
43
43
 
44
+
45
+ const whenToPreferDestructuring = {
46
+ VariableDeclarator: { array: false, object: true },
47
+ AssignmentExpression: { array: false, object: false },
48
+ };
49
+
50
+
44
51
  const rules = {
45
52
 
46
53
  // rules docs: https://github.com/eslint/eslint.github.io/tree/master/docs/rules
@@ -67,7 +74,7 @@ const rules = {
67
74
  'object-curly-newline': 'off',
68
75
  'padded-blocks': 'off',
69
76
  'prefer-arrow-callback': 'off',
70
- 'prefer-destructuring': ['error', { array: false, object: true }],
77
+ 'prefer-destructuring': ['error', whenToPreferDestructuring],
71
78
  'prefer-template': 'off',
72
79
  'quote-props': 'off',
73
80
  'regexp/no-invalid-regexp': 'error',
@@ -76,7 +83,9 @@ const rules = {
76
83
  'unicode-bom': 'off',
77
84
 
78
85
  // Ugly but unfortunately node v12+ native ESM forces us to:
79
- 'import/extensions': ['error', 'ignorePackages'],
86
+ // 'import/extensions': ['error', 'ignorePackages'],
87
+ // … and due to some 2024-ish breakage in @std/esm, we even need
88
+ 'import/extensions': ['error', 'always'],
80
89
 
81
90
  // rules docs: https://github.com/eslint/eslint.github.io/tree/master/docs/rules
82
91
  };