Bug: Parsing error: The keyword 'const' is reserved #16174
Answered
by
aladdin-add
bovealexandre
asked this question in
General
-
EnvironmentNode version: 16.5.0 What parser are you using?Other What did you do?Configuration
const eslint = new ESLint({ fix: true, fixTypes: ['directive', 'problem', 'suggestion', 'layout'] });
const results = await eslint.lintText(page); What did you expect to happen?it's supposed to lint a string that looks like this :
What actually happened?I received this error:
Participation
Additional commentsNo response |
Beta Was this translation helpful? Give feedback.
Answered by
aladdin-add
Aug 1, 2022
Replies: 1 comment
-
the default ecmaVersion is 5, you'll need to config it >=6, to use the features like https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-parser-options |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
nzakas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the default ecmaVersion is 5, you'll need to config it >=6, to use the features like
let/const
.https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-parser-options