Skip to content

Commit 1ca2449

Browse files
committed
fix: update commitlint, cypress, eslint, husky, jest
1 parent 9e14fb4 commit 1ca2449

File tree

9 files changed

+2046
-1684
lines changed

9 files changed

+2046
-1684
lines changed

.eslintrc.json

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

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm test

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = { extends: ['@commitlint/config-conventional'] };
1+
export default { extends: ['@commitlint/config-conventional'] };

eslint.config.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import js from '@eslint/js';
2+
import importPlugin from 'eslint-plugin-import';
3+
import cypressPlugin from 'eslint-plugin-cypress';
4+
5+
export default [
6+
js.configs.recommended,
7+
{
8+
languageOptions: {
9+
ecmaVersion: 'latest',
10+
sourceType: 'module',
11+
globals: {
12+
// Node.js globals
13+
console: 'readonly',
14+
process: 'readonly',
15+
Buffer: 'readonly',
16+
__dirname: 'readonly',
17+
__filename: 'readonly',
18+
module: 'readonly',
19+
require: 'readonly',
20+
exports: 'readonly',
21+
setTimeout: 'readonly',
22+
clearTimeout: 'readonly',
23+
setInterval: 'readonly',
24+
clearInterval: 'readonly',
25+
// Cypress globals
26+
cy: 'readonly',
27+
// Jest globals
28+
describe: 'readonly',
29+
it: 'readonly',
30+
test: 'readonly',
31+
expect: 'readonly',
32+
beforeEach: 'readonly',
33+
afterEach: 'readonly',
34+
beforeAll: 'readonly',
35+
afterAll: 'readonly',
36+
jest: 'readonly',
37+
},
38+
},
39+
plugins: {
40+
import: importPlugin,
41+
cypress: cypressPlugin,
42+
},
43+
rules: {
44+
'import/extensions': ['error', 'always'],
45+
'import/order': ['error', { 'newlines-between': 'always' }],
46+
},
47+
},
48+
];

package.json

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"lint": "eslint 'src/**/*.js'",
1010
"format": "prettier --write 'src/**/*.js'",
1111
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --collect-coverage --maxWorkers=1",
12-
"format:ci": "prettier --check 'src/**/*.js'"
12+
"format:ci": "prettier --check 'src/**/*.js'",
13+
"prepare": "husky"
1314
},
1415
"keywords": [
1516
"netlify",
@@ -24,10 +25,10 @@
2425
"license": "MIT",
2526
"dependencies": {
2627
"chalk": "^5.6.2",
27-
"chrome-launcher": "^0.15.0",
28+
"chrome-launcher": "^1.2.1",
2829
"compression": "^1.7.4",
29-
"dotenv": "^16.0.0",
30-
"express": "^4.17.1",
30+
"dotenv": "^17.2.3",
31+
"express": "^5.1.0",
3132
"html-minifier-terser": "^7.2.0",
3233
"lighthouse": "^9.6.3",
3334
"puppeteer": "24.8.2"
@@ -44,31 +45,16 @@
4445
"url": "https://github.com/netlify/netlify-plugin-lighthouse/issues"
4546
},
4647
"devDependencies": {
47-
"@commitlint/cli": "^17.0.0",
48-
"@commitlint/config-conventional": "^17.0.0",
49-
"cypress": "^13.17.0",
50-
"eslint": "^8.57.1",
51-
"eslint-plugin-cypress": "^2.15.2",
48+
"@commitlint/cli": "^20.1.0",
49+
"@commitlint/config-conventional": "^20.0.0",
50+
"cypress": "^15.6.0",
51+
"eslint": "^9.39.1",
52+
"eslint-plugin-cypress": "^5.2.0",
5253
"eslint-plugin-import": "^2.32.0",
53-
"husky": "^8.0.1",
54-
"jest": "^29.0.0",
54+
"husky": "^9.1.7",
55+
"jest": "^30.2.0",
5556
"netlify-plugin-cypress": "^2.2.1",
5657
"prettier": "3.6.2",
5758
"strip-ansi": "^7.1.2"
58-
},
59-
"husky": {
60-
"hooks": {
61-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
62-
}
63-
},
64-
"resolutions": {
65-
"koa": "^2.15.4",
66-
"ws": "^8.17.1",
67-
"cookie": "^0.7.0",
68-
"tar-fs": "^2.1.4",
69-
"cross-spawn": "^7.0.5",
70-
"braces": "^3.0.3",
71-
"@babel/helpers": "^7.26.10",
72-
"@koa/cors": "^5.0.0"
7359
}
7460
}

src/e2e/mocks/chrome-launcher.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
const chromeLauncher = () =>
22
jest.unstable_mockModule('chrome-launcher', () => {
33
return {
4-
default: {
5-
launch: () =>
6-
Promise.resolve({ port: 49920, kill: () => Promise.resolve() }),
7-
},
4+
launch: () =>
5+
Promise.resolve({ port: 49920, kill: () => Promise.resolve() }),
86
};
97
});
108

src/run-lighthouse.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import puppeteer from 'puppeteer';
22
import lighthouse from 'lighthouse';
33
import log from 'lighthouse-logger';
4-
import chromeLauncher from 'chrome-launcher';
4+
import { launch } from 'chrome-launcher';
55

66
export const getBrowserPath = async () => {
77
const browser = await puppeteer.launch({
@@ -18,7 +18,7 @@ export const runLighthouse = async (browserPath, url, settings) => {
1818
try {
1919
const logLevel = 'error';
2020
log.setLevel(logLevel);
21-
chrome = await chromeLauncher.launch({
21+
chrome = await launch({
2222
chromePath: browserPath,
2323
chromeFlags: [
2424
'--headless',

0 commit comments

Comments
 (0)