WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 9ce1c43

Browse files
committed
chore(deps): maintain dependencies and migrate to eslint 9
1 parent 8781bbe commit 9ce1c43

File tree

7 files changed

+98
-23
lines changed

7 files changed

+98
-23
lines changed

.github/workflows/ci.yml

Lines changed: 91 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
name: ci
22

3-
on:
4-
push:
5-
branches:
6-
- master
7-
pull_request:
8-
branches:
9-
- master
3+
on: push
104

115
jobs:
12-
ci:
6+
prepare:
7+
name: Prepare (${{ matrix.os}}, Node ${{ matrix.node }})
138
runs-on: ${{ matrix.os }}
14-
159
strategy:
1610
matrix:
1711
os: [ubuntu-latest]
18-
node: [18]
12+
node: [18, 20, 22]
1913

2014
steps:
2115
- name: Set up Node
@@ -27,7 +21,8 @@ jobs:
2721
uses: actions/checkout@master
2822

2923
- name: Cache node_modules
30-
uses: actions/cache@v2
24+
id: cache
25+
uses: actions/cache@v4
3126
with:
3227
path: node_modules
3328
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
@@ -36,24 +31,104 @@ jobs:
3631
if: steps.cache.outputs.cache-hit != 'true'
3732
run: npm ci
3833

34+
suite:
35+
needs: prepare
36+
name: Suite (${{ matrix.os}}, Node ${{ matrix.node }})
37+
runs-on: ${{ matrix.os }}
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
os: [ubuntu-latest]
42+
node: [18, 20, 22]
43+
44+
steps:
45+
- name: Set up Node
46+
uses: actions/setup-node@v3
47+
with:
48+
node-version: ${{ matrix.node }}
49+
50+
- name: Checkout
51+
uses: actions/checkout@master
52+
53+
- name: Retrieve node_modules
54+
uses: actions/cache@v4
55+
with:
56+
path: node_modules
57+
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
58+
3959
- name: Lint
4060
run: npm run lint
4161

42-
- name: Types
43-
run: npm run types
44-
4562
- name: Unit
4663
run: npm run unit
4764

4865
- name: Build
4966
run: npm run build
5067

5168
- name: Coverage
52-
if: matrix.os == 'ubuntu-latest' && matrix.node == 18
69+
if: matrix.os == 'ubuntu-latest' && matrix.node == 22
5370
uses: codecov/codecov-action@v3
5471

72+
types:
73+
needs: prepare
74+
name: Types (${{ matrix.os}}, Node ${{ matrix.node }}, TS ${{ matrix.typescript }})
75+
runs-on: ${{ matrix.os }}
76+
strategy:
77+
fail-fast: false
78+
matrix:
79+
os: [ubuntu-latest]
80+
node: [22]
81+
# Add relevant versions from: https://majors.nullvoxpopuli.com/q?minors=on&packages=typescript
82+
typescript: ["5.7"]
83+
84+
steps:
85+
- name: Set up Node
86+
uses: actions/setup-node@v3
87+
with:
88+
node-version: ${{ matrix.node }}
89+
90+
- name: Checkout
91+
uses: actions/checkout@master
92+
93+
- name: Retrieve node_modules
94+
uses: actions/cache@v4
95+
with:
96+
path: node_modules
97+
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
98+
99+
- name: Overwrite TypeScript
100+
run: npm install --no-save typescript@${{ matrix.typescript }} && npx tsc --version
101+
102+
- name: Types
103+
run: npm run types
104+
105+
size:
106+
needs: prepare
107+
if: github.event_name == 'pull_request'
108+
name: Size (${{ matrix.os}}, Node ${{ matrix.node }})
109+
runs-on: ${{ matrix.os }}
110+
strategy:
111+
fail-fast: false
112+
matrix:
113+
os: [ubuntu-latest]
114+
node: [22]
115+
116+
steps:
117+
- name: Set up Node
118+
uses: actions/setup-node@v3
119+
with:
120+
node-version: ${{ matrix.node }}
121+
122+
- name: Checkout
123+
uses: actions/checkout@master
124+
125+
- name: Retrieve node_modules
126+
uses: actions/cache@v4
127+
with:
128+
path: node_modules
129+
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
130+
55131
- name: Size
56-
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.node == 18
57132
uses: andresz1/size-limit-action@v1
58133
with:
59134
github_token: ${{ secrets.GITHUB_TOKEN }}

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export default tseslint.config(
3737
],
3838
"@typescript-eslint/no-require-imports": "off",
3939
"@typescript-eslint/explicit-module-boundary-types": "error",
40+
"@typescript-eslint/consistent-type-imports": "error",
4041
"tsdoc/syntax": "warn",
4142
},
4243
},

package-lock.json

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"@types/fs-extra": "^11.0.4",
5757
"@vitest/coverage-v8": "^2.1.8",
5858
"eslint": "^9.16.0",
59-
"eslint-config-prettier": "^9.1.0",
6059
"eslint-plugin-prettier": "^5.2.1",
6160
"eslint-plugin-tsdoc": "^0.4.0",
6261
"prettier": "^3.4.1",

src/lib/readPackageJSON.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as fs from "node:fs";
22
import * as path from "node:path";
33

4-
import { PackageJSON } from "../types";
4+
import type { PackageJSON } from "../types";
55

66
export const readPackageJSON = (rootDir = process.cwd()): PackageJSON => {
77
try {

src/plugins/extendConfig.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import * as path from "node:path";
33
import typescript from "@rollup/plugin-typescript";
44
import { defuFn } from "defu";
55
import renameNodeModules from "rollup-plugin-rename-node-modules";
6-
import { Plugin, UserConfig, defineConfig } from "vite";
6+
import type { Plugin, UserConfig } from "vite";
7+
import { defineConfig } from "vite";
78

89
import { builtins } from "../lib/builtins";
910

src/plugins/moveTypeDeclarations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as path from "node:path";
44
import fse from "fs-extra";
55
import type { Plugin, ResolvedConfig } from "vite";
66

7-
import { Options } from "../types";
7+
import type { Options } from "../types";
88

99
export const moveTypeDeclarationsPlugin = (options: Options): Plugin | null => {
1010
if (!options.dts) {

0 commit comments

Comments
 (0)