@@ -20,6 +20,9 @@ The lists below are ordered roughly by the number of users each change is expect
20
20
* [ Removed multiple formatters] ( #removed-formatters )
21
21
* [ Removed ` require-jsdoc ` and ` valid-jsdoc ` rules] ( #remove-jsdoc-rules )
22
22
* [ ` eslint:recommended ` has been updated] ( #eslint-recommended )
23
+ * [ ` no-constructor-return ` and ` no-sequences ` rule schemas are stricter] ( #stricter-rule-schemas )
24
+ * [ New checks in ` no-implicit-coercion ` by default] ( #no-implicit-coercion )
25
+ * [ Case-sensitive flags in ` no-invalid-regexp ` ] ( #no-invalid-regexp )
23
26
24
27
### Breaking changes for plugin developers
25
28
@@ -95,6 +98,57 @@ Additionally, the following rules have been removed from `eslint:recommended`:
95
98
96
99
** Related issue(s):** [ #15576 ] ( https://github.com/eslint/eslint/issues/15576 ) , [ #17446 ] ( https://github.com/eslint/eslint/issues/17446 ) , [ #17596 ] ( https://github.com/eslint/eslint/issues/17596 )
97
100
101
+ ## <a name =" stricter-rule-schemas " ></a > ` no-constructor-return ` and ` no-sequences ` rule schemas are stricter
102
+
103
+ In previous versions of ESLint, ` no-constructor-return ` and ` no-sequences ` rules were mistakenly accepting invalid options.
104
+
105
+ This has been fixed in ESLint v9.0.0:
106
+
107
+ * The ` no-constructor-return ` rule does not accept any options.
108
+ * The ` no-sequences ` rule can take one option, an object with a property ` "allowInParentheses" ` (boolean).
109
+
110
+ ``` json
111
+ {
112
+ "rules" : {
113
+ "no-constructor-return" : [" error" ],
114
+ "no-sequences" : [" error" , { "allowInParentheses" : false }]
115
+ }
116
+ }
117
+ ```
118
+
119
+ ** To address:** If ESLint reports invalid configuration for any of these rules, update your configuration.
120
+
121
+ ** Related issue(s):** [ #16879 ] ( https://github.com/eslint/eslint/issues/16879 )
122
+
123
+ ## <a name =" no-implicit-coercion " ></a > New checks in ` no-implicit-coercion ` by default
124
+
125
+ In ESLint v9.0.0, the ` no-implicit-coercion ` rule additionally reports the following cases by default:
126
+
127
+ ``` js
128
+ - (- foo);
129
+ foo - 0 ;
130
+ ```
131
+
132
+ ** To address:** If you want to retain the previous behavior of this rule, set ` "allow": ["-", "- -"] ` .
133
+
134
+ ``` json
135
+ {
136
+ "rules" : {
137
+ "no-implicit-coercion" : [2 , { "allow" : [" -" , " - -" ] } ],
138
+ }
139
+ }
140
+ ```
141
+
142
+ ** Related issue(s):** [ #17832 ] ( https://github.com/eslint/eslint/pull/17832 )
143
+
144
+ ## <a name =" no-invalid-regexp " ></a > Case-sensitive flags in ` no-invalid-regexp `
145
+
146
+ In ESLint v9.0.0, the option ` allowConstructorFlags ` is now case-sensitive.
147
+
148
+ ** To address:** Update your configuration if needed.
149
+
150
+ ** Related issue(s):** [ #16574 ] ( https://github.com/eslint/eslint/issues/16574 )
151
+
98
152
## <a name =" removed-context-methods " ></a > Removed multiple ` context ` methods
99
153
100
154
ESLint v9.0.0 removes multiple deprecated methods from the ` context ` object and moves them onto the ` SourceCode ` object:
0 commit comments