@typescript-eslint/eslint-plugin 6.3.1-alpha.12 → 6.3.1-alpha.14

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.
@@ -97,6 +97,22 @@ If for some reason you cannot turn on `strictNullChecks`, but still want to use
97
97
 
98
98
  The main downside to using this rule is the need for type information.
99
99
 
100
+ This rule has a known edge case of triggering on conditions that were modified within function calls (as side effects).
101
+ It is due to limitations of TypeScript's type narrowing.
102
+ See [#9998](https://github.com/microsoft/TypeScript/issues/9998) for details.
103
+
104
+ We recommend upcasting the variable with a [type assertion](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-assertions).
105
+
106
+ ```ts
107
+ let condition = false as boolean;
108
+
109
+ const f = () => (condition = true);
110
+ f();
111
+
112
+ if (condition) {
113
+ }
114
+ ```
115
+
100
116
  ## Related To
101
117
 
102
118
  - ESLint: [no-constant-condition](https://eslint.org/docs/rules/no-constant-condition) - `no-unnecessary-condition` is essentially a stronger version of `no-constant-condition`, but requires type information.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/eslint-plugin",
3
- "version": "6.3.1-alpha.12+e097d8834",
3
+ "version": "6.3.1-alpha.14+d94b7cbc0",
4
4
  "description": "TypeScript plugin for ESLint",
5
5
  "files": [
6
6
  "dist",
@@ -57,10 +57,10 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@eslint-community/regexpp": "^4.5.1",
60
- "@typescript-eslint/scope-manager": "6.3.1-alpha.12+e097d8834",
61
- "@typescript-eslint/type-utils": "6.3.1-alpha.12+e097d8834",
62
- "@typescript-eslint/utils": "6.3.1-alpha.12+e097d8834",
63
- "@typescript-eslint/visitor-keys": "6.3.1-alpha.12+e097d8834",
60
+ "@typescript-eslint/scope-manager": "6.3.1-alpha.14+d94b7cbc0",
61
+ "@typescript-eslint/type-utils": "6.3.1-alpha.14+d94b7cbc0",
62
+ "@typescript-eslint/utils": "6.3.1-alpha.14+d94b7cbc0",
63
+ "@typescript-eslint/visitor-keys": "6.3.1-alpha.14+d94b7cbc0",
64
64
  "debug": "^4.3.4",
65
65
  "graphemer": "^1.4.0",
66
66
  "ignore": "^5.2.4",
@@ -74,7 +74,7 @@
74
74
  "@types/natural-compare": "*",
75
75
  "@types/prettier": "*",
76
76
  "@typescript-eslint/rule-schema-to-typescript-types": "6.3.0",
77
- "@typescript-eslint/rule-tester": "6.3.1-alpha.12+e097d8834",
77
+ "@typescript-eslint/rule-tester": "6.3.1-alpha.14+d94b7cbc0",
78
78
  "ajv": "^6.12.6",
79
79
  "chalk": "^5.3.0",
80
80
  "cross-fetch": "*",
@@ -99,5 +99,5 @@
99
99
  "type": "opencollective",
100
100
  "url": "https://opencollective.com/typescript-eslint"
101
101
  },
102
- "gitHead": "e097d8834ad995c04e4050f2f8631878403e08e3"
102
+ "gitHead": "d94b7cbc07fb1f5f8bdebad7e4fd9c48d79ddc2b"
103
103
  }