@checkdigit/eslint-plugin 6.6.0-PR.79-65ee → 6.6.0-PR.79-7a20
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/dist-cjs/index.cjs +102170 -7
- package/dist-cjs/metafile.json +15007 -80
- package/dist-mjs/index.mjs +5 -1
- package/dist-mjs/no-enum.mjs +10 -2
- package/dist-types/index.d.ts +3 -0
- package/package.json +1 -1
- package/src/index.ts +4 -0
- package/src/no-enum.ts +12 -0
package/dist-mjs/index.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import invalidJsonStringify, { ruleId as invalidJsonStringifyRuleId } from "./in
|
|
|
3
3
|
import noPromiseInstanceMethod, { ruleId as noPromiseInstanceMethodRuleId } from "./no-promise-instance-method.mjs";
|
|
4
4
|
import filePathComment from "./file-path-comment.mjs";
|
|
5
5
|
import noCardNumbers from "./no-card-numbers.mjs";
|
|
6
|
+
import noEnum from "./no-enum.mjs";
|
|
6
7
|
import noTestImport from "./no-test-import.mjs";
|
|
7
8
|
import noUuid from "./no-uuid.mjs";
|
|
8
9
|
import noWallabyComment from "./no-wallaby-comment.mjs";
|
|
@@ -14,6 +15,7 @@ var src_default = {
|
|
|
14
15
|
rules: {
|
|
15
16
|
"file-path-comment": filePathComment,
|
|
16
17
|
"no-card-numbers": noCardNumbers,
|
|
18
|
+
"no-enum": noEnum,
|
|
17
19
|
"no-uuid": noUuid,
|
|
18
20
|
"require-strict-assert": requireStrictAssert,
|
|
19
21
|
"no-test-import": noTestImport,
|
|
@@ -28,6 +30,7 @@ var src_default = {
|
|
|
28
30
|
all: {
|
|
29
31
|
rules: {
|
|
30
32
|
"@checkdigit/no-card-numbers": "error",
|
|
33
|
+
"@checkdigit/no-enum": "error",
|
|
31
34
|
"@checkdigit/file-path-comment": "error",
|
|
32
35
|
"@checkdigit/no-uuid": "error",
|
|
33
36
|
"@checkdigit/require-strict-assert": "error",
|
|
@@ -43,6 +46,7 @@ var src_default = {
|
|
|
43
46
|
recommended: {
|
|
44
47
|
rules: {
|
|
45
48
|
"@checkdigit/no-card-numbers": "error",
|
|
49
|
+
"@checkdigit/no-enum": "error",
|
|
46
50
|
"@checkdigit/file-path-comment": "off",
|
|
47
51
|
"@checkdigit/no-uuid": "error",
|
|
48
52
|
"@checkdigit/require-strict-assert": "error",
|
|
@@ -60,4 +64,4 @@ var src_default = {
|
|
|
60
64
|
export {
|
|
61
65
|
src_default as default
|
|
62
66
|
};
|
|
63
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
67
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIl0sCiAgIm1hcHBpbmdzIjogIjtBQVFBLE9BQU8sd0JBQXdCLFVBQVUsa0NBQWtDO0FBQzNFLE9BQU8sMkJBQTJCLFVBQVUscUNBQXFDO0FBQ2pGLE9BQU8scUJBQXFCO0FBQzVCLE9BQU8sbUJBQW1CO0FBQzFCLE9BQU8sWUFBWTtBQUNuQixPQUFPLGtCQUFrQjtBQUN6QixPQUFPLFlBQVk7QUFDbkIsT0FBTyxzQkFBc0I7QUFDN0IsT0FBTywyQkFBMkI7QUFDbEMsT0FBTyxrQkFBa0I7QUFDekIsT0FBTyx5Q0FBeUM7QUFDaEQsT0FBTyx5QkFBeUI7QUFFaEMsSUFBTyxjQUFRO0FBQUEsRUFDYixPQUFPO0FBQUEsSUFDTCxxQkFBcUI7QUFBQSxJQUNyQixtQkFBbUI7QUFBQSxJQUNuQixXQUFXO0FBQUEsSUFDWCxXQUFXO0FBQUEsSUFDWCx5QkFBeUI7QUFBQSxJQUN6QixrQkFBa0I7QUFBQSxJQUNsQixzQkFBc0I7QUFBQSxJQUN0Qiw4QkFBOEI7QUFBQSxJQUM5QiwyQ0FBMkM7QUFBQSxJQUMzQywyQkFBMkI7QUFBQSxJQUMzQixDQUFDLDBCQUEwQixHQUFHO0FBQUEsSUFDOUIsQ0FBQ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
import { ESLintUtils, TSESTree } from "@typescript-eslint/utils";
|
|
3
3
|
var ruleId = "no-enum";
|
|
4
4
|
var NO_ENUM = "NO_ENUM";
|
|
5
5
|
var createRule = ESLintUtils.RuleCreator((name) => name);
|
|
@@ -23,6 +23,14 @@ var rule = createRule({
|
|
|
23
23
|
node,
|
|
24
24
|
messageId: NO_ENUM
|
|
25
25
|
});
|
|
26
|
+
},
|
|
27
|
+
Property(node) {
|
|
28
|
+
if (node.key.type === TSESTree.AST_NODE_TYPES.Identifier && node.key.name === "enum" && node.value.type === TSESTree.AST_NODE_TYPES.ArrayExpression) {
|
|
29
|
+
context.report({
|
|
30
|
+
node,
|
|
31
|
+
messageId: NO_ENUM
|
|
32
|
+
});
|
|
33
|
+
}
|
|
26
34
|
}
|
|
27
35
|
};
|
|
28
36
|
}
|
|
@@ -32,4 +40,4 @@ export {
|
|
|
32
40
|
no_enum_default as default,
|
|
33
41
|
ruleId
|
|
34
42
|
};
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
43
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL25vLWVudW0udHMiXSwKICAibWFwcGluZ3MiOiAiO0FBRUEsU0FBUyxhQUFhLGdCQUFnQjtBQVEvQixJQUFNLFNBQVM7QUFDdEIsSUFBTSxVQUFVO0FBRWhCLElBQU0sYUFBYSxZQUFZLFlBQVksQ0FBQyxTQUFTLElBQUk7QUFFekQsSUFBTSxPQUFPLFdBQVc7QUFBQSxFQUN0QixNQUFNO0FBQUEsRUFDTixNQUFNO0FBQUEsSUFDSixNQUFNO0FBQUEsSUFDTixNQUFNO0FBQUEsTUFDSixhQUFhO0FBQUEsSUFDZjtBQUFBLElBQ0EsUUFBUSxDQUFDO0FBQUEsSUFDVCxVQUFVO0FBQUEsTUFDUixDQUFDLE9BQU8sR0FBRztBQUFBLElBQ2I7QUFBQSxFQUNGO0FBQUEsRUFDQSxnQkFBZ0IsQ0FBQztBQUFBLEVBQ2pCLE9BQU8sU0FBUztBQUNkLFdBQU87QUFBQSxNQUNMLGtCQUFrQixNQUFrQztBQUNsRCxnQkFBUSxPQUFPO0FBQUEsVUFDYjtBQUFBLFVBQ0EsV0FBVztBQUFBLFFBQ2IsQ0FBQztBQUFBLE1BQ0g7QUFBQSxNQUNBLFNBQVMsTUFBeUI7QUFDaEMsWUFDRSxLQUFLLElBQUksU0FBUyxTQUFTLGVBQWUsY0FDMUMsS0FBSyxJQUFJLFNBQVMsVUFDbEIsS0FBSyxNQUFNLFNBQVMsU0FBUyxlQUFlLGlCQUM1QztBQUNBLGtCQUFRLE9BQU87QUFBQSxZQUNiO0FBQUEsWUFDQSxXQUFXO0FBQUEsVUFDYixDQUFDO0FBQUEsUUFDSDtBQUFBLE1BQ0Y7QUFBQSxJQUNGO0FBQUEsRUFDRjtBQUNGLENBQUM7QUFFRCxJQUFPLGtCQUFROyIsCiAgIm5hbWVzIjogW10KfQo=
|
package/dist-types/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ declare const _default: {
|
|
|
2
2
|
rules: {
|
|
3
3
|
'file-path-comment': import("eslint").Rule.RuleModule;
|
|
4
4
|
'no-card-numbers': import("eslint").Rule.RuleModule;
|
|
5
|
+
'no-enum': import("@typescript-eslint/utils/ts-eslint").RuleModule<"NO_ENUM", never[], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
5
6
|
'no-uuid': import("eslint").Rule.RuleModule;
|
|
6
7
|
'require-strict-assert': import("eslint").Rule.RuleModule;
|
|
7
8
|
'no-test-import': import("eslint").Rule.RuleModule;
|
|
@@ -16,6 +17,7 @@ declare const _default: {
|
|
|
16
17
|
all: {
|
|
17
18
|
rules: {
|
|
18
19
|
'@checkdigit/no-card-numbers': string;
|
|
20
|
+
'@checkdigit/no-enum': string;
|
|
19
21
|
'@checkdigit/file-path-comment': string;
|
|
20
22
|
'@checkdigit/no-uuid': string;
|
|
21
23
|
'@checkdigit/require-strict-assert': string;
|
|
@@ -31,6 +33,7 @@ declare const _default: {
|
|
|
31
33
|
recommended: {
|
|
32
34
|
rules: {
|
|
33
35
|
'@checkdigit/no-card-numbers': string;
|
|
36
|
+
'@checkdigit/no-enum': string;
|
|
34
37
|
'@checkdigit/file-path-comment': string;
|
|
35
38
|
'@checkdigit/no-uuid': string;
|
|
36
39
|
'@checkdigit/require-strict-assert': string;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@checkdigit/eslint-plugin","version":"6.6.0-PR.79-
|
|
1
|
+
{"name":"@checkdigit/eslint-plugin","version":"6.6.0-PR.79-7a20","description":"Check Digit eslint plugins","keywords":["eslint","eslintplugin"],"homepage":"https://github.com/checkdigit/eslint-plugin#readme","bugs":{"url":"https://github.com/checkdigit/eslint-plugin/issues"},"repository":{"type":"git","url":"https://github.com/checkdigit/eslint-plugin"},"license":"MIT","author":"Check Digit, LLC","sideEffects":false,"type":"module","exports":{".":{"types":"./dist-types/index.d.ts","require":"./dist-cjs/index.cjs","import":"./dist-mjs/index.mjs","default":"./dist-mjs/index.mjs"}},"files":["src","dist-types","dist-cjs","dist-mjs","!src/**/*.test.ts","!src/**/*.spec.ts","!dist-types/**/*.test.d.ts","!dist-types/**/*.spec.d.ts","!dist-cjs/**/*.test.cjs","!dist-cjs/**/*.spec.cjs","!dist-mjs/**/*.test.mjs","!dist-mjs/**/*.spec.mjs","SECURITY.md"],"scripts":{"build:dist-cjs":"rimraf dist-cjs && npx builder --type=commonjs --sourceMap --entryPoint=index.ts --outDir=dist-cjs --outFile=index.cjs --external=espree && echo \"module.exports = module.exports.default;\" >> dist-cjs/index.cjs && node dist-cjs/index.cjs","build:dist-mjs":"rimraf dist-mjs && npx builder --type=module --sourceMap --outDir=dist-mjs && node dist-mjs/index.mjs","build:dist-types":"rimraf dist-types && npx builder --type=types --outDir=dist-types","ci:compile":"tsc --noEmit","ci:coverage":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=true","ci:lint":"npm run lint","ci:style":"npm run prettier","ci:test":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=false","lint":"eslint --max-warnings 0 --ignore-path .gitignore .","lint:fix":"eslint --ignore-path .gitignore . --fix","prepublishOnly":"npm run build:dist-types && npm run build:dist-cjs && npm run build:dist-mjs","prettier":"prettier --ignore-path .gitignore --list-different .","prettier:fix":"prettier --ignore-path .gitignore --write .","test":"npm run ci:compile && npm run ci:test && npm run ci:lint && npm run ci:style"},"prettier":"@checkdigit/prettier-config","jest":{"preset":"@checkdigit/jest-config"},"devDependencies":{"@checkdigit/jest-config":"^6.0.2","@checkdigit/prettier-config":"^5.5.0","@checkdigit/typescript-config":"6.0.0","@types/eslint":"8.56.10","@typescript-eslint/eslint-plugin":"7.18.0","@typescript-eslint/parser":"7.18.0","@typescript-eslint/rule-tester":"7.18.0","@typescript-eslint/utils":"7.18.0","eslint-config-prettier":"^9.1.0","eslint-plugin-eslint-plugin":"^6.2.0","eslint-plugin-import":"^2.29.1","eslint-plugin-no-only-tests":"^3.1.0","eslint-plugin-no-secrets":"^1.0.2","eslint-plugin-node":"^11.1.0","eslint-plugin-sonarjs":"0.24.0","http-status-codes":"^2.3.0"},"peerDependencies":{"eslint":">=8 <9"},"engines":{"node":">=20.14"}}
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ import invalidJsonStringify, { ruleId as invalidJsonStringifyRuleId } from './in
|
|
|
10
10
|
import noPromiseInstanceMethod, { ruleId as noPromiseInstanceMethodRuleId } from './no-promise-instance-method';
|
|
11
11
|
import filePathComment from './file-path-comment';
|
|
12
12
|
import noCardNumbers from './no-card-numbers';
|
|
13
|
+
import noEnum from './no-enum';
|
|
13
14
|
import noTestImport from './no-test-import';
|
|
14
15
|
import noUuid from './no-uuid';
|
|
15
16
|
import noWallabyComment from './no-wallaby-comment';
|
|
@@ -22,6 +23,7 @@ export default {
|
|
|
22
23
|
rules: {
|
|
23
24
|
'file-path-comment': filePathComment,
|
|
24
25
|
'no-card-numbers': noCardNumbers,
|
|
26
|
+
'no-enum': noEnum,
|
|
25
27
|
'no-uuid': noUuid,
|
|
26
28
|
'require-strict-assert': requireStrictAssert,
|
|
27
29
|
'no-test-import': noTestImport,
|
|
@@ -36,6 +38,7 @@ export default {
|
|
|
36
38
|
all: {
|
|
37
39
|
rules: {
|
|
38
40
|
'@checkdigit/no-card-numbers': 'error',
|
|
41
|
+
'@checkdigit/no-enum': 'error',
|
|
39
42
|
'@checkdigit/file-path-comment': 'error',
|
|
40
43
|
'@checkdigit/no-uuid': 'error',
|
|
41
44
|
'@checkdigit/require-strict-assert': 'error',
|
|
@@ -51,6 +54,7 @@ export default {
|
|
|
51
54
|
recommended: {
|
|
52
55
|
rules: {
|
|
53
56
|
'@checkdigit/no-card-numbers': 'error',
|
|
57
|
+
'@checkdigit/no-enum': 'error',
|
|
54
58
|
'@checkdigit/file-path-comment': 'off',
|
|
55
59
|
'@checkdigit/no-uuid': 'error',
|
|
56
60
|
'@checkdigit/require-strict-assert': 'error',
|
package/src/no-enum.ts
CHANGED
|
@@ -34,6 +34,18 @@ const rule = createRule({
|
|
|
34
34
|
messageId: NO_ENUM,
|
|
35
35
|
});
|
|
36
36
|
},
|
|
37
|
+
Property(node: TSESTree.Property) {
|
|
38
|
+
if (
|
|
39
|
+
node.key.type === TSESTree.AST_NODE_TYPES.Identifier &&
|
|
40
|
+
node.key.name === 'enum' &&
|
|
41
|
+
node.value.type === TSESTree.AST_NODE_TYPES.ArrayExpression
|
|
42
|
+
) {
|
|
43
|
+
context.report({
|
|
44
|
+
node,
|
|
45
|
+
messageId: NO_ENUM,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
},
|
|
37
49
|
};
|
|
38
50
|
},
|
|
39
51
|
});
|