Skip to content

Commit

Permalink
Merge pull request #159 from lydell/updates
Browse files Browse the repository at this point in the history
Update repo
  • Loading branch information
lydell committed Feb 10, 2024
2 parents 611d87b + bcf8a3f commit a562d8d
Show file tree
Hide file tree
Showing 18 changed files with 3,188 additions and 10,447 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.dogfood.json
@@ -0,0 +1,10 @@
{
"rules": {
"imports": "error",
"exports": "error"
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": "latest"
}
}
15 changes: 12 additions & 3 deletions .eslintrc.js
Expand Up @@ -8,7 +8,7 @@ const warn = process.argv.includes("--report-unused-disable-directives")
module.exports = {
root: true,
extends: ["eslint:recommended"],
plugins: ["jest"],
plugins: ["vitest"],
parserOptions: {
ecmaVersion: 2018,
},
Expand Down Expand Up @@ -63,10 +63,19 @@ module.exports = {
yoda: warn,
},
overrides: [
{
files: ["test/*.js", "*.mjs"],
parserOptions: {
sourceType: "module",
},
},
{
files: ["*.test.js"],
extends: ["plugin:jest/recommended"],
env: { "jest/globals": true },
extends: ["plugin:vitest/recommended"],
rules: {
"vitest/no-disabled-tests": warn,
"vitest/no-focused-tests": warn,
},
},
],
};
22 changes: 9 additions & 13 deletions .github/workflows/check.yml
Expand Up @@ -12,31 +12,27 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: "${{ matrix.node-version }}"

- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules
key: node_modules-${{ matrix.node-version }}-${{ hashFiles('package.json', 'package-lock.json') }}

- name: npm ci
if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci
- if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci --no-audit

- name: Build
run: npm run build
- run: npm run build

- name: ESLint
run: npx eslint . --report-unused-disable-directives
- run: npx eslint . --report-unused-disable-directives

- name: Prettier
run: npx prettier --check .
- run: npx prettier --check .
16 changes: 7 additions & 9 deletions .github/workflows/test.yml
Expand Up @@ -12,25 +12,23 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: "${{ matrix.node-version }}"

- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules
key: node_modules-${{ matrix.node-version }}-${{ hashFiles('package.json', 'package-lock.json') }}

- name: npm ci
if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci
- if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci --no-audit

- name: Jest
run: npx jest --coverage
- run: npx vitest
2 changes: 1 addition & 1 deletion babel.config.json
@@ -1,6 +1,6 @@
{
"plugins": [
"@babel/plugin-syntax-import-assertions",
"@babel/plugin-syntax-import-attributes",
"@babel/plugin-transform-flow-strip-types"
]
}
2 changes: 1 addition & 1 deletion build.js
Expand Up @@ -32,7 +32,7 @@ for (const { src, dest = src, transform } of FILES_TO_COPY) {
if (transform) {
fs.writeFileSync(
path.join(BUILD, dest),
transform(fs.readFileSync(path.join(DIR, src), "utf8"))
transform(fs.readFileSync(path.join(DIR, src), "utf8")),
);
} else {
fs.copyFileSync(path.join(DIR, src), path.join(BUILD, dest));
Expand Down
13 changes: 0 additions & 13 deletions jest.config.js

This file was deleted.

0 comments on commit a562d8d

Please sign in to comment.