eslint-plugin-complete 1.0.5 → 1.0.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"no-explicit-array-loops.d.ts","sourceRoot":"","sources":["../../src/rules/no-explicit-array-loops.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIvE,MAAM,MAAM,OAAO,GAAG,EAAE,CAAC;AACzB,MAAM,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAE3C,eAAO,MAAM,oBAAoB,+HAyJ/B,CAAC"}
1
+ {"version":3,"file":"no-explicit-array-loops.d.ts","sourceRoot":"","sources":["../../src/rules/no-explicit-array-loops.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAKvE,MAAM,MAAM,OAAO,GAAG,EAAE,CAAC;AACzB,MAAM,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAE3C,eAAO,MAAM,oBAAoB,+HAyJ/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"no-mutable-return.d.ts","sourceRoot":"","sources":["../../src/rules/no-mutable-return.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMvD,KAAK,UAAU,GAAG,cAAc,GAAG,YAAY,GAAG,YAAY,CAAC;AAE/D,eAAO,MAAM,eAAe,wHA6C1B,CAAC"}
1
+ {"version":3,"file":"no-mutable-return.d.ts","sourceRoot":"","sources":["../../src/rules/no-mutable-return.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMvD,KAAK,UAAU,GAAG,cAAc,GAAG,YAAY,GAAG,YAAY,CAAC;AAE/D,eAAO,MAAM,eAAe,wHAsD1B,CAAC"}
@@ -22,24 +22,27 @@ export const noMutableReturn = createRule({
22
22
  create(context) {
23
23
  const parserServices = ESLintUtils.getParserServices(context);
24
24
  const checker = parserServices.program.getTypeChecker();
25
- return {
26
- FunctionDeclaration(node) {
27
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
28
- const type = checker.getTypeAtLocation(tsNode);
29
- const signatures = type.getCallSignatures();
30
- for (const signature of signatures) {
31
- const returnType = signature.getReturnType();
32
- for (const t of unionTypeParts(returnType)) {
33
- const messageId = getErrorMessageId(t);
34
- if (messageId !== undefined) {
35
- context.report({
36
- loc: node.loc,
37
- messageId,
38
- });
39
- }
25
+ function checkReturnType(node) {
26
+ const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
27
+ const type = checker.getTypeAtLocation(tsNode);
28
+ const signatures = type.getCallSignatures();
29
+ for (const signature of signatures) {
30
+ const returnType = signature.getReturnType();
31
+ for (const t of unionTypeParts(returnType)) {
32
+ const messageId = getErrorMessageId(t);
33
+ if (messageId !== undefined) {
34
+ context.report({
35
+ loc: node.loc,
36
+ messageId,
37
+ });
40
38
  }
41
39
  }
42
- },
40
+ }
41
+ }
42
+ return {
43
+ FunctionDeclaration: checkReturnType,
44
+ FunctionExpression: checkReturnType,
45
+ ArrowFunctionExpression: checkReturnType,
43
46
  };
44
47
  },
45
48
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-complete",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "An ESLint plugin that contains useful rules.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -44,18 +44,18 @@
44
44
  "test": "jest"
45
45
  },
46
46
  "dependencies": {
47
- "@typescript-eslint/type-utils": "^8.8.0",
48
- "@typescript-eslint/utils": "^8.8.0",
49
- "typescript-eslint": "^8.8.0"
47
+ "@typescript-eslint/type-utils": "^8.8.1",
48
+ "@typescript-eslint/utils": "^8.8.1",
49
+ "typescript-eslint": "^8.8.1"
50
50
  },
51
51
  "devDependencies": {
52
- "@babel/core": "^7.25.2",
53
- "@babel/preset-env": "^7.25.4",
54
- "@babel/preset-typescript": "^7.24.7",
52
+ "@babel/core": "^7.25.7",
53
+ "@babel/preset-env": "^7.25.7",
54
+ "@babel/preset-typescript": "^7.25.7",
55
55
  "@types/jest": "^29.5.13",
56
- "@types/node": "^22.7.4",
57
- "@typescript-eslint/rule-tester": "^8.8.0",
58
- "@typescript-eslint/types": "^8.8.0",
56
+ "@types/node": "^22.7.5",
57
+ "@typescript-eslint/rule-tester": "^8.8.1",
58
+ "@typescript-eslint/types": "^8.8.1",
59
59
  "complete-common": "^1.0.0",
60
60
  "complete-node": "^1.5.1",
61
61
  "jest": "^29.7.0",