diff --git a/eslint.config.mjs b/eslint.config.mjs index a42ac76a2..4b7be16a4 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,41 +1,37 @@ +import { defineConfig, globalIgnores } from 'eslint/config' import globals from 'globals' -import pluginJs from '@eslint/js' +import js from '@eslint/js' import pluginCypress from 'eslint-plugin-cypress' import stylistic from '@stylistic/eslint-plugin' -export default [ - pluginJs.configs.recommended, - pluginCypress.configs.recommended, +export default defineConfig([ + globalIgnores([ + 'dist/', + 'examples/component-tests/dist/', + 'examples/nextjs/.next/', + 'examples/nextjs/build/', + 'examples/nextjs/src/app/', + 'examples/wait-on-vite/dist/', + 'examples/**/.pnp.*', + ]), { - name: 'global-ignores', - ignores: [ - 'dist/', - 'examples/component-tests/dist/', - 'examples/nextjs/.next/', - 'examples/nextjs/build/', - 'examples/nextjs/src/app/', - 'examples/wait-on-vite/dist/', - 'examples/**/.pnp.*', - ], - }, - { - name: 'all-js', - languageOptions: { - globals: { - ...globals.browser, - ...globals.node, - }, - }, - }, - { - name: 'style', files: ['eslint.config.mjs', 'examples/**/*.js'], - ...stylistic.configs.recommended, + extends: + [ + js.configs.recommended, + pluginCypress.configs.recommended, + stylistic.configs.recommended, + ], rules: { - '@stylistic/indent': ['error', 2], + '@stylistic/arrow-parens': ['error', 'always'], '@stylistic/comma-dangle': ['error', 'always-multiline'], + '@stylistic/indent': ['error', 2], '@stylistic/quotes': ['error', 'single'], '@stylistic/semi': ['error', 'never'], + '@stylistic/space-before-function-paren': ['error', 'always'], + }, + languageOptions: { + globals: globals.node, }, }, -] +]) diff --git a/examples/browser/cypress.config.js b/examples/browser/cypress.config.js index 3bba37656..655e52b22 100644 --- a/examples/browser/cypress.config.js +++ b/examples/browser/cypress.config.js @@ -4,7 +4,7 @@ const os = require('os') module.exports = defineConfig({ fixturesFolder: false, e2e: { - setupNodeEvents(on) { + setupNodeEvents (on) { on('before:browser:launch', (browser, launchOptions) => { console.log('before launching browser') console.log(browser) @@ -20,7 +20,7 @@ module.exports = defineConfig({ }) on('task', { - log(message) { + log (message) { console.log(message) return null }, diff --git a/examples/component-tests/cypress/support/commands.js b/examples/component-tests/cypress/support/commands.js index 66ea16ef0..119ab03f7 100644 --- a/examples/component-tests/cypress/support/commands.js +++ b/examples/component-tests/cypress/support/commands.js @@ -22,4 +22,4 @@ // // // -- This will overwrite an existing command -- -// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) \ No newline at end of file +// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) diff --git a/examples/config/cypress.config-alternate.js b/examples/config/cypress.config-alternate.js index edaea60d2..a47f49b66 100644 --- a/examples/config/cypress.config-alternate.js +++ b/examples/config/cypress.config-alternate.js @@ -4,7 +4,7 @@ module.exports = defineConfig({ fixturesFolder: false, e2e: { baseUrl: 'http://localhost:3333', - setupNodeEvents() { + setupNodeEvents () { console.log('\nUsing cypress.config-alternate.js config-file') }, supportFile: false, diff --git a/examples/custom-command/index.js b/examples/custom-command/index.js index 1c5b91b88..8085509dd 100644 --- a/examples/custom-command/index.js +++ b/examples/custom-command/index.js @@ -4,7 +4,7 @@ const cypress = require('cypress') const _ = require('lodash') const fs = require('fs') -cypress.run().then(results => { +cypress.run().then((results) => { const summary = _.pickBy(results, (value, key) => key.startsWith('total'), ) diff --git a/examples/env/cypress.config.js b/examples/env/cypress.config.js index 6e71d28d7..73860dd58 100644 --- a/examples/env/cypress.config.js +++ b/examples/env/cypress.config.js @@ -3,7 +3,7 @@ const { defineConfig } = require('cypress') module.exports = defineConfig({ fixturesFolder: false, e2e: { - setupNodeEvents(on, config) { + setupNodeEvents (on, config) { console.log('logging from cypress.config.js') console.log( 'process.env.CYPRESS_environmentName', diff --git a/examples/quiet/cypress.config.js b/examples/quiet/cypress.config.js index 27cc7e187..3d7eb3c73 100644 --- a/examples/quiet/cypress.config.js +++ b/examples/quiet/cypress.config.js @@ -3,9 +3,9 @@ const { defineConfig } = require('cypress') module.exports = defineConfig({ fixturesFolder: false, e2e: { - setupNodeEvents(on) { + setupNodeEvents (on) { on('task', { - log(message) { + log (message) { console.log(message) return null }, diff --git a/examples/wait-on-vite/counter.js b/examples/wait-on-vite/counter.js index 881e2d7ad..989620bc0 100644 --- a/examples/wait-on-vite/counter.js +++ b/examples/wait-on-vite/counter.js @@ -1,4 +1,4 @@ -export function setupCounter(element) { +export function setupCounter (element) { let counter = 0 const setCounter = (count) => { counter = count diff --git a/examples/wait-on/index4.js b/examples/wait-on/index4.js index efe873580..dcf8d9c4d 100644 --- a/examples/wait-on/index4.js +++ b/examples/wait-on/index4.js @@ -17,7 +17,7 @@ log('creating the server on port %d', port) const server = http.createServer((req, res) => { const reqTimestamp = +new Date() log('request at %d: %s %s', reqTimestamp, req.method, req.url) - setTimeout(function() { + setTimeout(function () { log('responding to request from %d', reqTimestamp) res.writeHead(200) res.end('all good') diff --git a/examples/webpack/webpack.config.js b/examples/webpack/webpack.config.js index 06f5291ab..5d920a807 100644 --- a/examples/webpack/webpack.config.js +++ b/examples/webpack/webpack.config.js @@ -7,7 +7,7 @@ module.exports = { }, devServer: { static: { - directory: __dirname, + directory: __dirname, }, }, mode: 'development', diff --git a/package-lock.json b/package-lock.json index 03267acd1..c83f7d36c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,13 +23,13 @@ "supports-color": "9.3.1" }, "devDependencies": { - "@eslint/js": "9.34.0", - "@stylistic/eslint-plugin": "5.2.0", + "@eslint/js": "9.38.0", + "@stylistic/eslint-plugin": "5.5.0", "@types/node": "24.0.15", "@vercel/ncc": "0.38.1", - "eslint": "9.34.0", - "eslint-plugin-cypress": "5.1.0", - "globals": "16.3.0", + "eslint": "9.38.0", + "eslint-plugin-cypress": "5.2.0", + "globals": "16.4.0", "husky": "9.1.7", "markdown-link-check": "3.14.1", "prettier": "3.6.2" @@ -383,9 +383,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "dev": true, "license": "MIT", "dependencies": { @@ -425,13 +425,13 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz", - "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/object-schema": "^2.1.6", + "@eslint/object-schema": "^2.1.7", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -440,19 +440,22 @@ } }, "node_modules/@eslint/config-helpers": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz", - "integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.1.tgz", + "integrity": "sha512-csZAzkNhsgwb0I/UAV6/RGFTbiakPCf0ZrGmrIxQpYvGZ00PhTkSnyKNolphgIvmnJeGw6rcGVEXfTzUnFuEvw==", "dev": true, "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.16.0" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/core": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", - "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.16.0.tgz", + "integrity": "sha512-nmC8/totwobIiFcGkDza3GIKfAw1+hLiYVrh3I1nIomQ8PEr5cxg34jnkmGawul/ep52wGRAcyeDCNtWKSOj4Q==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -520,9 +523,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.34.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.34.0.tgz", - "integrity": "sha512-EoyvqQnBNsV1CWaEJ559rxXL4c8V92gxirbawSmVUOWXlsRxxQXl6LmCpdUblgxgSkDIqKnhzba2SjRTI/A5Rw==", + "version": "9.38.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.38.0.tgz", + "integrity": "sha512-UZ1VpFvXf9J06YG9xQBdnzU+kthors6KjhMAl6f4gH4usHyh31rUf2DLGInT8RFYIReYXNSydgPY0V2LuWgl7A==", "dev": true, "license": "MIT", "engines": { @@ -533,9 +536,9 @@ } }, "node_modules/@eslint/object-schema": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", - "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -543,13 +546,13 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", - "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.0.tgz", + "integrity": "sha512-sB5uyeq+dwCWyPi31B2gQlVlo+j5brPlWx4yZBrEaRo/nhdDE8Xke1gsGgtiBdaBTxuTkceLVuVt/pclrasb0A==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.15.2", + "@eslint/core": "^0.16.0", "levn": "^0.4.1" }, "engines": { @@ -844,14 +847,14 @@ } }, "node_modules/@stylistic/eslint-plugin": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.2.0.tgz", - "integrity": "sha512-RCEdbREv9EBiToUBQTlRhVYKG093I6ZnnQ990j08eJ6uRZh71DXkOnoxtTLfDQ6utVCVQzrhZFHZP0zfrfOIjA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.5.0.tgz", + "integrity": "sha512-IeZF+8H0ns6prg4VrkhgL+yrvDXWDH2cKchrbh80ejG9dQgZWp10epHMbgRuQvgchLII/lfh6Xn3lu6+6L86Hw==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/types": "^8.37.0", + "@eslint-community/eslint-utils": "^4.9.0", + "@typescript-eslint/types": "^8.46.1", "eslint-visitor-keys": "^4.2.1", "espree": "^10.4.0", "estraverse": "^5.3.0", @@ -956,9 +959,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.37.0.tgz", - "integrity": "sha512-ax0nv7PUF9NOVPs+lmQ7yIE7IQmAf8LGcXbMvHX5Gm+YJUYNAl340XkGnrimxZ0elXyoQJuN5sbg6C4evKA4SQ==", + "version": "8.46.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.46.2.tgz", + "integrity": "sha512-lNCWCbq7rpg7qDsQrd3D6NyWYu+gkTENkG5IKYhUIcxSb59SQC/hEQ+MrG4sTgBVghTonNWq42bA/d4yYumldQ==", "dev": true, "license": "MIT", "engines": { @@ -1680,25 +1683,24 @@ } }, "node_modules/eslint": { - "version": "9.34.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.34.0.tgz", - "integrity": "sha512-RNCHRX5EwdrESy3Jc9o8ie8Bog+PeYvvSR8sDGoZxNFTvZ4dlxUB3WzQ3bQMztFrSRODGrLLj8g6OFuGY/aiQg==", + "version": "9.38.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.38.0.tgz", + "integrity": "sha512-t5aPOpmtJcZcz5UJyY2GbvpDlsK5E8JqRqoKtfiKE3cNh437KIqfJr3A3AKf5k64NPx6d0G3dno6XDY05PqPtw==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.0", - "@eslint/config-helpers": "^0.3.1", - "@eslint/core": "^0.15.2", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.1", + "@eslint/core": "^0.16.0", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.34.0", - "@eslint/plugin-kit": "^0.3.5", + "@eslint/js": "9.38.0", + "@eslint/plugin-kit": "^0.4.0", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", - "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", @@ -1741,9 +1743,9 @@ } }, "node_modules/eslint-plugin-cypress": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-5.1.0.tgz", - "integrity": "sha512-tdLXm4aq9vX2hTtKJTUFD3gdNseMKqsf8+P6hI4TtOPdz1LU4xvTpQBd1++qPAsPZP2lyYh71B5mvzu2lBr4Ow==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-5.2.0.tgz", + "integrity": "sha512-vuCUBQloUSILxtJrUWV39vNIQPlbg0L7cTunEAzvaUzv9LFZZym+KFLH18n9j2cZuFPdlxOqTubCvg5se0DyGw==", "dev": true, "license": "MIT", "dependencies": { @@ -2143,9 +2145,9 @@ } }, "node_modules/globals": { - "version": "16.3.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-16.3.0.tgz", - "integrity": "sha512-bqWEnJ1Nt3neqx2q5SFfGS8r/ahumIakg3HcwtNlrVlwXIeNumWn/c7Pn/wKzGhf6SaW6H6uWXLqC30STCMchQ==", + "version": "16.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.4.0.tgz", + "integrity": "sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index facb775cd..89b458f28 100644 --- a/package.json +++ b/package.json @@ -52,13 +52,13 @@ "supports-color": "9.3.1" }, "devDependencies": { - "@eslint/js": "9.34.0", - "@stylistic/eslint-plugin": "5.2.0", + "@eslint/js": "9.38.0", + "@stylistic/eslint-plugin": "5.5.0", "@types/node": "24.0.15", "@vercel/ncc": "0.38.1", - "eslint": "9.34.0", - "eslint-plugin-cypress": "5.1.0", - "globals": "16.3.0", + "eslint": "9.38.0", + "eslint-plugin-cypress": "5.2.0", + "globals": "16.4.0", "husky": "9.1.7", "markdown-link-check": "3.14.1", "prettier": "3.6.2"