Skip to content

Commit

Permalink
chore: replace eslint-import-resolver-alias with eslint-import-resolv…
Browse files Browse the repository at this point in the history
…er-typescript (coder#4546)

Co-authored-by: Joe Previte <[email protected]>
  • Loading branch information
JounQin and jsjoeio authored Dec 7, 2021
1 parent d15731a commit 6c9c840
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 20 deletions.
9 changes: 3 additions & 6 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,8 @@ rules:
import/order:
[error, { alphabetize: { order: "asc" }, groups: [["builtin", "external", "internal"], "parent", "sibling"] }]
no-async-promise-executor: off
# This isn't a real module, just types, which apparently doesn't resolve.
import/no-unresolved: [error, { ignore: ["express-serve-static-core"] }]

settings:
# Does not work with CommonJS unfortunately.
import/ignore:
- env-paths
- xdg-basedir
import/resolver:
typescript:
alwaysTryTypes: true
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"doctoc": "^2.0.0",
"eslint": "^7.7.0",
"eslint-config-prettier": "^8.1.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/node/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as expressCore from "express-serve-static-core"
import * as http from "http"
import * as net from "net"
import path from "path"
import qs from "qs"
import * as qs from "qs"
import { Disposable } from "../common/emitter"
import { CookieKeys, HttpCode, HttpError } from "../common/http"
import { normalize } from "../common/util"
Expand Down
2 changes: 1 addition & 1 deletion src/node/routes/pathProxy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Request, Response } from "express"
import * as path from "path"
import qs from "qs"
import * as qs from "qs"
import * as pluginapi from "../../../typings/pluginapi"
import { HttpCode, HttpError } from "../../common/http"
import { normalize } from "../../common/util"
Expand Down
1 change: 1 addition & 0 deletions src/node/wsRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ export function Router(): WebsocketRouter {
return new WebsocketRouter()
}

// eslint-disable-next-line import/no-named-as-default-member -- the typings are not updated correctly
export const wss = new Websocket.Server({ noServer: true })
2 changes: 1 addition & 1 deletion test/unit/node/proxy.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import bodyParser from "body-parser"
import * as bodyParser from "body-parser"
import * as express from "express"
import * as http from "http"
import nodeFetch from "node-fetch"
Expand Down
9 changes: 9 additions & 0 deletions test/unit/node/test-plugin/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
settings: {
"import/resolver": {
typescript: {
project: __dirname,
},
},
},
}
5 changes: 0 additions & 5 deletions test/unit/node/test-plugin/.eslintrc.yaml

This file was deleted.

28 changes: 23 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1530,11 +1530,6 @@ eslint-config-prettier@^8.1.0:
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a"
integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==

eslint-import-resolver-alias@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/eslint-import-resolver-alias/-/eslint-import-resolver-alias-1.1.2.tgz#297062890e31e4d6651eb5eba9534e1f6e68fc97"
integrity sha512-WdviM1Eu834zsfjHtcGHtGfcu+F30Od3V7I9Fi57uhBEwPkjDcii7/yW8jAT+gOhn4P/vOxxNAXbFAKsrrc15w==

eslint-import-resolver-node@^0.3.4:
version "0.3.4"
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz#85ffa81942c25012d8231096ddf679c03042c717"
Expand All @@ -1543,6 +1538,17 @@ eslint-import-resolver-node@^0.3.4:
debug "^2.6.9"
resolve "^1.13.1"

eslint-import-resolver-typescript@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.5.0.tgz#07661966b272d14ba97f597b51e1a588f9722f0a"
integrity sha512-qZ6e5CFr+I7K4VVhQu3M/9xGv9/YmwsEXrsm3nimw8vWaVHRDrQRp26BgCypTxBp3vUp4o5aVEJRiy0F2DFddQ==
dependencies:
debug "^4.3.1"
glob "^7.1.7"
is-glob "^4.0.1"
resolve "^1.20.0"
tsconfig-paths "^3.9.0"

eslint-module-utils@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz#b51be1e473dd0de1c5ea638e22429c2490ea8233"
Expand Down Expand Up @@ -2036,6 +2042,18 @@ glob@^7.1.3:
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@^7.1.7:
version "7.2.0"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"

global-modules@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780"
Expand Down

0 comments on commit 6c9c840

Please sign in to comment.