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

Eslint import sort plugin selection #1194

Closed
rvilarl opened this issue Oct 24, 2021 · 3 comments · Fixed by #1195
Closed

Eslint import sort plugin selection #1194

rvilarl opened this issue Oct 24, 2021 · 3 comments · Fixed by #1195

Comments

@rvilarl
Copy link
Collaborator

rvilarl commented Oct 24, 2021

Once #1192 is merged and the circular dependencies are resolved, it is possible to configure in eslint rules for the order of imports.

There are three options.

The rule sort-imports which does not support autofix:
https://eslint.org/docs/rules/sort-imports

Two plugins with autofix support:
https://github.com/lydell/eslint-plugin-simple-import-sort
https://github.com/marudor/eslint-plugin-sort-imports-es6-autofix

@rvilarl
Copy link
Collaborator Author

rvilarl commented Oct 24, 2021

Some figures:
https://github.com/lydell/eslint-plugin-simple-import-sort

  • 1 contributor
  • 742 stars
  • 523,015 npm weekly downloads

https://github.com/marudor/eslint-plugin-sort-imports-es6-autofix

  • 7 contributors
  • 74 stars
  • 94,962 npm weekly downloads

@rvilarl
Copy link
Collaborator Author

rvilarl commented Oct 24, 2021

Results for articulations.ts
https://github.com/0xfe/vexflow/blob/master/src/articulation.ts

import { RuntimeError, log, defined } from './util';
import { Flow } from './flow';
import { Modifier } from './modifier';
import { Glyph } from './glyph';
import { Stem } from './stem';
import { Note } from './note';
import { StaveNote } from './stavenote';
import { ModifierContextState } from './modifiercontext';
import { Builder } from './easyscore';
import { isGraceNote, isStaveNote, isTabNote } from './typeguard';

https://github.com/lydell/eslint-plugin-simple-import-sort

import { Builder } from './easyscore';
import { Glyph } from './glyph';
import { Modifier } from './modifier';
import { ModifierContextState } from './modifiercontext';
import { Note } from './note';
import { StaveNote } from './stavenote';
import { Stem } from './stem';
import { Tables } from './tables';
import { isGraceNote, isStaveNote, isTabNote } from './typeguard';
import { defined, log, RuntimeError } from './util';

https://github.com/marudor/eslint-plugin-sort-imports-es6-autofix

import { Builder } from './easyscore';
import { Glyph } from './glyph';
import { Modifier } from './modifier';
import { ModifierContextState } from './modifiercontext';
import { Note } from './note';
import { RuntimeError, defined, log } from './util';
import { StaveNote } from './stavenote';
import { Stem } from './stem';
import { Tables } from './tables';
import { isGraceNote, isStaveNote, isTabNote } from './typeguard';

@rvilarl
Copy link
Collaborator Author

rvilarl commented Oct 24, 2021

Looking at the statistics and results, I agree with @ronyeh, we should go for eslint-plugin-simple-import-sort.

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 a pull request may close this issue.

1 participant