Skip to content

Commit 8d231e0

Browse files
committed
update ci node version and lint config
1 parent 930272d commit 8d231e0

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

.github/workflows/tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install Node.js
1515
uses: actions/setup-node@v3
1616
with:
17-
node-version: 16.x
17+
node-version: 20.x
1818
cache: yarn
1919
- name: Install dependencies
2020
run: yarn install --frozen-lockfile

eslint.config.mjs

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
1-
import typescriptEslint from "@typescript-eslint/eslint-plugin";
1+
import typescriptEslintPlugin from "@typescript-eslint/eslint-plugin";
22
import tsParser from "@typescript-eslint/parser";
3-
import pluginImport from "eslint-plugin-import";
3+
import importPlugin from "eslint-plugin-import";
4+
import globals from "globals";
45

56
export default [
67
{
78
files: ["**/*.ts"],
89
},
910
{
1011
plugins: {
11-
"@typescript-eslint": typescriptEslint,
12-
import: pluginImport,
12+
"@typescript-eslint": typescriptEslintPlugin,
13+
import: importPlugin,
1314
},
1415

1516
languageOptions: {
1617
parser: tsParser,
1718
ecmaVersion: 2022,
1819
sourceType: "module",
20+
globals: {
21+
...globals.node,
22+
...globals.mocha,
23+
},
24+
},
25+
26+
settings: {
27+
"import/parsers": {
28+
"@typescript-eslint/parser": [".ts"],
29+
},
30+
"import/resolver": {
31+
typescript: {
32+
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
33+
},
34+
},
1935
},
2036

2137
rules: {

0 commit comments

Comments
 (0)