Skip to content

Bug: React webpack hot dev client reports linter error, which I configured to be ok #11406

@mike-lischke

Description

@mike-lischke

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions