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: equality check eslintrc-auto-import.json #371

Merged
merged 3 commits into from May 17, 2023

Conversation

samuveth
Copy link
Contributor

@samuveth samuveth commented May 9, 2023

Description

This Pull Request aims to improve the interoperability between unplugin-auto-import and code formatting tools such as Prettier and ESLint.

Currently, the eslintrc-auto-import.json file generated by unplugin-auto-import lacks a newline at the end. This absence often leads to conflicts with Prettier and ESLint, as both of these tools conventionally expect a newline at the end of files.

To address this, the writeFile method in the plugin has been updated to append a newline to the file content before writing to eslintrc-auto-import.json. This small change should help in maintaining smoother integration with code formatting tools and eliminate the unnecessary conflicts that users are currently experiencing.

@samuveth samuveth changed the title Resolve Prettier/Eslint Conflicts by Adding Newline at End of eslintrc-auto-import.json fix: Resolve Prettier/Eslint Conflicts by Adding Newline at End of eslintrc-auto-import.json May 9, 2023
samuveth referenced this pull request May 11, 2023
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
@antfu
Copy link
Member

antfu commented May 16, 2023

Maybe we could compare with .trim() for both content?

@antfu antfu changed the title fix: Resolve Prettier/Eslint Conflicts by Adding Newline at End of eslintrc-auto-import.json fix: equality check eslintrc-auto-import.json May 17, 2023
@antfu antfu merged commit 991f181 into unplugin:main May 17, 2023
3 of 4 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.

None yet

2 participants