@checkdigit/eslint-plugin 7.6.2-PR.108-2c27 → 7.6.2-PR.108-da5c
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.
|
@@ -34,7 +34,7 @@ var rule = createRule({
|
|
|
34
34
|
assert.ok(service !== void 0 && version !== void 0);
|
|
35
35
|
for (const specifier of importDeclaration.specifiers) {
|
|
36
36
|
if (specifier.type === AST_NODE_TYPES.ImportSpecifier && specifier.imported.type === AST_NODE_TYPES.Identifier) {
|
|
37
|
-
importedServiceTypeMapping.set(specifier.
|
|
37
|
+
importedServiceTypeMapping.set(specifier.local.name, `${service}.${specifier.imported.name}`);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
const rangeStart = importDeclaration.specifiers[0]?.range[0];
|
|
@@ -63,14 +63,13 @@ var rule = createRule({
|
|
|
63
63
|
},
|
|
64
64
|
TSTypeReference(typeReference) {
|
|
65
65
|
if (typeReference.typeName.type === AST_NODE_TYPES.Identifier && importedServiceTypeMapping.has(typeReference.typeName.name)) {
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
assert.ok(serviceNamespace !== void 0);
|
|
66
|
+
const renamedTypeName = importedServiceTypeMapping.get(typeReference.typeName.name);
|
|
67
|
+
assert.ok(renamedTypeName !== void 0);
|
|
69
68
|
context.report({
|
|
70
69
|
messageId: "renameServiceTypeReference",
|
|
71
70
|
node: typeReference.typeName,
|
|
72
71
|
fix(fixer) {
|
|
73
|
-
return fixer.replaceText(typeReference.typeName,
|
|
72
|
+
return fixer.replaceText(typeReference.typeName, renamedTypeName);
|
|
74
73
|
}
|
|
75
74
|
});
|
|
76
75
|
}
|
|
@@ -83,4 +82,4 @@ export {
|
|
|
83
82
|
require_fixed_services_import_default as default,
|
|
84
83
|
ruleId
|
|
85
84
|
};
|
|
86
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
85
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogM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QztBQUN2RCxZQUNFLGNBQWMsU0FBUyxTQUFTLGVBQWUsY0FDL0MsMkJBQTJCLElBQUksY0FBYyxTQUFTLElBQUksR0FDMUQ7QUFDQSxnQkFBTSxrQkFBa0IsMkJBQTJCLElBQUksY0FBYyxTQUFTLElBQUk7QUFDbEYsaUJBQU8sR0FBRyxvQkFBb0IsTUFBUztBQUN2QyxrQkFBUSxPQUFPO0FBQUEsWUFDYixXQUFXO0FBQUEsWUFDWCxNQUFNLGNBQWM7QUFBQSxZQUNwQixJQUFJLE9BQU87QUFDVCxxQkFBTyxNQUFNLFlBQVksY0FBYyxVQUFVLGVBQWU7QUFBQSxZQUNsRTtBQUFBLFVBQ0YsQ0FBQztBQUFBLFFBQ0g7QUFBQSxNQUNGO0FBQUEsSUFDRjtBQUFBLEVBQ0Y7QUFDRixDQUFDO0FBRUQsSUFBTyx3Q0FBUTsiLAogICJuYW1lcyI6IFtdCn0K
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@checkdigit/eslint-plugin","version":"7.6.2-PR.108-
|
|
1
|
+
{"name":"@checkdigit/eslint-plugin","version":"7.6.2-PR.108-da5c","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.18.0","@typescript-eslint/utils":"^8.18.0","ts-api-utils":"^2.0.0"},"devDependencies":{"@checkdigit/jest-config":"^6.0.2","@checkdigit/prettier-config":"^6.0.0","@checkdigit/typescript-config":"^9.0.0","@eslint/js":"^9.16.0","@types/eslint":"^9.6.1","@types/eslint-config-prettier":"^6.11.3","@typescript-eslint/parser":"^8.18.0","@typescript-eslint/rule-tester":"^8.18.0","eslint":"^9.16.0","eslint-config-prettier":"^9.1.0","eslint-import-resolver-typescript":"^3.7.0","eslint-plugin-eslint-plugin":"^6.3.2","eslint-plugin-import":"^2.31.0","eslint-plugin-no-only-tests":"^3.3.0","eslint-plugin-no-secrets":"^2.1.1","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.18.0"},"peerDependencies":{"eslint":">=9 <10"},"engines":{"node":">=20.17"}}
|
|
@@ -57,7 +57,7 @@ const rule: ESLintUtils.RuleModule<
|
|
|
57
57
|
specifier.type === AST_NODE_TYPES.ImportSpecifier &&
|
|
58
58
|
specifier.imported.type === AST_NODE_TYPES.Identifier
|
|
59
59
|
) {
|
|
60
|
-
importedServiceTypeMapping.set(specifier.
|
|
60
|
+
importedServiceTypeMapping.set(specifier.local.name, `${service}.${specifier.imported.name}`);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -94,14 +94,13 @@ const rule: ESLintUtils.RuleModule<
|
|
|
94
94
|
typeReference.typeName.type === AST_NODE_TYPES.Identifier &&
|
|
95
95
|
importedServiceTypeMapping.has(typeReference.typeName.name)
|
|
96
96
|
) {
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
assert.ok(serviceNamespace !== undefined);
|
|
97
|
+
const renamedTypeName = importedServiceTypeMapping.get(typeReference.typeName.name);
|
|
98
|
+
assert.ok(renamedTypeName !== undefined);
|
|
100
99
|
context.report({
|
|
101
100
|
messageId: 'renameServiceTypeReference',
|
|
102
101
|
node: typeReference.typeName,
|
|
103
102
|
fix(fixer) {
|
|
104
|
-
return fixer.replaceText(typeReference.typeName,
|
|
103
|
+
return fixer.replaceText(typeReference.typeName, renamedTypeName);
|
|
105
104
|
},
|
|
106
105
|
});
|
|
107
106
|
}
|