eslint-plugin-complete 1.0.9 → 1.0.10

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":"prefer-readonly-parameter-types.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-readonly-parameter-types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAY1E,KAAK,OAAO,GAAG;IACb;QACE,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;QAC/B,wBAAwB,CAAC,EAAE,OAAO,CAAC;QACnC,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;QACjC,wBAAwB,CAAC,EAAE,OAAO,CAAC;KACpC;CACF,CAAC;AAGF,eAAO,MAAM,4BAA4B,6MA4LvC,CAAC"}
1
+ {"version":3,"file":"prefer-readonly-parameter-types.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-readonly-parameter-types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAY1E,KAAK,OAAO,GAAG;IACb;QACE,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;QAC/B,wBAAwB,CAAC,EAAE,OAAO,CAAC;QACnC,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;QACjC,wBAAwB,CAAC,EAAE,OAAO,CAAC;KACpC;CACF,CAAC;AAGF,eAAO,MAAM,4BAA4B,6MA6MvC,CAAC"}
@@ -71,6 +71,18 @@ export const preferReadonlyParameterTypes = createRule({
71
71
  AST_NODE_TYPES.TSFunctionType,
72
72
  AST_NODE_TYPES.TSMethodSignature,
73
73
  ].join(", ")](node) {
74
+ // Early return in the special case of a map method. (This would result in an unfixable lint
75
+ // error.)
76
+ if (node.type === AST_NODE_TYPES.ArrowFunctionExpression ||
77
+ node.type === AST_NODE_TYPES.FunctionExpression) {
78
+ const { parent } = node;
79
+ if (parent.type === AST_NODE_TYPES.CallExpression &&
80
+ parent.callee.type === AST_NODE_TYPES.MemberExpression &&
81
+ parent.callee.property.type === AST_NODE_TYPES.Identifier &&
82
+ parent.callee.property.name === "map") {
83
+ return;
84
+ }
85
+ }
74
86
  for (const param of node.params) {
75
87
  if (checkParameterProperties === false &&
76
88
  param.type === AST_NODE_TYPES.TSParameterProperty) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-complete",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "An ESLint plugin that contains useful rules.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -44,9 +44,9 @@
44
44
  "test": "jest"
45
45
  },
46
46
  "dependencies": {
47
- "@typescript-eslint/type-utils": "8.24.1",
48
- "@typescript-eslint/utils": "8.24.1",
49
- "typescript-eslint": "8.24.1"
47
+ "@typescript-eslint/type-utils": "8.25.0",
48
+ "@typescript-eslint/utils": "8.25.0",
49
+ "typescript-eslint": "8.25.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@babel/core": "7.26.9",
@@ -54,10 +54,10 @@
54
54
  "@babel/preset-typescript": "7.26.0",
55
55
  "@types/jest": "29.5.14",
56
56
  "@types/node": "22.13.5",
57
- "@typescript-eslint/rule-tester": "8.24.1",
58
- "@typescript-eslint/types": "8.24.1",
59
- "complete-common": "^1.1.1",
60
- "complete-node": "^3.0.1",
57
+ "@typescript-eslint/rule-tester": "8.25.0",
58
+ "@typescript-eslint/types": "8.25.0",
59
+ "complete-common": "1.1.2",
60
+ "complete-node": "3.1.6",
61
61
  "jest": "29.7.0",
62
62
  "prettier": "3.5.2",
63
63
  "typescript": "5.7.3"