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

Add some sorting eslint plugins #1292

Open
slifty opened this issue Oct 30, 2024 · 0 comments
Open

Add some sorting eslint plugins #1292

slifty opened this issue Oct 30, 2024 · 0 comments

Comments

@slifty
Copy link
Member

slifty commented Oct 30, 2024

We should update eslint before taking this on but there are two plugins I wanted to propose we consider adding and enabling:

  1. https://www.npmjs.com/package/eslint-plugin-sort-destructure-keys
  2. https://www.npmjs.com/package/eslint-plugin-sort-exports

Right now when we import types the top level is sorted, but if the import is destructured the internal list is not in any particular order. For instance:

import { db } from '../../db';
import type {
	UserFunderRole,
	InternallyWritableUserFunderRole,
	JsonResultSet,
} from '../../../types';

The types could be in any order.

Furthermore when exporting the exports can be in any order, e.g.:

export {
	InternallyWritableUserFunderRole,
	WritableUserFunderRole,
	UserFunderRole,
	isWritableUserFunderRole,
};
@slifty slifty added this to Phase 5 Nov 19, 2024
@slifty slifty moved this to Later in Phase 5 Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Later
Development

No branches or pull requests

1 participant