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 'sort-imports' rule #17

Merged

Conversation

brianpattison
Copy link
Contributor

This enforces the sort order of importing node modules. They are sorted in alphabetical order, but the rule also requires that you group your imports and sort the groups properly. Here's where I settled on grouping everything. I went with the order "all", "single", "multiple", "none". Each of the imports must be in alphabetical order within their groups, and the items in each multiple import must be in order as well.

import * as fs from "fs";
import * as path from "path";
import { app } from "electron";
import KeysManager from "../../../src/main/utils/keys-manager";
import S3 from "aws-sdk/clients/s3";
import LogManager, { S3_APP_LOGS_PATH, S3_APP_NAME_PATH } from "../../../src/main/utils/log-manager";
import "./css/global.css";

"all"

import * as fs from "fs";
import * as path from "path";

"single"

import { app } from "electron";
import KeysManager from "../../../src/main/utils/keys-manager";
import S3 from "aws-sdk/clients/s3";

"multiple"

import LogManager, { S3_APP_LOGS_PATH, S3_APP_NAME_PATH } from "../../../src/main/utils/log-manager";

"none"

import "./css/global.css";

@brianpattison brianpattison merged commit 6a9d8c1 into simplymadeapps:master Feb 18, 2020
@brianpattison brianpattison deleted the FAF-18-sort-imports branch February 18, 2020 18:07
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 this pull request may close these issues.

2 participants