In a project I get this warning for a "fall-through" situation, which I configured to be ok in my .eslintrc.json file.
React version: 17.0.2
The current behavior
I have set the handling of the fall-through case by adding this to my .eslintrc.json file:
"no-fallthrough": [
"warn",
{
"commentPattern": "[falls?-through]"
}
],
In one of my source files I have used this construct:
389| switch (data.type) {
390| case "text": {
391| if (this.resultData.type !== "resultSetRows") {
392| ...
393| break;
394| }
395| }
396| // [falls-through]
397|
398| case "resultSetRows": { ...
which does not produce a message when the code is transpiled to JS or when generating a production build.
However, when I run the code I get a warning in the console:
./src/script-execution/PresentationInterface.tsx Line 396:13: Expected a 'break' statement before 'case' no-fallthrough node_modules/react-dev-utils/webpackHotDevClient.js:138
which seems to indicate that React/Babel has not picked up my linter rule (but eslint did!).
The expected behavior
No warning should be shown when running the code, as I configured this to be ok in my eslint configuration file.
In a project I get this warning for a "fall-through" situation, which I configured to be ok in my
.eslintrc.jsonfile.React version: 17.0.2
The current behavior
I have set the handling of the fall-through case by adding this to my
.eslintrc.jsonfile:In one of my source files I have used this construct:
which does not produce a message when the code is transpiled to JS or when generating a production build.
However, when I run the code I get a warning in the console:
which seems to indicate that React/Babel has not picked up my linter rule (but eslint did!).
The expected behavior
No warning should be shown when running the code, as I configured this to be ok in my eslint configuration file.