@checkdigit/eslint-plugin 7.0.0 → 7.1.0-PR.86-deaf
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-mjs/index.mjs +11 -9
- package/dist-mjs/no-duplicated-imports.mjs +87 -0
- package/dist-mjs/require-fixed-services-import.mjs +46 -0
- package/dist-types/no-duplicated-imports.d.ts +4 -0
- package/dist-types/require-fixed-services-import.d.ts +4 -0
- package/package.json +1 -96
- package/src/index.ts +8 -7
- package/src/no-duplicated-imports.ts +118 -0
- package/src/require-fixed-services-import.ts +53 -0
package/dist-mjs/index.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import fs from "node:fs";
|
|
3
2
|
import invalidJsonStringify, { ruleId as invalidJsonStringifyRuleId } from "./invalid-json-stringify.mjs";
|
|
3
|
+
import noDuplicatedImports, { ruleId as noDuplicatedImportsRuleId } from "./no-duplicated-imports.mjs";
|
|
4
4
|
import noFullResponse, { ruleId as noFullResponseRuleId } from "./agent/no-full-response.mjs";
|
|
5
5
|
import noPromiseInstanceMethod, { ruleId as noPromiseInstanceMethodRuleId } from "./no-promise-instance-method.mjs";
|
|
6
|
+
import requireFixedServicesImport, {
|
|
7
|
+
ruleId as requireFixedServicesImportRuleId
|
|
8
|
+
} from "./require-fixed-services-import.mjs";
|
|
6
9
|
import requireResolveFullResponse, {
|
|
7
10
|
ruleId as requireResolveFullResponseRuleId
|
|
8
11
|
} from "./require-resolve-full-response.mjs";
|
|
@@ -32,14 +35,11 @@ var rules = {
|
|
|
32
35
|
[noPromiseInstanceMethodRuleId]: noPromiseInstanceMethod,
|
|
33
36
|
[noFullResponseRuleId]: noFullResponse,
|
|
34
37
|
[requireResolveFullResponseRuleId]: requireResolveFullResponse,
|
|
35
|
-
[requireTypeOutOfTypeOnlyImportsRuleId]: requireTypeOutOfTypeOnlyImports
|
|
38
|
+
[requireTypeOutOfTypeOnlyImportsRuleId]: requireTypeOutOfTypeOnlyImports,
|
|
39
|
+
[noDuplicatedImportsRuleId]: noDuplicatedImports,
|
|
40
|
+
[requireFixedServicesImportRuleId]: requireFixedServicesImport
|
|
36
41
|
};
|
|
37
|
-
var packageJson = JSON.parse(fs.readFileSync("package.json", "utf-8"));
|
|
38
42
|
var plugin = {
|
|
39
|
-
meta: {
|
|
40
|
-
name: packageJson.name,
|
|
41
|
-
version: packageJson.version
|
|
42
|
-
},
|
|
43
43
|
rules
|
|
44
44
|
};
|
|
45
45
|
var configs = {
|
|
@@ -61,7 +61,9 @@ var configs = {
|
|
|
61
61
|
[`@checkdigit/${noPromiseInstanceMethodRuleId}`]: "error",
|
|
62
62
|
[`@checkdigit/${noFullResponseRuleId}`]: "error",
|
|
63
63
|
[`@checkdigit/${requireResolveFullResponseRuleId}`]: "error",
|
|
64
|
-
[`@checkdigit/${requireTypeOutOfTypeOnlyImportsRuleId}`]: "error"
|
|
64
|
+
[`@checkdigit/${requireTypeOutOfTypeOnlyImportsRuleId}`]: "error",
|
|
65
|
+
[`@checkdigit/${noDuplicatedImportsRuleId}`]: "error",
|
|
66
|
+
[`@checkdigit/${requireFixedServicesImportRuleId}`]: "error"
|
|
65
67
|
}
|
|
66
68
|
},
|
|
67
69
|
recommended: {
|
|
@@ -91,4 +93,4 @@ var src_default = pluginToExport;
|
|
|
91
93
|
export {
|
|
92
94
|
src_default as default
|
|
93
95
|
};
|
|
94
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
96
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIl0sCiAgIm1hcHBpbmdzIjogIjtBQVVBLE9BQU8sd0JBQXdCLFVBQVUsa0NBQWtDO0FBQzNFLE9BQU8sdUJBQXVCLFVBQVUsaUNBQWlDO0FBQ3pFLE9BQU8sa0JBQWtCLFVBQVUsNEJBQTRCO0FBQy9ELE9BQU8sMkJBQTJCLF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EsSUFBTSxpQkFBNkM7QUFBQSxFQUNqRCxHQUFHO0FBQUEsRUFDSDtBQUNGO0FBQ0EsSUFBTyxjQUFROyIsCiAgIm5hbWVzIjogW10KfQo=
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// src/no-duplicated-imports.ts
|
|
2
|
+
import { strict as assert } from "node:assert";
|
|
3
|
+
import { ESLintUtils, TSESTree } from "@typescript-eslint/utils";
|
|
4
|
+
import getDocumentationUrl from "./get-documentation-url.mjs";
|
|
5
|
+
var ruleId = "no-duplicated-imports";
|
|
6
|
+
var createRule = ESLintUtils.RuleCreator((name) => getDocumentationUrl(name));
|
|
7
|
+
var rule = createRule({
|
|
8
|
+
name: ruleId,
|
|
9
|
+
meta: {
|
|
10
|
+
type: "suggestion",
|
|
11
|
+
docs: {
|
|
12
|
+
description: 'Merge duplicated import statements with the same "from".'
|
|
13
|
+
},
|
|
14
|
+
messages: {
|
|
15
|
+
mergeDuplicatedImports: 'Merge duplicated import statements with the same "from".'
|
|
16
|
+
},
|
|
17
|
+
fixable: "code",
|
|
18
|
+
schema: []
|
|
19
|
+
},
|
|
20
|
+
defaultOptions: [],
|
|
21
|
+
create(context) {
|
|
22
|
+
const sourceCode = context.sourceCode;
|
|
23
|
+
const importDeclarations = /* @__PURE__ */ new Map();
|
|
24
|
+
return {
|
|
25
|
+
ImportDeclaration(node) {
|
|
26
|
+
const moduleName = node.source.value;
|
|
27
|
+
let declarations = importDeclarations.get(moduleName);
|
|
28
|
+
if (declarations === void 0) {
|
|
29
|
+
declarations = [];
|
|
30
|
+
importDeclarations.set(moduleName, declarations);
|
|
31
|
+
}
|
|
32
|
+
declarations.push(node);
|
|
33
|
+
},
|
|
34
|
+
"Program:exit"() {
|
|
35
|
+
for (const [moduleName, declarations] of importDeclarations.entries()) {
|
|
36
|
+
if (declarations.length <= 1) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const firstDeclaration = declarations[0];
|
|
40
|
+
assert.ok(firstDeclaration);
|
|
41
|
+
const isAllTypeOnly = declarations.every(
|
|
42
|
+
(declaration) => declaration.importKind === "type" || declaration.specifiers.every(
|
|
43
|
+
(specifier) => specifier.type === TSESTree.AST_NODE_TYPES.ImportSpecifier && specifier.importKind === "type"
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
context.report({
|
|
47
|
+
messageId: "mergeDuplicatedImports",
|
|
48
|
+
node: firstDeclaration,
|
|
49
|
+
fix(fixer) {
|
|
50
|
+
const fixes = [];
|
|
51
|
+
const defaultSpecifier = declarations.flatMap(
|
|
52
|
+
(declaration) => declaration.specifiers.map(
|
|
53
|
+
(specifier) => specifier.type === TSESTree.AST_NODE_TYPES.ImportDefaultSpecifier ? specifier : void 0
|
|
54
|
+
)
|
|
55
|
+
).filter(Boolean);
|
|
56
|
+
const defaultSpecifierText = defaultSpecifier[0] ? sourceCode.getText(defaultSpecifier[0]) : void 0;
|
|
57
|
+
const mergedSpecifiers = declarations.flatMap((declaration) => {
|
|
58
|
+
const isCurrentDeclarationTypeOnly = declaration.importKind === "type" || declaration.specifiers.every(
|
|
59
|
+
(specifier) => specifier.type === TSESTree.AST_NODE_TYPES.ImportSpecifier && specifier.importKind === "type"
|
|
60
|
+
);
|
|
61
|
+
return declaration.specifiers.filter((specifier) => specifier.type !== TSESTree.AST_NODE_TYPES.ImportDefaultSpecifier).map(
|
|
62
|
+
(specifier) => (
|
|
63
|
+
// eslint-disable-next-line no-nested-ternary
|
|
64
|
+
isAllTypeOnly ? sourceCode.getText(specifier).replace("type ", "") : isCurrentDeclarationTypeOnly ? `type ${sourceCode.getText(specifier)}` : sourceCode.getText(specifier)
|
|
65
|
+
)
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
const mergedSpecifiersText = `${isAllTypeOnly ? "type " : ""}{ ${mergedSpecifiers.join(", ")} }`;
|
|
69
|
+
const mergedImport = `import ${[defaultSpecifierText, mergedSpecifiersText].filter(Boolean).join(", ")} from '${moduleName}';`;
|
|
70
|
+
fixes.push(fixer.replaceText(firstDeclaration, mergedImport));
|
|
71
|
+
declarations.slice(1).forEach((declaration) => {
|
|
72
|
+
fixes.push(fixer.removeRange([declaration.range[0], declaration.range[1] + 1]));
|
|
73
|
+
});
|
|
74
|
+
return fixes;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
var no_duplicated_imports_default = rule;
|
|
83
|
+
export {
|
|
84
|
+
no_duplicated_imports_default as default,
|
|
85
|
+
ruleId
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL25vLWR1cGxpY2F0ZWQtaW1wb3J0cy50cyJdLAogICJtYXBwaW5ncyI6ICI7QUFRQSxTQUFTLFVBQVUsY0FBYztBQUVqQyxTQUFTLGFBQWEsZ0JBQWdCO0FBRXRDLE9BQU8seUJBQXlCO0FBRXpCLElBQU0sU0FBUztBQUV0QixJQUFNLGFBQWEsWUFBWSxZQUFZLENBQUMsU0FBUyxvQkFBb0IsSUFBSSxDQUFDO0FBRTlFLElBQU0sT0FBeUQsV0FBVztBQUFBLEVBQ3hFLE1BQU07QUFBQSxFQUNOLE1BQU07QUFBQSxJQUNKLE1BQU07QUFBQSxJQUNOLE1BQU07QUFBQSxNQUNKLGFBQWE7QUFBQSxJQUNmO0FBQUEsSUFDQSxVQUFVO0FBQUEsTUFDUix3QkFBd0I7QUFBQSxJQUMxQjtBQUFBLElBQ0EsU0FBUztBQUFBLElBQ1QsUUFBUSxDQUFDO0FBQUEsRUFDWDtBQUFBLEVBQ0EsZ0JBQWdCLENBQUM7QUFBQSxFQUNqQixPQUFPLFNBQVM7QUFDZCxVQUFNLGFBQWEsUUFBUTtBQUMzQixVQUFNLHFCQUFxQixvQkFBSSxJQUEwQztBQUV6RSxXQUFPO0FBQUEsTUFDTCxrQkFBa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0FBQztBQUFBLFFBQ0g7QUFBQSxNQUNGO0FBQUEsSUFDRjtBQUFBLEVBQ0Y7QUFDRixDQUFDO0FBRUQsSUFBTyxnQ0FBUTsiLAogICJuYW1lcyI6IFtdCn0K
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// src/require-fixed-services-import.ts
|
|
2
|
+
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
3
|
+
import getDocumentationUrl from "./get-documentation-url.mjs";
|
|
4
|
+
var ruleId = "require-fixed-services-import";
|
|
5
|
+
var createRule = ESLintUtils.RuleCreator((name) => getDocumentationUrl(name));
|
|
6
|
+
var SERVICE_TYPINGS_IMPORT_PATH_PREFIX = /(?<path>\.\.\/)+services\/.*/u;
|
|
7
|
+
var rule = createRule({
|
|
8
|
+
name: ruleId,
|
|
9
|
+
meta: {
|
|
10
|
+
type: "suggestion",
|
|
11
|
+
docs: {
|
|
12
|
+
description: 'Require fixed "from" with service typing imports from "src/services".'
|
|
13
|
+
},
|
|
14
|
+
messages: {
|
|
15
|
+
updateServicesImportFrom: 'Update service typing imports to be from the fixed "src/services" path.'
|
|
16
|
+
},
|
|
17
|
+
fixable: "code",
|
|
18
|
+
schema: []
|
|
19
|
+
},
|
|
20
|
+
defaultOptions: [],
|
|
21
|
+
create(context) {
|
|
22
|
+
return {
|
|
23
|
+
ImportDeclaration(node) {
|
|
24
|
+
const moduleName = node.source.value;
|
|
25
|
+
if (SERVICE_TYPINGS_IMPORT_PATH_PREFIX.test(moduleName)) {
|
|
26
|
+
context.report({
|
|
27
|
+
messageId: "updateServicesImportFrom",
|
|
28
|
+
node: node.source,
|
|
29
|
+
*fix(fixer) {
|
|
30
|
+
yield fixer.replaceText(
|
|
31
|
+
node.source,
|
|
32
|
+
`'${moduleName.slice(0, moduleName.indexOf("../services") + "../services".length)}'`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
var require_fixed_services_import_default = rule;
|
|
42
|
+
export {
|
|
43
|
+
require_fixed_services_import_default as default,
|
|
44
|
+
ruleId
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL3JlcXVpcmUtZml4ZWQtc2VydmljZXMtaW1wb3J0LnRzIl0sCiAgIm1hcHBpbmdzIjogIjtBQVFBLFNBQVMsbUJBQW1CO0FBRTVCLE9BQU8seUJBQXlCO0FBRXpCLElBQU0sU0FBUztBQUV0QixJQUFNLGFBQWEsWUFBWSxZQUFZLENBQUMsU0FBUyxvQkFBb0IsSUFBSSxDQUFDO0FBQzlFLElBQU0scUNBQXFDO0FBRTNDLElBQU0sT0FBMkQsV0FBVztBQUFBLEVBQzFFLE1BQU07QUFBQSxFQUNOLE1BQU07QUFBQSxJQUNKLE1BQU07QUFBQSxJQUNOLE1BQU07QUFBQSxNQUNKLGFBQWE7QUFBQSxJQUNmO0FBQUEsSUFDQSxVQUFVO0FBQUEsTUFDUiwwQkFBMEI7QUFBQSxJQUM1QjtBQUFBLElBQ0EsU0FBUztBQUFBLElBQ1QsUUFBUSxDQUFDO0FBQUEsRUFDWDtBQUFBLEVBQ0EsZ0JBQWdCLENBQUM7QUFBQSxFQUNqQixPQUFPLFNBQVM7QUFDZCxXQUFPO0FBQUEsTUFDTCxrQkFBa0IsTUFBTTtBQUN0QixjQUFNLGFBQWEsS0FBSyxPQUFPO0FBQy9CLFlBQUksbUNBQW1DLEtBQUssVUFBVSxHQUFHO0FBQ3ZELGtCQUFRLE9BQU87QUFBQSxZQUNiLFdBQVc7QUFBQSxZQUNYLE1BQU0sS0FBSztBQUFBLFlBQ1gsQ0FBQyxJQUFJLE9BQU87QUFDVixvQkFBTSxNQUFNO0FBQUEsZ0JBQ1YsS0FBSztBQUFBLGdCQUNMLElBQUksV0FBVyxNQUFNLEdBQUcsV0FBVyxRQUFRLGFBQWEsSUFBSSxjQUFjLE1BQU0sQ0FBQztBQUFBLGNBQ25GO0FBQUEsWUFDRjtBQUFBLFVBQ0YsQ0FBQztBQUFBLFFBQ0g7QUFBQSxNQUNGO0FBQUEsSUFDRjtBQUFBLEVBQ0Y7QUFDRixDQUFDO0FBRUQsSUFBTyx3Q0FBUTsiLAogICJuYW1lcyI6IFtdCn0K
|
package/package.json
CHANGED
|
@@ -1,96 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@checkdigit/eslint-plugin",
|
|
3
|
-
"version": "7.0.0",
|
|
4
|
-
"description": "Check Digit eslint plugins",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"eslint",
|
|
7
|
-
"eslintplugin"
|
|
8
|
-
],
|
|
9
|
-
"homepage": "https://github.com/checkdigit/eslint-plugin#readme",
|
|
10
|
-
"bugs": {
|
|
11
|
-
"url": "https://github.com/checkdigit/eslint-plugin/issues"
|
|
12
|
-
},
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "https://github.com/checkdigit/eslint-plugin"
|
|
16
|
-
},
|
|
17
|
-
"license": "MIT",
|
|
18
|
-
"author": "Check Digit, LLC",
|
|
19
|
-
"sideEffects": false,
|
|
20
|
-
"type": "module",
|
|
21
|
-
"exports": {
|
|
22
|
-
".": {
|
|
23
|
-
"types": "./dist-types/index.d.ts",
|
|
24
|
-
"import": "./dist-mjs/index.mjs",
|
|
25
|
-
"default": "./dist-mjs/index.mjs"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"files": [
|
|
29
|
-
"src",
|
|
30
|
-
"dist-types",
|
|
31
|
-
"dist-mjs",
|
|
32
|
-
"!src/**/test/**",
|
|
33
|
-
"!src/**/*.test.ts",
|
|
34
|
-
"!src/**/*.spec.ts",
|
|
35
|
-
"!dist-types/**/test/**",
|
|
36
|
-
"!dist-types/**/*.test.d.ts",
|
|
37
|
-
"!dist-types/**/*.spec.d.ts",
|
|
38
|
-
"!dist-mjs/**/test/**",
|
|
39
|
-
"!dist-mjs/**/*.test.mjs",
|
|
40
|
-
"!dist-mjs/**/*.spec.mjs",
|
|
41
|
-
"SECURITY.md"
|
|
42
|
-
],
|
|
43
|
-
"scripts": {
|
|
44
|
-
"build:dist-mjs": "rimraf dist-mjs && npx builder --type=module --sourceMap --outDir=dist-mjs && node dist-mjs/index.mjs",
|
|
45
|
-
"build:dist-types": "rimraf dist-types && npx builder --type=types --outDir=dist-types",
|
|
46
|
-
"ci:compile": "tsc --noEmit",
|
|
47
|
-
"ci:coverage": "NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=true",
|
|
48
|
-
"ci:lint": "npm run lint",
|
|
49
|
-
"ci:style": "npm run prettier",
|
|
50
|
-
"ci:test": "NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=false",
|
|
51
|
-
"lint": "eslint --max-warnings 0 .",
|
|
52
|
-
"lint:fix": "eslint --max-warnings 0 --fix .",
|
|
53
|
-
"prepare": "",
|
|
54
|
-
"prepublishOnly": "npm run build:dist-types && npm run build:dist-mjs",
|
|
55
|
-
"prettier": "prettier --ignore-path .gitignore --list-different .",
|
|
56
|
-
"prettier:fix": "prettier --ignore-path .gitignore --write .",
|
|
57
|
-
"test": "npm run ci:compile && npm run ci:test && npm run ci:lint && npm run ci:style"
|
|
58
|
-
},
|
|
59
|
-
"prettier": "@checkdigit/prettier-config",
|
|
60
|
-
"jest": {
|
|
61
|
-
"preset": "@checkdigit/jest-config"
|
|
62
|
-
},
|
|
63
|
-
"dependencies": {
|
|
64
|
-
"@typescript-eslint/type-utils": "^8.10.0",
|
|
65
|
-
"@typescript-eslint/utils": "^8.10.0",
|
|
66
|
-
"ts-api-utils": "^1.3.0"
|
|
67
|
-
},
|
|
68
|
-
"devDependencies": {
|
|
69
|
-
"@checkdigit/jest-config": "^6.0.2",
|
|
70
|
-
"@checkdigit/prettier-config": "^5.5.1",
|
|
71
|
-
"@checkdigit/typescript-config": "8.0.0",
|
|
72
|
-
"@eslint/js": "^9.12.0",
|
|
73
|
-
"@types/eslint": "^9.6.1",
|
|
74
|
-
"@types/eslint-config-prettier": "^6.11.3",
|
|
75
|
-
"@typescript-eslint/parser": "^8.10.0",
|
|
76
|
-
"@typescript-eslint/rule-tester": "^8.10.0",
|
|
77
|
-
"eslint": "^9.12.0",
|
|
78
|
-
"eslint-config-prettier": "^9.1.0",
|
|
79
|
-
"eslint-import-resolver-typescript": "^3.6.3",
|
|
80
|
-
"eslint-plugin-eslint-plugin": "^6.2.0",
|
|
81
|
-
"eslint-plugin-import": "^2.31.0",
|
|
82
|
-
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
83
|
-
"eslint-plugin-no-secrets": "^1.0.2",
|
|
84
|
-
"eslint-plugin-node": "^11.1.0",
|
|
85
|
-
"eslint-plugin-sonarjs": "1.0.4",
|
|
86
|
-
"http-status-codes": "^2.3.0",
|
|
87
|
-
"rimraf": "^6.0.1",
|
|
88
|
-
"typescript-eslint": "^8.10.0"
|
|
89
|
-
},
|
|
90
|
-
"peerDependencies": {
|
|
91
|
-
"eslint": ">=9 <10"
|
|
92
|
-
},
|
|
93
|
-
"engines": {
|
|
94
|
-
"node": ">=20.17"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
1
|
+
{"name":"@checkdigit/eslint-plugin","version":"7.1.0-PR.86-deaf","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","import":"./dist-mjs/index.mjs","default":"./dist-mjs/index.mjs"}},"files":["src","dist-types","dist-mjs","!src/**/test/**","!src/**/*.test.ts","!src/**/*.spec.ts","!dist-types/**/test/**","!dist-types/**/*.test.d.ts","!dist-types/**/*.spec.d.ts","!dist-mjs/**/test/**","!dist-mjs/**/*.test.mjs","!dist-mjs/**/*.spec.mjs","SECURITY.md"],"scripts":{"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 .","lint:fix":"eslint --max-warnings 0 --fix .","prepare":"","prepublishOnly":"npm run build:dist-types && 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"},"dependencies":{"@typescript-eslint/type-utils":"^8.10.0","@typescript-eslint/utils":"^8.10.0","ts-api-utils":"^1.3.0"},"devDependencies":{"@checkdigit/jest-config":"^6.0.2","@checkdigit/prettier-config":"^5.5.1","@checkdigit/typescript-config":"8.0.0","@eslint/js":"^9.13.0","@types/eslint":"^9.6.1","@types/eslint-config-prettier":"^6.11.3","@typescript-eslint/parser":"^8.10.0","@typescript-eslint/rule-tester":"^8.10.0","eslint":"^9.13.0","eslint-config-prettier":"^9.1.0","eslint-import-resolver-typescript":"^3.6.3","eslint-plugin-eslint-plugin":"^6.2.0","eslint-plugin-import":"^2.31.0","eslint-plugin-no-only-tests":"^3.3.0","eslint-plugin-no-secrets":"^1.0.2","eslint-plugin-node":"^11.1.0","eslint-plugin-sonarjs":"1.0.4","http-status-codes":"^2.3.0","rimraf":"^6.0.1","typescript-eslint":"^8.10.0"},"peerDependencies":{"eslint":">=9 <10"},"engines":{"node":">=20.17"}}
|
package/src/index.ts
CHANGED
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
* This code is licensed under the MIT license (see LICENSE.txt for details).
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import fs from 'node:fs';
|
|
10
|
-
|
|
11
9
|
import type { TSESLint } from '@typescript-eslint/utils';
|
|
12
10
|
|
|
13
11
|
import invalidJsonStringify, { ruleId as invalidJsonStringifyRuleId } from './invalid-json-stringify';
|
|
12
|
+
import noDuplicatedImports, { ruleId as noDuplicatedImportsRuleId } from './no-duplicated-imports';
|
|
14
13
|
import noFullResponse, { ruleId as noFullResponseRuleId } from './agent/no-full-response';
|
|
15
14
|
import noPromiseInstanceMethod, { ruleId as noPromiseInstanceMethodRuleId } from './no-promise-instance-method';
|
|
15
|
+
import requireFixedServicesImport, {
|
|
16
|
+
ruleId as requireFixedServicesImportRuleId,
|
|
17
|
+
} from './require-fixed-services-import';
|
|
16
18
|
import requireResolveFullResponse, {
|
|
17
19
|
ruleId as requireResolveFullResponseRuleId,
|
|
18
20
|
} from './require-resolve-full-response';
|
|
@@ -44,14 +46,11 @@ const rules: Record<string, TSESLint.LooseRuleDefinition> = {
|
|
|
44
46
|
[noFullResponseRuleId]: noFullResponse,
|
|
45
47
|
[requireResolveFullResponseRuleId]: requireResolveFullResponse,
|
|
46
48
|
[requireTypeOutOfTypeOnlyImportsRuleId]: requireTypeOutOfTypeOnlyImports,
|
|
49
|
+
[noDuplicatedImportsRuleId]: noDuplicatedImports,
|
|
50
|
+
[requireFixedServicesImportRuleId]: requireFixedServicesImport,
|
|
47
51
|
};
|
|
48
52
|
|
|
49
|
-
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf-8')) as { name: string; version: string };
|
|
50
53
|
const plugin: TSESLint.FlatConfig.Plugin = {
|
|
51
|
-
meta: {
|
|
52
|
-
name: packageJson.name,
|
|
53
|
-
version: packageJson.version,
|
|
54
|
-
},
|
|
55
54
|
rules,
|
|
56
55
|
};
|
|
57
56
|
|
|
@@ -75,6 +74,8 @@ const configs: Record<string, TSESLint.FlatConfig.Config> = {
|
|
|
75
74
|
[`@checkdigit/${noFullResponseRuleId}`]: 'error',
|
|
76
75
|
[`@checkdigit/${requireResolveFullResponseRuleId}`]: 'error',
|
|
77
76
|
[`@checkdigit/${requireTypeOutOfTypeOnlyImportsRuleId}`]: 'error',
|
|
77
|
+
[`@checkdigit/${noDuplicatedImportsRuleId}`]: 'error',
|
|
78
|
+
[`@checkdigit/${requireFixedServicesImportRuleId}`]: 'error',
|
|
78
79
|
},
|
|
79
80
|
},
|
|
80
81
|
recommended: {
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// no-duplicated-imports.ts
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2021-2024 Check Digit, LLC
|
|
5
|
+
*
|
|
6
|
+
* This code is licensed under the MIT license (see LICENSE.txt for details).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { strict as assert } from 'node:assert';
|
|
10
|
+
|
|
11
|
+
import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';
|
|
12
|
+
|
|
13
|
+
import getDocumentationUrl from './get-documentation-url';
|
|
14
|
+
|
|
15
|
+
export const ruleId = 'no-duplicated-imports';
|
|
16
|
+
|
|
17
|
+
const createRule = ESLintUtils.RuleCreator((name) => getDocumentationUrl(name));
|
|
18
|
+
|
|
19
|
+
const rule: ESLintUtils.RuleModule<'mergeDuplicatedImports'> = createRule({
|
|
20
|
+
name: ruleId,
|
|
21
|
+
meta: {
|
|
22
|
+
type: 'suggestion',
|
|
23
|
+
docs: {
|
|
24
|
+
description: 'Merge duplicated import statements with the same "from".',
|
|
25
|
+
},
|
|
26
|
+
messages: {
|
|
27
|
+
mergeDuplicatedImports: 'Merge duplicated import statements with the same "from".',
|
|
28
|
+
},
|
|
29
|
+
fixable: 'code',
|
|
30
|
+
schema: [],
|
|
31
|
+
},
|
|
32
|
+
defaultOptions: [],
|
|
33
|
+
create(context) {
|
|
34
|
+
const sourceCode = context.sourceCode;
|
|
35
|
+
const importDeclarations = new Map<string, TSESTree.ImportDeclaration[]>();
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
ImportDeclaration(node) {
|
|
39
|
+
const moduleName = node.source.value;
|
|
40
|
+
let declarations = importDeclarations.get(moduleName);
|
|
41
|
+
if (declarations === undefined) {
|
|
42
|
+
declarations = [];
|
|
43
|
+
importDeclarations.set(moduleName, declarations);
|
|
44
|
+
}
|
|
45
|
+
declarations.push(node);
|
|
46
|
+
},
|
|
47
|
+
'Program:exit'() {
|
|
48
|
+
for (const [moduleName, declarations] of importDeclarations.entries()) {
|
|
49
|
+
if (declarations.length <= 1) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const firstDeclaration = declarations[0];
|
|
54
|
+
assert.ok(firstDeclaration);
|
|
55
|
+
|
|
56
|
+
const isAllTypeOnly = declarations.every(
|
|
57
|
+
(declaration) =>
|
|
58
|
+
declaration.importKind === 'type' ||
|
|
59
|
+
declaration.specifiers.every(
|
|
60
|
+
(specifier) =>
|
|
61
|
+
specifier.type === TSESTree.AST_NODE_TYPES.ImportSpecifier && specifier.importKind === 'type',
|
|
62
|
+
),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
context.report({
|
|
66
|
+
messageId: 'mergeDuplicatedImports',
|
|
67
|
+
node: firstDeclaration,
|
|
68
|
+
fix(fixer) {
|
|
69
|
+
const fixes = [];
|
|
70
|
+
|
|
71
|
+
const defaultSpecifier = declarations
|
|
72
|
+
.flatMap((declaration) =>
|
|
73
|
+
declaration.specifiers.map((specifier) =>
|
|
74
|
+
specifier.type === TSESTree.AST_NODE_TYPES.ImportDefaultSpecifier ? specifier : undefined,
|
|
75
|
+
),
|
|
76
|
+
)
|
|
77
|
+
.filter(Boolean);
|
|
78
|
+
const defaultSpecifierText = defaultSpecifier[0] ? sourceCode.getText(defaultSpecifier[0]) : undefined;
|
|
79
|
+
|
|
80
|
+
const mergedSpecifiers = declarations.flatMap((declaration) => {
|
|
81
|
+
const isCurrentDeclarationTypeOnly =
|
|
82
|
+
declaration.importKind === 'type' ||
|
|
83
|
+
declaration.specifiers.every(
|
|
84
|
+
(specifier) =>
|
|
85
|
+
specifier.type === TSESTree.AST_NODE_TYPES.ImportSpecifier && specifier.importKind === 'type',
|
|
86
|
+
);
|
|
87
|
+
return declaration.specifiers
|
|
88
|
+
.filter((specifier) => specifier.type !== TSESTree.AST_NODE_TYPES.ImportDefaultSpecifier)
|
|
89
|
+
.map((specifier) =>
|
|
90
|
+
// eslint-disable-next-line no-nested-ternary
|
|
91
|
+
isAllTypeOnly
|
|
92
|
+
? sourceCode.getText(specifier).replace('type ', '')
|
|
93
|
+
: isCurrentDeclarationTypeOnly
|
|
94
|
+
? `type ${sourceCode.getText(specifier)}`
|
|
95
|
+
: sourceCode.getText(specifier),
|
|
96
|
+
);
|
|
97
|
+
});
|
|
98
|
+
const mergedSpecifiersText = `${isAllTypeOnly ? 'type ' : ''}{ ${mergedSpecifiers.join(', ')} }`;
|
|
99
|
+
|
|
100
|
+
// Replace the first import with the merged import
|
|
101
|
+
const mergedImport = `import ${[defaultSpecifierText, mergedSpecifiersText].filter(Boolean).join(', ')} from '${moduleName}';`;
|
|
102
|
+
fixes.push(fixer.replaceText(firstDeclaration, mergedImport));
|
|
103
|
+
|
|
104
|
+
// Remove the remaining imports
|
|
105
|
+
declarations.slice(1).forEach((declaration) => {
|
|
106
|
+
fixes.push(fixer.removeRange([declaration.range[0], declaration.range[1] + 1]));
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
return fixes;
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export default rule;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// require-fixed-services-import.ts
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2021-2024 Check Digit, LLC
|
|
5
|
+
*
|
|
6
|
+
* This code is licensed under the MIT license (see LICENSE.txt for details).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
10
|
+
|
|
11
|
+
import getDocumentationUrl from './get-documentation-url';
|
|
12
|
+
|
|
13
|
+
export const ruleId = 'require-fixed-services-import';
|
|
14
|
+
|
|
15
|
+
const createRule = ESLintUtils.RuleCreator((name) => getDocumentationUrl(name));
|
|
16
|
+
const SERVICE_TYPINGS_IMPORT_PATH_PREFIX = /(?<path>\.\.\/)+services\/.*/u;
|
|
17
|
+
|
|
18
|
+
const rule: ESLintUtils.RuleModule<'updateServicesImportFrom'> = createRule({
|
|
19
|
+
name: ruleId,
|
|
20
|
+
meta: {
|
|
21
|
+
type: 'suggestion',
|
|
22
|
+
docs: {
|
|
23
|
+
description: 'Require fixed "from" with service typing imports from "src/services".',
|
|
24
|
+
},
|
|
25
|
+
messages: {
|
|
26
|
+
updateServicesImportFrom: 'Update service typing imports to be from the fixed "src/services" path.',
|
|
27
|
+
},
|
|
28
|
+
fixable: 'code',
|
|
29
|
+
schema: [],
|
|
30
|
+
},
|
|
31
|
+
defaultOptions: [],
|
|
32
|
+
create(context) {
|
|
33
|
+
return {
|
|
34
|
+
ImportDeclaration(node) {
|
|
35
|
+
const moduleName = node.source.value;
|
|
36
|
+
if (SERVICE_TYPINGS_IMPORT_PATH_PREFIX.test(moduleName)) {
|
|
37
|
+
context.report({
|
|
38
|
+
messageId: 'updateServicesImportFrom',
|
|
39
|
+
node: node.source,
|
|
40
|
+
*fix(fixer) {
|
|
41
|
+
yield fixer.replaceText(
|
|
42
|
+
node.source,
|
|
43
|
+
`'${moduleName.slice(0, moduleName.indexOf('../services') + '../services'.length)}'`,
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export default rule;
|