@checkdigit/eslint-plugin 7.17.0 → 7.17.1-PR.140-beb2
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.
|
@@ -3,8 +3,8 @@ import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
|
|
|
3
3
|
import getDocumentationUrl from "../get-documentation-url.mjs";
|
|
4
4
|
var ruleId = "require-aws-bare-bones";
|
|
5
5
|
var MESSAGE_ID_AGGREGATED_CLIENT = "noAggregatedClient";
|
|
6
|
-
var BARE_BONES_SUFFIXES =
|
|
7
|
-
var AWS_LIB_AGGREGATED_SUFFIXES =
|
|
6
|
+
var BARE_BONES_SUFFIXES = ["Client", "Command", "Exception", "Input", "Output"];
|
|
7
|
+
var AWS_LIB_AGGREGATED_SUFFIXES = ["Document", "Paginator", "Utils", "Service", "Collection", "Manager"];
|
|
8
8
|
var AWS_SDK_CLIENT = "@aws-sdk/client-";
|
|
9
9
|
var AWS_SDK_LIB = "@aws-sdk/lib-";
|
|
10
10
|
var createRule = ESLintUtils.RuleCreator(getDocumentationUrl);
|
|
@@ -45,12 +45,11 @@ var rule = createRule({
|
|
|
45
45
|
create(context) {
|
|
46
46
|
return {
|
|
47
47
|
ImportDeclaration(node) {
|
|
48
|
-
if (!isAwsSdkClientModule(node)) {
|
|
48
|
+
if (node.importKind === "type" || !isAwsSdkClientModule(node)) {
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
for (const specifier of node.specifiers) {
|
|
52
|
-
|
|
53
|
-
if (specifier.type === AST_NODE_TYPES.ImportSpecifier && !isTypeImport && isAggregatedClient(specifier.local.name, node.source.value)) {
|
|
52
|
+
if (specifier.type === AST_NODE_TYPES.ImportSpecifier && isAggregatedClient(specifier.local.name, node.source.value)) {
|
|
54
53
|
context.report({
|
|
55
54
|
node: specifier,
|
|
56
55
|
messageId: MESSAGE_ID_AGGREGATED_CLIENT,
|
|
@@ -68,4 +67,4 @@ export {
|
|
|
68
67
|
require_aws_bare_bones_default as default,
|
|
69
68
|
ruleId
|
|
70
69
|
};
|
|
71
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
70
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vc3JjL2F3cy9yZXF1aXJlLWF3cy1iYXJlLWJvbmVzLnRzIl0sCiAgIm1hcHBpbmdzIjogIjtBQUVBLFNBQVMsZ0JBQWdCLG1CQUE2QjtBQUN0RCxPQUFPLHlCQUF5QjtBQUV6QixJQUFNLFNBQVM7QUFDZixJQUFNLCtCQUErQjtBQUU1QyxJQUFNLHNCQUFzQixDQUFDLFVBQVUsV0FBVyxhQUFhLFNBQVMsUUFBUTtBQUNoRixJQUFNLDhCQUE4QixDQUFDLFlBQVksYUFBYSxTQUFTLFdBQVcsY0FBYyxTQUFTO0FBQ3pHLElBQU0saUJBQWlCO0FBQ3ZCLElBQU0sY0FBYztBQUVwQixJQUFNLGFBQWEsWUFBWSxZQUFZLG1CQUFtQjtBQUU5RCxJQUFNLHVCQUF1QixDQUFDLEVBQUUsT0FBTyxNQUNyQyxPQUFPLE9BQU8sVUFBVSxhQUFhLE9BQU8sTUFBTSxXQUFXLGNBQWMsS0FBSyxPQUFPLE1BQU0sV0FBVyxXQUFXO0FBRXJILElBQU0sZ0JBQWdCLENBQUMsUUFDckIsSUFDRyxNQUFNLEdBQUcsRUFDVCxJQUFJLENBQUMsU0FBUyxLQUFLLE9BQU8sQ0FBQyxFQUFFLFlBQVksSUFBSSxLQUFLLE1BQU0sQ0FBQyxDQUFDLEVBQzFELEtBQUssRUFBRTtBQUVaLElBQU0sb0JBQW9CLENBQUMsTUFBYyxhQUFnQztBQUN2RSxhQUFXLFVBQVUsVUFBVTtBQUM3QixRQUFJLEtBQUssU0FBUyxNQUFNLEdBQUc7QUFDekIsYUFBTztBQUFBLElBQ1Q7QUFBQSxFQUNGO0FBQ0EsU0FBTztBQUNUO0FBRUEs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XQUFXO0FBQUEsY0FDWCxNQUFNLEVBQUUsWUFBWSxVQUFVLE1BQU0sS0FBSztBQUFBLFlBQzNDLENBQUM7QUFBQSxVQUNIO0FBQUEsUUFDRjtBQUFBLE1BQ0Y7QUFBQSxJQUNGO0FBQUEsRUFDRjtBQUNGLENBQUM7QUFFRCxJQUFPLGlDQUFROyIsCiAgIm5hbWVzIjogW10KfQo=
|
package/package.json
CHANGED
|
@@ -1,96 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@checkdigit/eslint-plugin",
|
|
3
|
-
"version": "7.17.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.46.0",
|
|
65
|
-
"@typescript-eslint/utils": "^8.46.0",
|
|
66
|
-
"http-status-codes": "^2.3.0",
|
|
67
|
-
"ts-api-utils": "^2.1.0"
|
|
68
|
-
},
|
|
69
|
-
"devDependencies": {
|
|
70
|
-
"@checkdigit/jest-config": "^6.0.2",
|
|
71
|
-
"@checkdigit/prettier-config": "^6.1.0",
|
|
72
|
-
"@checkdigit/typescript-config": "^9.3.2",
|
|
73
|
-
"@eslint/js": "^9.37.0",
|
|
74
|
-
"@types/eslint": "^9.6.1",
|
|
75
|
-
"@types/eslint-config-prettier": "^6.11.3",
|
|
76
|
-
"@typescript-eslint/parser": "^8.46.0",
|
|
77
|
-
"@typescript-eslint/rule-tester": "^8.46.0",
|
|
78
|
-
"eslint": "^9.37.0",
|
|
79
|
-
"eslint-config-prettier": "^10.1.8",
|
|
80
|
-
"eslint-import-resolver-typescript": "^4.4.4",
|
|
81
|
-
"eslint-plugin-eslint-plugin": "^6.4.0",
|
|
82
|
-
"eslint-plugin-import": "^2.32.0",
|
|
83
|
-
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
84
|
-
"eslint-plugin-no-secrets": "^2.2.1",
|
|
85
|
-
"eslint-plugin-node": "^11.1.0",
|
|
86
|
-
"eslint-plugin-sonarjs": "1.0.4",
|
|
87
|
-
"rimraf": "^6.0.1",
|
|
88
|
-
"typescript-eslint": "^8.46.0"
|
|
89
|
-
},
|
|
90
|
-
"peerDependencies": {
|
|
91
|
-
"eslint": ">=9 <10"
|
|
92
|
-
},
|
|
93
|
-
"engines": {
|
|
94
|
-
"node": ">=22.18"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
1
|
+
{"name":"@checkdigit/eslint-plugin","version":"7.17.1-PR.140-beb2","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.46.0","@typescript-eslint/utils":"^8.46.0","http-status-codes":"^2.3.0","ts-api-utils":"^2.1.0"},"devDependencies":{"@checkdigit/jest-config":"^6.0.2","@checkdigit/prettier-config":"^6.1.0","@checkdigit/typescript-config":"^9.3.2","@eslint/js":"^9.37.0","@types/eslint":"^9.6.1","@types/eslint-config-prettier":"^6.11.3","@typescript-eslint/parser":"^8.46.0","@typescript-eslint/rule-tester":"^8.46.0","eslint":"^9.37.0","eslint-config-prettier":"^10.1.8","eslint-import-resolver-typescript":"^4.4.4","eslint-plugin-eslint-plugin":"^6.4.0","eslint-plugin-import":"^2.32.0","eslint-plugin-no-only-tests":"^3.3.0","eslint-plugin-no-secrets":"^2.2.1","eslint-plugin-node":"^11.1.0","eslint-plugin-sonarjs":"1.0.4","rimraf":"^6.0.1","typescript-eslint":"^8.46.0"},"peerDependencies":{"eslint":">=9 <10"},"engines":{"node":">=22.18"}}
|
|
@@ -6,8 +6,8 @@ import getDocumentationUrl from '../get-documentation-url.ts';
|
|
|
6
6
|
export const ruleId = 'require-aws-bare-bones';
|
|
7
7
|
export const MESSAGE_ID_AGGREGATED_CLIENT = 'noAggregatedClient';
|
|
8
8
|
|
|
9
|
-
const BARE_BONES_SUFFIXES =
|
|
10
|
-
const AWS_LIB_AGGREGATED_SUFFIXES =
|
|
9
|
+
const BARE_BONES_SUFFIXES = ['Client', 'Command', 'Exception', 'Input', 'Output'];
|
|
10
|
+
const AWS_LIB_AGGREGATED_SUFFIXES = ['Document', 'Paginator', 'Utils', 'Service', 'Collection', 'Manager'];
|
|
11
11
|
const AWS_SDK_CLIENT = '@aws-sdk/client-';
|
|
12
12
|
const AWS_SDK_LIB = '@aws-sdk/lib-';
|
|
13
13
|
|
|
@@ -22,7 +22,7 @@ const kebabToPascal = (str: string): string =>
|
|
|
22
22
|
.map((item) => item.charAt(0).toUpperCase() + item.slice(1))
|
|
23
23
|
.join('');
|
|
24
24
|
|
|
25
|
-
const endsWithAnySuffix = (name: string, suffixes:
|
|
25
|
+
const endsWithAnySuffix = (name: string, suffixes: string[]): boolean => {
|
|
26
26
|
for (const suffix of suffixes) {
|
|
27
27
|
if (name.endsWith(suffix)) {
|
|
28
28
|
return true;
|
|
@@ -64,16 +64,13 @@ const rule: ESLintUtils.RuleModule<typeof MESSAGE_ID_AGGREGATED_CLIENT> = create
|
|
|
64
64
|
create(context) {
|
|
65
65
|
return {
|
|
66
66
|
ImportDeclaration(node) {
|
|
67
|
-
if (!isAwsSdkClientModule(node)) {
|
|
67
|
+
if (node.importKind === 'type' || !isAwsSdkClientModule(node)) {
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
for (const specifier of node.specifiers) {
|
|
72
|
-
const isTypeImport = specifier.type === AST_NODE_TYPES.ImportSpecifier && specifier.importKind === 'type';
|
|
73
|
-
|
|
74
72
|
if (
|
|
75
73
|
specifier.type === AST_NODE_TYPES.ImportSpecifier &&
|
|
76
|
-
!isTypeImport &&
|
|
77
74
|
isAggregatedClient(specifier.local.name, node.source.value)
|
|
78
75
|
) {
|
|
79
76
|
context.report({
|