@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.
@@ -99,7 +99,10 @@ const isNotImported = (symbol, currentSourceFile) => {
|
|
99
99
|
return (!!currentSourceFile &&
|
100
100
|
currentSourceFile !== valueDeclaration.getSourceFile());
|
101
101
|
};
|
102
|
-
const BASE_MESSAGE =
|
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
|
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.
|
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.
|
63
|
-
"@typescript-eslint/type-utils": "8.45.1-alpha.
|
64
|
-
"@typescript-eslint/utils": "8.45.1-alpha.
|
65
|
-
"@typescript-eslint/visitor-keys": "8.45.1-alpha.
|
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.
|
75
|
-
"@typescript-eslint/rule-tester": "8.45.1-alpha.
|
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.
|
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
|
},
|