-
Notifications
You must be signed in to change notification settings - Fork 176
Add eslint import plugin and fix import ordering #107
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
Conversation
a88c693
to
46dfd93
Compare
src/build.ts
Outdated
import {parseArgs} from "node:util"; | ||
import {findLoader, runLoader} from "./dataloader.js"; | ||
import {maybeStat, prepareOutput, visitFiles, visitMarkdownFiles} from "./files.js"; | ||
import {prepareOutput, visitFiles, visitMarkdownFiles, maybeStat} from "./files.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m curious what’s happening here, since this doesn’t seem to be alphabetical order (of imported symbols)? I don’t really care whether the imported symbols are ordered… I just sort the files being imported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was just the result of a manual merge. I don't think that there is a rule for ordering the imports, I'll check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a rule to enforce sorting of names within an import and added the changed files to the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but it appears to be inconsistent about whether type imports should be separate or combined…
This adds the eslint import plugin which does a bunch of checks on import statements, including enforcing ordering. It uses mostly just the recommended rules with a few local changes.