@enormora/eslint-config-base 0.0.32 → 0.0.33
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/package.json +1 -1
- package/presets/base/base-shared.js +4 -1
- package/readme.md +2 -0
- package/rule-sets/restricted-syntax.js +5 -0
- package/sbom.cdx.json +4 -4
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
createRestrictedSyntaxPlugin,
|
|
9
9
|
noClassDeclarationRestriction,
|
|
10
10
|
noEmptyFunctionBodyRestriction,
|
|
11
|
+
noInOperatorRestriction,
|
|
11
12
|
noSwitchStatementRestriction
|
|
12
13
|
} from '../../rule-sets/restricted-syntax.js';
|
|
13
14
|
import { stylisticRuleSet } from '../../rule-sets/stylistic.js';
|
|
@@ -15,7 +16,8 @@ import { stylisticRuleSet } from '../../rule-sets/stylistic.js';
|
|
|
15
16
|
const restrictedSyntaxPlugin = createRestrictedSyntaxPlugin([
|
|
16
17
|
'no-class-declaration',
|
|
17
18
|
'no-switch-statement',
|
|
18
|
-
'no-empty-function-body'
|
|
19
|
+
'no-empty-function-body',
|
|
20
|
+
'no-in-operator'
|
|
19
21
|
]);
|
|
20
22
|
|
|
21
23
|
export const baseSharedConfig = {
|
|
@@ -128,6 +130,7 @@ export const baseSharedConfig = {
|
|
|
128
130
|
'restricted-syntax/no-class-declaration': [ 'error', noClassDeclarationRestriction ],
|
|
129
131
|
'restricted-syntax/no-switch-statement': [ 'error', noSwitchStatementRestriction ],
|
|
130
132
|
'restricted-syntax/no-empty-function-body': [ 'error', noEmptyFunctionBodyRestriction ],
|
|
133
|
+
'restricted-syntax/no-in-operator': [ 'error', noInOperatorRestriction ],
|
|
131
134
|
'no-return-assign': [ 'error', 'always' ],
|
|
132
135
|
'no-self-assign': [ 'error', { props: true } ],
|
|
133
136
|
'no-self-compare': 'error',
|
package/readme.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# `@enormora/eslint-config-base`
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@enormora/eslint-config-base)
|
|
4
|
+
|
|
3
5
|
Base ESLint config preset, agnostic to any environment, framework, or library. Targets ESM-only projects.
|
|
4
6
|
|
|
5
7
|
Code formatting is handled by [dprint](https://dprint.dev/), wired into ESLint via the
|
|
@@ -42,3 +42,8 @@ export const noEmptyFunctionBodyRestriction = {
|
|
|
42
42
|
selector: emptyFunctionBodySelector,
|
|
43
43
|
message: 'Empty function bodies are not allowed, even with a comment.'
|
|
44
44
|
};
|
|
45
|
+
|
|
46
|
+
export const noInOperatorRestriction = {
|
|
47
|
+
selector: 'BinaryExpression[operator="in"]',
|
|
48
|
+
message: 'The `in` operator is not allowed. Use `Object.hasOwn` instead.'
|
|
49
|
+
};
|
package/sbom.cdx.json
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"component": {
|
|
17
17
|
"type": "library",
|
|
18
18
|
"name": "@enormora/eslint-config-base",
|
|
19
|
-
"version": "0.0.
|
|
20
|
-
"bom-ref": "pkg:npm/@enormora/eslint-config-base@0.0.
|
|
21
|
-
"purl": "pkg:npm/@enormora/eslint-config-base@0.0.
|
|
19
|
+
"version": "0.0.33",
|
|
20
|
+
"bom-ref": "pkg:npm/@enormora/eslint-config-base@0.0.33",
|
|
21
|
+
"purl": "pkg:npm/@enormora/eslint-config-base@0.0.33"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"components": [
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
"ref": "pkg:npm/@cspell/eslint-plugin@10.0.0"
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
|
-
"ref": "pkg:npm/@enormora/eslint-config-base@0.0.
|
|
219
|
+
"ref": "pkg:npm/@enormora/eslint-config-base@0.0.33",
|
|
220
220
|
"dependsOn": [
|
|
221
221
|
"pkg:npm/@ben_12/eslint-plugin-dprint@1.19.0",
|
|
222
222
|
"pkg:npm/@ben_12/eslint-simple-parser@0.1.0",
|