Reason:
“Extensions” in the configuration file:“ eslint:recommended Property enables this rule
This rule prevents lexical declarations (let, const, function, and class) from appearing in case or default clauses. The reason is that the lexical declaration is visible throughout the switch statement block, but it is initialized only when it runs to the case statement it defines
Similar Posts:
- [Solved] Lexical declaration cannot appear in a single-statement context
- [Solved] A label can only be part of statement and a declaratioin is not a statement
- [swscaler @ …] deprecated pixel format used, make sure you did set range correctly
- Solution to the problem of “TypeError: Assignment to constant variable”
- [Solved] TS2307: Cannot find module ‘./style.module.scss’ or its corresponding type declarations.
- How to console.log in React application using JSX ?
- C Compilation Error: implicit declaration of function xxx is invalid in C99 [-Wimplicit-function-declaration]
- [Solved] Operator overload must take either zero or one argument error
- sorry, unimplemented: non-trivial designated initializers not supported
- ReactJS React createElement error type is invalid — expected a string …