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 import order linting for JS files #5624

Closed
shlokamin opened this issue May 7, 2020 · 2 comments
Closed

Add import order linting for JS files #5624

shlokamin opened this issue May 7, 2020 · 2 comments
Labels
easyfix Ticket is an easy fix; good for first time contributors JS Tech Debt

Comments

@shlokamin
Copy link
Member

Overview

As per #4680 (comment) we have an unofficial import order we tend to follow in JS files. Let's have this be checked in a linter so we don't have to worry about this on our own/in PR reviews.

@mcous
Copy link
Contributor

mcous commented May 22, 2020

The only annoying thing here is that the import/order eslint plugin does not currently support import type ... as an import group. See import-js/eslint-plugin-import#645. That being said, with TypeScript now supporting the import type {...} syntax hopefully there will be some movement soon.

In the mean time, would we want to add this import ordering plugin before the plugin has type import grouping support?

@IanLondon
Copy link
Contributor

Notes:

Tried out eslint-plugin-simple-import-sort in #6028 and tried out eslint import/order in #6032. Like Mike mentioned above, neither support making type imports their own group and putting them together.

Additional note from slack convo: Mike pointed out

The eslint-plugin-import project does have an open ticket to figure out type imports, and the ticket became newly relevant once TypeScript added import type syntax in their latest (or second latest, not keeping track) release. Not knowing much about how eslint plugins etc. work in detail, maybe it would be an interesting JS guild project to see if we could put a fork+PR together?

@IanLondon IanLondon removed their assignment Jul 13, 2020
@IanLondon IanLondon added the easyfix Ticket is an easy fix; good for first time contributors label May 7, 2021
@bndo bndo closed this as completed Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easyfix Ticket is an easy fix; good for first time contributors JS Tech Debt
Projects
None yet
4 participants