Bug: Parsing error: Unexpected token 0
See original GitHub issueEnvironment
Node version: v16.5.0
npm version: v7.19.1
Local ESLint version: v8.3.0 (Currently used)
Global ESLint version: Not found
Operating System: darwin 21.4.0
module.exports = {
env: {
browser: true,
node: true
},
plugins: ['njk'],
extends: 'eslint:recommended',
parserOptions: {
ecmaVersion: 13
},
rules: {
indent: ['error', 2],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single', { allowTemplateLiterals: true }],
semi: ['error', 'always'],
'no-unused-vars': 'off'
}
};
What parser are you using?
Default (Espree)
What did you do?
Line in question:
const { blocks = [] } = rawPageItem.fields;
Red error line appears in VSCode as per below:
What did you expect to happen?
This error to not be flagged. It happens elsewhere but not consistently. However there are other places in my code, this does not happen.
What actually happened?
Participation
- I am willing to submit a pull request for this issue.
Additional comments
First time reporting this, so please let me know if there is anything else I can do to help. Thanks.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ESLint Parsing error: Unexpected token - Stack Overflow
Unexpected token errors in ESLint parsing occur due to incompatibility between your development environment and ESLint's current parsing ...
Read more >3 Easy Steps to Fix the Parsing Error Unexpected Token issue
The Parsing error unexpected token usually occurs when there is an incompatibility between the parser option and the code.
Read more >[ESLint] Parsing error: unexpected token - DEV Community
This is a solution when I saw these errors. ... Warning: React version not specified in eslint-plugin-react settings. See https://github.com/ ...
Read more >syntax error, unexpected token “...” : Bugs : smarty3 package ...
* This is the template parser. * It is generated from the smarty_internal_templateparser.y file * * @author Uwe Tews <email address hidden> */...
Read more >How To Fix - "Parsing error: Unexpected Token" in React.js or ...
Such “Unexpected token” signify a common behavioural problem – somewhere in your code a specific construct was supplied, but the system expected something ......
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 FreeTop 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
Top GitHub Comments
@mdjermanovic I did some digging today and removed plugin, that does indeed fix it. My thanks for all the help. Very much appreciated.
This does seem to be caused by
eslint-plugin-exclude-nunjucks-tags
, as it replaces code with0
.@edhenderson can you remove
plugins: ['njk']
from your config file and try linting the same code again?