Skip to content

feat(barrels): use eslint sorting order #476

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

humbertogontijo
Copy link
Contributor

@@ -12,7 +22,7 @@ async function generateIndex(directory, {cwd, excluded, noSemicolon}) {
});

const exports = files
.sort((a, b) => a.localeCompare(b))
.sort((a, b) => compare(a, b))
.map((file) => {
// TODO set .js after all configuration are ok to resolve .js
return `export * from "./${file.replace(".ts", ".js")}"${noSemicolon ? "" : ";"}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the best option is to add a comment to like // eslint-disable or something equivalent or just add generated index.ts to eslint ignore rules.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or just add auto fix on commit using husky.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because if the project use biome.js or prettier, this sorting won't potentially be the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be right. I was just thinking that most cases (even with prettier) the eslint sorting order would be the one used

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