Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: skip parseESlint if eslint filepath is a js file #510

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

yy4382
Copy link
Contributor

@yy4382 yy4382 commented Jun 29, 2024

Description

Focusing on the same bug in #498 .

If eslintrc.filepath ends with "js", it will generate a javascript file (which is add in #494 ), however the parseESlint function still treat it as JSON file, which triggers an error.

In this PR, parseESlint returns {} if filepath ends with "js", instead of the String.replace() method used in #498 . Parsing is skipped in non-json mode.

If I understand correctly, skipping the parsing of previously generated eslint files would only have an impact on artifacts when the generated file was manually modified or the scope of automatic imports is narrowed. I'm not sure if resolve work fine, since I haven't use them.

Linked Issues

null

Additional context

Maybe it will be better to be able to "import" it, but I cannot find an elegant way to do that.

Copy link

stackblitz bot commented Jun 29, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@antfu antfu merged commit 10079b2 into unplugin:main Jul 11, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants