espree: strange parsing errors since 4.1.0
eslint depends on espree@^4.0.0
, which pulls in 4.1.0 on a fresh install. since installing this version, we’ve been getting strange Parsing error
s on perfectly normal JSX syntax, e.g. in this build https://circleci.com/gh/Financial-Times/x-dash/1197. the referenced lines aren’t anything weird. our .eslintrc.js
includes a few plugins, including eslint-plugin-react
, but is otherwise quite minimal.
when running npm install
, i did note that it output:
npm ERR! peer dep missing: acorn@^6.0.0, required by acorn-jsx@5.0.0
even though espree
includes acorn@^6.0.0
in its dependencies. seems like this might be a cause, if it’s using an incompatible version of acorn from somewhere?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 11
- Comments: 15 (8 by maintainers)
Commits related to this issue
- Explicitly add eslint dev deps, pending https://github.com/eslint/espree/issues/393#issuecomment-433348355 — committed to airbnb/rheostat by ljharb 6 years ago
- explicit eslint dependencies to work around eslint/espree#393 — committed to Financial-Times/x-dash by apaleslimghost 6 years ago
- Pin acorn, acorn-jsx, and espree to deal w/ lint parsing errors. See https://github.com/yannickcr/eslint-plugin-react/issues/2038#issuecomment-435688237 and https://github.com/eslint/espree/issues/39... — committed to sul-dlss/library-status by jkeck 6 years ago
- Pin acorn, acorn-jsx, and espree to deal w/ lint parsing errors. See https://github.com/yannickcr/eslint-plugin-react/issues/2038#issuecomment-435688237 and https://github.com/eslint/espree/issues/39... — committed to sul-dlss/library-status by jkeck 6 years ago
- [Dev Deps] update `eslint`, `eslint-plugin-jsx-a11y`, `eslint-plugin-markdown` See https://github.com/eslint/espree/issues/393#issuecomment-433348355 for extra eslint deps — committed to enzymejs/enzyme by ljharb 6 years ago
- Regenerate package-lock due to NPM bug :( The ESLint upgrade runs afoul of a bad NPM bug with dependency resolution, which is in turn triggered by some interesting linking behavior by Acorn and its p... — committed to edgi-govdata-archiving/web-monitoring-ui by Mr0grog 5 years ago
- Regenerate package-lock due to NPM bug :( The ESLint upgrade runs afoul of a bad NPM bug with dependency resolution, which is in turn triggered by some interesting linking behavior by Acorn and its p... — committed to edgi-govdata-archiving/web-monitoring-ui by Mr0grog 5 years ago
- Regenerate package-lock due to NPM bug :( The ESLint upgrade runs afoul of a bad NPM bug with dependency resolution, which is in turn triggered by some interesting linking behavior by Acorn and its p... — committed to edgi-govdata-archiving/web-monitoring-ui by Mr0grog 5 years ago
- Workaround npm bug https://twitter.com/feross/status/1161900081492234240 https://github.com/eslint/espree/issues/393 https://github.com/eslint/eslint/issues/11018 https://npm.community/t/failed-to-in... — committed to feross/play.cash by feross 5 years ago
- [Tests] work around npm bug https://github.com/feross/play.cash/commit/a50d97fbde30b2ecad80f79d801701bde058c94c https://twitter.com/feross/status/1161900081492234240 eslint/espree#393 eslint/eslint#1... — committed to react-dates/react-dates by ljharb 5 years ago
- Depend on acorn to work around broken deduping See <https://github.com/eslint/espree/issues/393>. — committed to jasmine/jasmine by sgravrock 5 years ago
- Fix: misuse token types (fixes #393, refs eslint/eslint#11018) — committed to eslint/espree by mysticatea 5 years ago
- Fix: misuse token types (fixes #393, refs eslint/eslint#11018) (#426) — committed to eslint/espree by mysticatea 5 years ago
Any news on this?
No.
Well when I tried in an empty directory and did what you just did, I no longer saw the error. So I suspect that the issue here is something to do with the specific structure of
node_modules
I have, which (abbreviated) is:Like .@quarterto I also see
npm WARN acorn-jsx@5.0.0 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself
in mynpm install
output. So I think this may not a problem withespree
specifically. Apologies.Edit:
acorn-jsx@5.7.3
is used bywebpack@4
among other things, which explains its presence here.As a workaround I’ve found that explicitly adding
to my
package.json
’sdevDependencies
forces all three packages to be installed at the top level ofnode_modules
, where they can find one another.