@prairielearn/eslint-plugin 2.2.2 → 2.2.4
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/CHANGELOG.md +12 -0
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +5 -5
- package/src/utils.ts +1 -1
package/CHANGELOG.md
CHANGED
package/dist/utils.js
CHANGED
|
@@ -13,7 +13,7 @@ function isIdentifierClient(identifierName, packageName) {
|
|
|
13
13
|
}
|
|
14
14
|
// If the identifier matches the package name directly, include it in the set.
|
|
15
15
|
const clientName = packageName.replace('@aws-sdk/client-', '');
|
|
16
|
-
const packageIdentifier = clientName.
|
|
16
|
+
const packageIdentifier = clientName.replaceAll('-', '').toLowerCase();
|
|
17
17
|
if (identifierName.toLowerCase() === packageIdentifier) {
|
|
18
18
|
return true;
|
|
19
19
|
}
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AAIA,gDAcC;AAaD,wFAgBC;AA/CD;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,cAAsB,EAAE,WAAmB;IAC5E,+DAA+D;IAC/D,IAAI,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,8EAA8E;IAC9E,MAAM,UAAU,GAAG,WAAW,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAC/D,MAAM,iBAAiB,GAAG,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AAIA,gDAcC;AAaD,wFAgBC;AA/CD;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,cAAsB,EAAE,WAAmB;IAC5E,+DAA+D;IAC/D,IAAI,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,8EAA8E;IAC9E,MAAM,UAAU,GAAG,WAAW,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAC/D,MAAM,iBAAiB,GAAG,UAAU,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACvE,IAAI,cAAc,CAAC,WAAW,EAAE,KAAK,iBAAiB,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,sCAAsC,CAAC,IAAS;IAC9D,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;IAEtC,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IACvC,IAAI,YAAY,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAChD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAc,EAAE,EAAE;YACzC,IAAI,SAAS,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;gBACzC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAC9C,IAAI,kBAAkB,CAAC,aAAa,EAAE,YAAY,CAAC,EAAE,CAAC;oBACpD,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;gBACjC,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["/**\n * Determines if the given identifier name corresponds to a client from the\n * given package.\n */\nexport function isIdentifierClient(identifierName: string, packageName: string): boolean {\n // If the identifier ends with \"Client\", include it in the set.\n if (identifierName.endsWith('Client')) {\n return true;\n }\n\n // If the identifier matches the package name directly, include it in the set.\n const clientName = packageName.replace('@aws-sdk/client-', '');\n const packageIdentifier = clientName.replaceAll('-', '').toLowerCase();\n if (identifierName.toLowerCase() === packageIdentifier) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Retrieves the names of AWS clients specified by the given import declaration.\n *\n * For instance, if the import declaration is:\n *\n * ```ts\n * import { S3, S3Client } from '@aws-sdk/client-s3';\n * ```\n *\n * then this function will return a set containing the strings \"S3\" and \"S3Client\".\n */\nexport function getAwsClientNamesFromImportDeclaration(node: any) {\n const clientNames = new Set<string>();\n\n const importSource = node.source.value;\n if (importSource.startsWith('@aws-sdk/client-')) {\n node.specifiers.forEach((specifier: any) => {\n if (specifier.type === 'ImportSpecifier') {\n const specifierName = specifier.imported.name;\n if (isIdentifierClient(specifierName, importSource)) {\n clientNames.add(specifierName);\n }\n }\n });\n }\n\n return clientNames;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prairielearn/eslint-plugin",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/PrairieLearn/PrairieLearn.git",
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"test": "vitest run --coverage"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@typescript-eslint/utils": "^8.
|
|
16
|
+
"@typescript-eslint/utils": "^8.42.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@prairielearn/tsconfig": "^0.0.0",
|
|
20
|
-
"@types/node": "^22.
|
|
21
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
20
|
+
"@types/node": "^22.18.0",
|
|
21
|
+
"@typescript-eslint/rule-tester": "^8.42.0",
|
|
22
22
|
"@vitest/coverage-v8": "^3.2.4",
|
|
23
|
-
"tsx": "^4.20.
|
|
23
|
+
"tsx": "^4.20.5",
|
|
24
24
|
"typescript": "^5.9.2",
|
|
25
25
|
"vitest": "^3.2.4"
|
|
26
26
|
}
|
package/src/utils.ts
CHANGED
|
@@ -10,7 +10,7 @@ export function isIdentifierClient(identifierName: string, packageName: string):
|
|
|
10
10
|
|
|
11
11
|
// If the identifier matches the package name directly, include it in the set.
|
|
12
12
|
const clientName = packageName.replace('@aws-sdk/client-', '');
|
|
13
|
-
const packageIdentifier = clientName.
|
|
13
|
+
const packageIdentifier = clientName.replaceAll('-', '').toLowerCase();
|
|
14
14
|
if (identifierName.toLowerCase() === packageIdentifier) {
|
|
15
15
|
return true;
|
|
16
16
|
}
|