mirror of
https://github.com/makeplane/plane.git
synced 2025-12-25 08:09:33 +01:00
- Enhanced ESLint configuration by adding new rules for import consistency and type imports. - Refactored multiple files to replace regular imports with type imports for better clarity and performance. - Ensured consistent use of type imports across the application to align with TypeScript best practices. Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
14 lines
448 B
TypeScript
14 lines
448 B
TypeScript
import { STATE_GROUPS } from "@plane/constants";
|
|
import type { IState } from "@plane/types";
|
|
|
|
export const sortStates = (states: IState[]) => {
|
|
if (!states || states.length === 0) return;
|
|
|
|
return states.sort((stateA, stateB) => {
|
|
if (stateA.group === stateB.group) {
|
|
return stateA.sequence - stateB.sequence;
|
|
}
|
|
return Object.keys(STATE_GROUPS).indexOf(stateA.group) - Object.keys(STATE_GROUPS).indexOf(stateB.group);
|
|
});
|
|
};
|