@typescript-eslint/eslint-plugin 8.45.1-alpha.5 → 8.45.1-alpha.7

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.
@@ -72,7 +72,7 @@ exports.default = (0, util_1.createRule)({
72
72
  },
73
73
  ignoredTypeNames: {
74
74
  type: 'array',
75
- description: 'Stringified regular expressions of type names to ignore.',
75
+ description: 'Stringified type names to ignore.',
76
76
  items: {
77
77
  type: 'string',
78
78
  },
@@ -99,7 +99,10 @@ const isNotImported = (symbol, currentSourceFile) => {
99
99
  return (!!currentSourceFile &&
100
100
  currentSourceFile !== valueDeclaration.getSourceFile());
101
101
  };
102
- const BASE_MESSAGE = 'Avoid referencing unbound methods which may cause unintentional scoping of `this`.';
102
+ const BASE_MESSAGE = [
103
+ `A method that is not declared with \`this: void\` may cause unintentional scoping of \`this\` when separated from its object.`,
104
+ `Consider using an arrow function or explicitly \`.bind()\`ing the method to avoid calling the method with an unintended \`this\` value. `,
105
+ ].join('\n');
103
106
  exports.default = (0, util_1.createRule)({
104
107
  name: 'unbound-method',
105
108
  meta: {
@@ -111,7 +114,7 @@ exports.default = (0, util_1.createRule)({
111
114
  },
112
115
  messages: {
113
116
  unbound: BASE_MESSAGE,
114
- unboundWithoutThisAnnotation: `${BASE_MESSAGE}\nIf your function does not access \`this\`, you can annotate it with \`this: void\`, or consider using an arrow function instead.`,
117
+ unboundWithoutThisAnnotation: `${BASE_MESSAGE}\nIf a function does not access \`this\`, it can be annotated with \`this: void\`.`,
115
118
  },
116
119
  schema: [
117
120
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/eslint-plugin",
3
- "version": "8.45.1-alpha.5",
3
+ "version": "8.45.1-alpha.7",
4
4
  "description": "TypeScript plugin for ESLint",
5
5
  "files": [
6
6
  "dist",
@@ -59,10 +59,10 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@eslint-community/regexpp": "^4.10.0",
62
- "@typescript-eslint/scope-manager": "8.45.1-alpha.5",
63
- "@typescript-eslint/type-utils": "8.45.1-alpha.5",
64
- "@typescript-eslint/utils": "8.45.1-alpha.5",
65
- "@typescript-eslint/visitor-keys": "8.45.1-alpha.5",
62
+ "@typescript-eslint/scope-manager": "8.45.1-alpha.7",
63
+ "@typescript-eslint/type-utils": "8.45.1-alpha.7",
64
+ "@typescript-eslint/utils": "8.45.1-alpha.7",
65
+ "@typescript-eslint/visitor-keys": "8.45.1-alpha.7",
66
66
  "graphemer": "^1.4.0",
67
67
  "ignore": "^7.0.0",
68
68
  "natural-compare": "^1.4.0",
@@ -71,8 +71,8 @@
71
71
  "devDependencies": {
72
72
  "@types/mdast": "^4.0.3",
73
73
  "@types/natural-compare": "*",
74
- "@typescript-eslint/rule-schema-to-typescript-types": "8.45.1-alpha.5",
75
- "@typescript-eslint/rule-tester": "8.45.1-alpha.5",
74
+ "@typescript-eslint/rule-schema-to-typescript-types": "8.45.1-alpha.7",
75
+ "@typescript-eslint/rule-tester": "8.45.1-alpha.7",
76
76
  "@vitest/coverage-v8": "^3.1.3",
77
77
  "ajv": "^6.12.6",
78
78
  "cross-fetch": "*",
@@ -92,7 +92,7 @@
92
92
  "vitest": "^3.1.3"
93
93
  },
94
94
  "peerDependencies": {
95
- "@typescript-eslint/parser": "^8.45.1-alpha.5",
95
+ "@typescript-eslint/parser": "^8.45.1-alpha.7",
96
96
  "eslint": "^8.57.0 || ^9.0.0",
97
97
  "typescript": ">=4.8.4 <6.0.0"
98
98
  },