Skip to content

Commit a562d8d

Browse files
authored
Merge pull request #159 from lydell/updates
Update repo
2 parents 611d87b + bcf8a3f commit a562d8d

18 files changed

+3188
-10447
lines changed

.eslintrc.dogfood.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"rules": {
3+
"imports": "error",
4+
"exports": "error"
5+
},
6+
"parserOptions": {
7+
"sourceType": "module",
8+
"ecmaVersion": "latest"
9+
}
10+
}

.eslintrc.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const warn = process.argv.includes("--report-unused-disable-directives")
88
module.exports = {
99
root: true,
1010
extends: ["eslint:recommended"],
11-
plugins: ["jest"],
11+
plugins: ["vitest"],
1212
parserOptions: {
1313
ecmaVersion: 2018,
1414
},
@@ -63,10 +63,19 @@ module.exports = {
6363
yoda: warn,
6464
},
6565
overrides: [
66+
{
67+
files: ["test/*.js", "*.mjs"],
68+
parserOptions: {
69+
sourceType: "module",
70+
},
71+
},
6672
{
6773
files: ["*.test.js"],
68-
extends: ["plugin:jest/recommended"],
69-
env: { "jest/globals": true },
74+
extends: ["plugin:vitest/recommended"],
75+
rules: {
76+
"vitest/no-disabled-tests": warn,
77+
"vitest/no-focused-tests": warn,
78+
},
7079
},
7180
],
7281
};

.github/workflows/check.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,27 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [18.x]
15+
node-version: [20.x]
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919

20-
- uses: actions/setup-node@v3
20+
- uses: actions/setup-node@v4
2121
with:
2222
node-version: "${{ matrix.node-version }}"
2323

2424
- name: Cache node_modules
2525
id: cache-node_modules
26-
uses: actions/cache@v3
26+
uses: actions/cache@v4
2727
with:
2828
path: node_modules
2929
key: node_modules-${{ matrix.node-version }}-${{ hashFiles('package.json', 'package-lock.json') }}
3030

31-
- name: npm ci
32-
if: steps.cache-node_modules.outputs.cache-hit != 'true'
33-
run: npm ci
31+
- if: steps.cache-node_modules.outputs.cache-hit != 'true'
32+
run: npm ci --no-audit
3433

35-
- name: Build
36-
run: npm run build
34+
- run: npm run build
3735

38-
- name: ESLint
39-
run: npx eslint . --report-unused-disable-directives
36+
- run: npx eslint . --report-unused-disable-directives
4037

41-
- name: Prettier
42-
run: npx prettier --check .
38+
- run: npx prettier --check .

.github/workflows/test.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,23 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [14.x, 16.x, 18.x]
15+
node-version: [18.x, 20.x]
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919

20-
- uses: actions/setup-node@v3
20+
- uses: actions/setup-node@v4
2121
with:
2222
node-version: "${{ matrix.node-version }}"
2323

2424
- name: Cache node_modules
2525
id: cache-node_modules
26-
uses: actions/cache@v3
26+
uses: actions/cache@v4
2727
with:
2828
path: node_modules
2929
key: node_modules-${{ matrix.node-version }}-${{ hashFiles('package.json', 'package-lock.json') }}
3030

31-
- name: npm ci
32-
if: steps.cache-node_modules.outputs.cache-hit != 'true'
33-
run: npm ci
31+
- if: steps.cache-node_modules.outputs.cache-hit != 'true'
32+
run: npm ci --no-audit
3433

35-
- name: Jest
36-
run: npx jest --coverage
34+
- run: npx vitest

babel.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"plugins": [
3-
"@babel/plugin-syntax-import-assertions",
3+
"@babel/plugin-syntax-import-attributes",
44
"@babel/plugin-transform-flow-strip-types"
55
]
66
}

build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ for (const { src, dest = src, transform } of FILES_TO_COPY) {
3232
if (transform) {
3333
fs.writeFileSync(
3434
path.join(BUILD, dest),
35-
transform(fs.readFileSync(path.join(DIR, src), "utf8"))
35+
transform(fs.readFileSync(path.join(DIR, src), "utf8")),
3636
);
3737
} else {
3838
fs.copyFileSync(path.join(DIR, src), path.join(BUILD, dest));

jest.config.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)