Skip to content

refactor: sort import statements in src files - #2915

Merged
web-padawan merged 2 commits into
masterfrom
preview/sort-import-statements
Nov 8, 2021
Merged

web-padawan merged 2 commits into
masterfrom
preview/sort-import-statements

Conversation

@vursen

@vursen vursen commented Oct 22, 2021 •

Copy link
Copy Markdown
Contributor

Description

The PR sorts import statements in the project with the simple-import-sort ESLint plugin.

The following configuration is used:

"rules": {
  "simple-import-sort/imports": [
    "error",
    {
      "groups": [
        [
          // Side-effects group
          "^\\u0000",
          // External group
          "^",
          // Vaadin group
          "^@vaadin",
          // Parent group
          "^\\.\\.",
          // Sibling group
          "^\\."
        ]
      ]
    }
  ]
}

Depends on #2983

Closes #2537

Type of change

  • Internal change

Checklist

  • I have read the contribution guide: https://vaadin.com/docs-beta/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

@vursen vursen changed the title feat: add eslint-plugin-simple-import-sort ESLint plugin (PREVIEW) feat: add eslint-plugin-simple-import-sort ESLint plugin (draft) Oct 25, 2021
@vursen
vursen force-pushed the preview/sort-import-statements branch 2 times, most recently from 95c61ee to 044c38f Compare October 25, 2021 07:02
@vursen
vursen force-pushed the preview/sort-import-statements branch 8 times, most recently from 61e49fc to 1d8cdd8 Compare October 27, 2021 08:26
@vursen vursen changed the title feat: add eslint-plugin-simple-import-sort ESLint plugin (draft) feat: sort import statements Oct 29, 2021
@vursen
vursen force-pushed the preview/sort-import-statements branch 2 times, most recently from 8ca577c to 0adef3b Compare November 5, 2021 11:33
@vursen vursen changed the title feat: sort import statements refactor: sort import statements Nov 5, 2021
@vursen
vursen marked this pull request as ready for review November 5, 2021 11:43
@vursen
vursen requested a review from web-padawan November 5, 2021 11:43
@vursen
vursen force-pushed the preview/sort-import-statements branch 2 times, most recently from fbed9c2 to dcccb21 Compare November 5, 2021 11:58
@vursen vursen added internal refactor Internal improvement labels Nov 5, 2021
@vursen
vursen force-pushed the preview/sort-import-statements branch 2 times, most recently from 84ca4f7 to 09cfbc3 Compare November 5, 2021 13:37
@lkraav

lkraav commented Nov 6, 2021

Copy link
Copy Markdown
Contributor

@anoblet we were recently discussing sorting imports, let's take a note here of Vaadin using simple-import-sort 👍

@web-padawan
web-padawan force-pushed the preview/sort-import-statements branch from 09cfbc3 to 975277a Compare November 8, 2021 12:16
@sonarqubecloud

sonarqubecloud Bot commented Nov 8, 2021

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@web-padawan web-padawan changed the title refactor: sort import statements refactor: sort import statements in src files Nov 8, 2021
@web-padawan
web-padawan merged commit bfc3fa0 into master Nov 8, 2021
@web-padawan
web-padawan deleted the preview/sort-import-statements branch November 8, 2021 12:50
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with platform 22.0.0.beta2 and is also targeting the upcoming stable 22.0.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an ESLint plugin to maintain import statements order

4 participants