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

[Feature]: Add import/order rule to ES Lint configuration #111

Closed
ampersarnie opened this issue Apr 8, 2024 · 1 comment
Closed

[Feature]: Add import/order rule to ES Lint configuration #111

ampersarnie opened this issue Apr 8, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ampersarnie
Copy link
Member

ampersarnie commented Apr 8, 2024

The feature

To further bolster our working standards and to set some common styling across JS, it has been agreed that it would be worth adding the import/order rule to our ES Lint configuration.

There are additional configurations that need to be considered, however I believe (and this is personal preference) that we should follow this:

"import/order": [
  "error",
  {
    "alphabetize": "asc",
    "warnOnUnassignedImports": true,
    "newlines-between": "always",
    "pathGroups": [
      {
        "pattern": "@wordpress/**",
        "group": "builtin",
        "position": "before"
      }
    ],
  }
]

With this setup it do the following:

Documentation: https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md

@ampersarnie ampersarnie added the enhancement New feature or request label Apr 8, 2024
@ampersarnie ampersarnie self-assigned this Apr 8, 2024
@ampersarnie
Copy link
Member Author

Duplicate of #110

@ampersarnie ampersarnie marked this as a duplicate of #110 Apr 8, 2024
@ampersarnie ampersarnie closed this as not planned Won't fix, can't repro, duplicate, stale Apr 8, 2024
@github-project-automation github-project-automation bot moved this from To do to Done in Build Tools Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

1 participant