-
Notifications
You must be signed in to change notification settings - Fork 17
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
eslint: configure import sorting rules #647
Conversation
Still some complaints about build.js |
This more or less enforces existing practice, but cleans up many places where we've deviated from that. We sort into these groups: - 'react', if present, always first - external (`node_modules/`) imports - cockpitlib (`pkg/lib/`) imports - parent (`../`) imports - sibling (`./`) imports
Yeah, |
import { cleanPlugin } from './pkg/lib/esbuild-cleanup-plugin.js'; | ||
import { cockpitCompressPlugin } from './pkg/lib/esbuild-compress-plugin.js'; | ||
import { cockpitPoEsbuildPlugin } from './pkg/lib/cockpit-po-plugin.js'; | ||
import { cockpitRsyncEsbuildPlugin } from './pkg/lib/cockpit-rsync-plugin.js'; | ||
import { cleanPlugin } from './pkg/lib/esbuild-cleanup-plugin.js'; | ||
import { esbuildStylesPlugins } from './pkg/lib/esbuild-common.js'; | ||
import { cockpitCompressPlugin } from './pkg/lib/esbuild-compress-plugin.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.
This is weird -- it was sorted before, and now it unsorted it?!
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.
Oh, it sorted it by file name, not by imported names.. 🤷♂️
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.
Green → good, thanks!
This more or less enforces existing practice, but cleans up many places where we've deviated from that. We sort into these groups:
node_modules/
) importspkg/lib/
) imports../
) imports./
) imports