ota-meshi / eslint-plugin-astro

ESLint plugin for Astro component
https://ota-meshi.github.io/eslint-plugin-astro/
MIT License
319 stars 25 forks source link

astro-eslint-parser fails to parse react-toastify module: parser.parse is not a function #452

Open corneliusroemer opened 1 week ago

corneliusroemer commented 1 week ago

Before You File a Bug Report Please Confirm You Have Done The Following...

What version of ESLint are you using?

8.57.0

What version of eslint-plugin-astro are you using?

1.3.1

What did you do?

  1. Clone the repository: loculus-project/loculus.
  2. Checkout the commit: 654535a.
  3. Run cd website && npm ci.
  4. Run the linting command: npm run check-format.

What did you expect to happen?

No errors

What actually happened?

Error while parsing /Users/corneliusromer/code/loculus/website/node_modules/react-toastify/dist/react-toastify.esm.mjs
Line 4, column 0: Unknown token at 15459, expected: "}", actual: ""
`parseForESLint` from parser `/Users/corneliusromer/code/loculus/website/node_modules/astro-eslint-parser/lib/index.js` is invalid and will just be ignored

Error while parsing /Users/corneliusromer/code/loculus/website/node_modules/react-toastify/dist/react-toastify.esm.mjs
Line 4, column 0: Unknown token at 15459, expected: "}", actual: ""
`parseForESLint` from parser `/Users/corneliusromer/code/loculus/website/node_modules/astro-eslint-parser/lib/index.js` is invalid and will just be ignored

/Users/corneliusromer/code/loculus/website/src/layouts/BaseLayout.astro
  3:32  warning  Parse errors in imported module 'react-toastify': parser.parse is not a function (undefined:undefined)  import/no-deprecated

Link to Minimal Reproducible Example

https://github.com/loculus-project/loculus/pull/3231/commits/654535a3417f83997594887cd4bd2ee605c8901e

Additional comments

I do'nt quite know why this error surfaced only now. It happens when I upgrade eslint-plugin-import from 2.29.1 to 2.31.0 - many components seem to come together here creating a strange end result.

Here's the dependabot PR that first surfaced this: https://github.com/loculus-project/loculus/pull/3231

Let me know if I should file an issue elsewhere, for now there is at least some strange parsing going on here?

corneliusroemer commented 5 days ago

Seems to be a fairly common issue from a quick Github search: