get Parsing error: The keyword 'import' is reserved
See original GitHub issuemodule.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:react/jsx-runtime',
'plugin:prettier/recommended',
],
settings: {
'import/resolver': {
typescript: {
project: 'tsconfig.json',
},
},
react: {
createClass: 'createReactClass', // Regex for Component Factory to use,
// default to "createReactClass"
pragma: 'React', // Pragma to use, default to "React"
fragment: 'Fragment', // Fragment to use (may be a property of <pragma>), default to "Fragment"
version: 'detect', // React version. "detect" automatically picks the version you have installed.
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
// default to latest and warns if missing
// It will default to "detect" in the future
flowVersion: '0.53', // Flow version
},
},
env: {
browser: true,
node: true,
jest: true,
},
overrides: [
{
files: ['*.ts', '*.tsx'],
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
ecmaVersion: 2020,
},
},
],
}
this is my eslint.config.js, I had add .vscode in my project. when use eslint V7 this is right.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Parsing Error The Keyword import is Reserved (SublimeLinter ...
The eslint option that solves the "The keyword import is reserved" error is parserOptions.sourceType . Setting ...
Read more >Parsing error: The keyword 'import' is reserved #67 - GitHub
For some reason eslint is saying import is wrong. It might be related to this issue jsx-eslint/eslint-plugin-react#447 (comment)
Read more >JavaScript : Parsing Error The Keyword import is Reserved ...
JavaScript : Parsing Error The Keyword import is Reserved (SublimeLinter-contrib-eslint) [ Gift : Animated Search Engine ...
Read more >[Solved]-Parsing error: The keyword 'import' is reserved-Reactjs
Coding example for the question Parsing error: The keyword 'import' is reserved-Reactjs.
Read more >“ESLint: Parsing error: The keyword 'import' is reserved” Code ...
Answers related to “ESLint: Parsing error: The keyword 'import' is reserved”. javascript reserved words · Unexpected reserved word 'await'. python reserved ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Works with the
eslint.useESLintClass
settingit works for me,thank you very mach.