From d8568ebaa90b3f0b8cb0fbf1281225b6d5153c7d Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 4 Aug 2020 15:51:39 -0500 Subject: [PATCH] Enforce import order --- .eslintrc.yaml | 2 ++ src/node/settings.ts | 4 ++-- src/node/util.ts | 2 +- test/socket.test.ts | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 96931d558..bb76a91a0 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -24,6 +24,8 @@ rules: "@typescript-eslint/no-use-before-define": off "@typescript-eslint/no-non-null-assertion": off eqeqeq: error + import/order: + [error, { alphabetize: { order: "asc" }, groups: [["builtin", "external", "internal"], "parent", "sibling"] }] settings: # Does not work with CommonJS unfortunately. diff --git a/src/node/settings.ts b/src/node/settings.ts index 213cd1a26..d68e8e3bd 100644 --- a/src/node/settings.ts +++ b/src/node/settings.ts @@ -1,8 +1,8 @@ +import { logger } from "@coder/logger" import * as fs from "fs-extra" import * as path from "path" -import { paths } from "./util" -import { logger } from "@coder/logger" import { Route } from "./http" +import { paths } from "./util" export type Settings = { [key: string]: Settings | string | boolean | number } diff --git a/src/node/util.ts b/src/node/util.ts index a70d7ef61..c0f37f74b 100644 --- a/src/node/util.ts +++ b/src/node/util.ts @@ -1,10 +1,10 @@ import * as cp from "child_process" import * as crypto from "crypto" +import envPaths from "env-paths" import * as fs from "fs-extra" import * as os from "os" import * as path from "path" import * as util from "util" -import envPaths from "env-paths" import xdgBasedir from "xdg-basedir" export const tmpdir = path.join(os.tmpdir(), "code-server") diff --git a/test/socket.test.ts b/test/socket.test.ts index c1312d824..7d4de985f 100644 --- a/test/socket.test.ts +++ b/test/socket.test.ts @@ -6,8 +6,8 @@ import * as net from "net" import * as path from "path" import * as tls from "tls" import { Emitter } from "../src/common/emitter" -import { generateCertificate, tmpdir } from "../src/node/util" import { SocketProxyProvider } from "../src/node/socket" +import { generateCertificate, tmpdir } from "../src/node/util" describe("SocketProxyProvider", () => { const provider = new SocketProxyProvider()