Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm test
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
export default { extends: ['@commitlint/config-conventional'] };
48 changes: 48 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import js from '@eslint/js';
import importPlugin from 'eslint-plugin-import';
import cypressPlugin from 'eslint-plugin-cypress';

export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
// Node.js globals
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
module: 'readonly',
require: 'readonly',
exports: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
// Cypress globals
cy: 'readonly',
// Jest globals
describe: 'readonly',
it: 'readonly',
test: 'readonly',
expect: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
jest: 'readonly',
},
},
plugins: {
import: importPlugin,
cypress: cypressPlugin,
},
rules: {
'import/extensions': ['error', 'always'],
'import/order': ['error', { 'newlines-between': 'always' }],
},
},
];
38 changes: 12 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"lint": "eslint 'src/**/*.js'",
"format": "prettier --write 'src/**/*.js'",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --collect-coverage --maxWorkers=1",
"format:ci": "prettier --check 'src/**/*.js'"
"format:ci": "prettier --check 'src/**/*.js'",
"prepare": "husky"
},
"keywords": [
"netlify",
Expand All @@ -24,10 +25,10 @@
"license": "MIT",
"dependencies": {
"chalk": "^5.6.2",
"chrome-launcher": "^0.15.0",
"chrome-launcher": "^1.2.1",
"compression": "^1.7.4",
"dotenv": "^16.0.0",
"express": "^4.17.1",
"dotenv": "^17.2.3",
"express": "^5.1.0",
"html-minifier-terser": "^7.2.0",
"lighthouse": "^9.6.3",
"puppeteer": "24.8.2"
Expand All @@ -44,31 +45,16 @@
"url": "https://github.com/netlify/netlify-plugin-lighthouse/issues"
},
"devDependencies": {
"@commitlint/cli": "^17.0.0",
"@commitlint/config-conventional": "^17.0.0",
"cypress": "^13.17.0",
"eslint": "^8.57.1",
"eslint-plugin-cypress": "^2.15.2",
"@commitlint/cli": "^20.1.0",
"@commitlint/config-conventional": "^20.0.0",
"cypress": "^14.5.4",
"eslint": "^9.39.1",
"eslint-plugin-cypress": "^5.2.0",
"eslint-plugin-import": "^2.32.0",
"husky": "^8.0.1",
"jest": "^29.0.0",
"husky": "^9.1.7",
"jest": "^30.2.0",
"netlify-plugin-cypress": "^2.2.1",
"prettier": "3.6.2",
"strip-ansi": "^7.1.2"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"resolutions": {
"koa": "^2.15.4",
"ws": "^8.17.1",
"cookie": "^0.7.0",
"tar-fs": "^2.1.4",
"cross-spawn": "^7.0.5",
"braces": "^3.0.3",
"@babel/helpers": "^7.26.10",
"@koa/cors": "^5.0.0"
}
}
6 changes: 2 additions & 4 deletions src/e2e/mocks/chrome-launcher.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
const chromeLauncher = () =>
jest.unstable_mockModule('chrome-launcher', () => {
return {
default: {
launch: () =>
Promise.resolve({ port: 49920, kill: () => Promise.resolve() }),
},
launch: () =>
Promise.resolve({ port: 49920, kill: () => Promise.resolve() }),
};
});

Expand Down
4 changes: 2 additions & 2 deletions src/run-lighthouse.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import puppeteer from 'puppeteer';
import lighthouse from 'lighthouse';
import log from 'lighthouse-logger';
import chromeLauncher from 'chrome-launcher';
import { launch } from 'chrome-launcher';

export const getBrowserPath = async () => {
const browser = await puppeteer.launch({
Expand All @@ -18,7 +18,7 @@ export const runLighthouse = async (browserPath, url, settings) => {
try {
const logLevel = 'error';
log.setLevel(logLevel);
chrome = await chromeLauncher.launch({
chrome = await launch({
chromePath: browserPath,
chromeFlags: [
'--headless',
Expand Down
Loading
Loading