Skip to content

Commit 1b1ed9c

Browse files
authored
chore: improve linting (#25235)
1 parent 90b2c8d commit 1b1ed9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+107
-1910
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const validators = specifiedRules
2525
)
2626

2727
module.exports = {
28+
root: true,
2829
plugins: [
2930
'@cypress/dev',
3031
'graphql',

cli/.eslintrc.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"extends": "../.eslintrc.js",
32
"rules": {
43
"no-restricted-syntax": [
54
"error",

cli/test/lib/exec/.eslintrc.json

-5
This file was deleted.

npm/angular/.eslintrc

+1-10
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,5 @@
44
],
55
"extends": [
66
"plugin:@cypress/dev/tests"
7-
],
8-
"env": {
9-
"cypress/globals": true
10-
},
11-
"rules": {
12-
"mocha/no-global-tests": "off",
13-
"no-unused-vars": "off",
14-
"no-console": "off",
15-
"@typescript-eslint/no-unused-vars": "off"
16-
}
7+
]
178
}

npm/create-cypress-tests/.eslintrc

+2-24
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,10 @@
77
"plugin:@cypress/dev/general",
88
"plugin:@cypress/dev/tests"
99
],
10-
"parser": "@typescript-eslint/parser",
1110
"env": {
1211
"cypress/globals": true
1312
},
1413
"rules": {
15-
"no-console": "off",
16-
"mocha/no-global-tests": "off",
17-
"@typescript-eslint/no-unused-vars": "off"
18-
},
19-
"overrides": [
20-
{
21-
"files": [
22-
"lib/*"
23-
],
24-
"rules": {
25-
"no-console": 1
26-
}
27-
},
28-
{
29-
"files": [
30-
"**/*.json"
31-
],
32-
"rules": {
33-
"quotes": "off",
34-
"comma-dangle": "off"
35-
}
36-
}
37-
]
14+
"no-console": "off"
15+
}
3816
}

npm/create-cypress-tests/src/component-testing/config-file-updater/configFileUpdater.test.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
/// <reference path="../../../../../cli/types/mocha/index.d.ts" />
22

3-
import * as path from 'path'
43
import { expect } from 'chai'
5-
6-
import * as fs from 'fs-extra'
7-
import { insertValueInJSString, insertValuesInConfigFile } from './configFileUpdater'
8-
const projectRoot = process.cwd()
4+
import { insertValueInJSString } from './configFileUpdater'
95

106
// Test util - if needed outside the tests we can move it to utils
117
const stripIndent = (strings: any, ...args: any) => {

npm/create-cypress-tests/src/component-testing/config-file-updater/configFileUpdater.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import _ from 'lodash'
21
import { parse } from '@babel/parser'
32
import type { File } from '@babel/types'
43
import type { NodePath } from 'ast-types/lib/node-path'

npm/eslint-plugin-dev/.eslintrc.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
"extends": [
77
"plugin:promise/recommended",
88
"plugin:@cypress/dev/general"
9-
],
10-
"rules": {}
9+
]
1110
}

npm/eslint-plugin-dev/lib/scripts/.eslintrc.json

-5
This file was deleted.

npm/eslint-plugin-dev/test/fixtures/.eslintrc

-6
This file was deleted.

npm/grep/.eslintrc

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
},
1111
"rules": {
1212
"mocha/no-global-tests": "off",
13-
"no-unused-vars": "off",
1413
"no-console": "off",
15-
"@typescript-eslint/no-unused-vars": "off",
1614
"no-restricted-syntax": "off"
1715
}
18-
}
16+
}

npm/grep/cypress/e2e/nested-describe-spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('grand', () => {
1212
describe('top', { tags: '@smoke' }, () => {
1313
describe('middle', () => {
1414
context('bottom', { tags: ['@integration', '@fast'] }, () => {
15-
it('runs too', () => {});
15+
it('runs too', () => {})
1616
})
1717
})
1818
})

npm/grep/cypress/e2e/omit-and-skip-spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// @ts-check
44
describe('Page', () => {
55
describe('List', { tags: ['@us1'] }, () => {
6+
// eslint-disable-next-line @cypress/dev/skip-comment
67
it.skip('first test', () => {})
78
it('second test', () => {})
89
it('third test', () => {})

npm/grep/cypress/e2e/skip-spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @cypress/dev/skip-comment */
12
/// <reference types="cypress" />
23
describe('tests that use .skip', () => {
34
// use a template literal

npm/grep/cypress/e2e/ts-spec.ts

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ describe('TypeScript spec', () => {
1313

1414
it('loads', () => {
1515
const n: number = 1
16+
1617
cy.wrap(n).should('eq', 1)
1718
})
1819

@@ -24,6 +25,7 @@ describe('TypeScript spec', () => {
2425
const p: Person = {
2526
name: 'Joe',
2627
}
28+
2729
cy.wrap(p).should('have.property', 'name', 'Joe')
2830
})
2931
})

npm/grep/cypress/support/e2e.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/// <reference types="cypress" />
33

44
import cypressGrep from '../../src/support'
5+
56
// register the grep feature
67
// https://github.com/cypress-io/cypress-grep
7-
cypressGrep()
8+
cypressGrep()

npm/grep/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"main": "src/support.js",
66
"scripts": {
77
"cy:run": "node ../../scripts/cypress.js run --config specPattern='**/unit.js'",
8-
"cy:open": "node ../../scripts/cypress.js open --e2e -b electron --config specPattern='**/unit.js'"
8+
"cy:open": "node ../../scripts/cypress.js open --e2e -b electron --config specPattern='**/unit.js'",
9+
"lint": "eslint . --ext .js,.ts"
910
},
1011
"dependencies": {
1112
"debug": "^4.3.2",

npm/react/.eslintrc

+1-21
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"rules": {
2020
"no-console": "off",
2121
"mocha/no-global-tests": "off",
22-
"@typescript-eslint/no-unused-vars": "off",
2322
"react/jsx-filename-extension": [
2423
"warn",
2524
{
@@ -30,24 +29,5 @@
3029
]
3130
}
3231
]
33-
},
34-
"overrides": [
35-
{
36-
"files": [
37-
"lib/*"
38-
],
39-
"rules": {
40-
"no-console": 1
41-
}
42-
},
43-
{
44-
"files": [
45-
"**/*.json"
46-
],
47-
"rules": {
48-
"quotes": "off",
49-
"comma-dangle": "off"
50-
}
51-
}
52-
]
32+
}
5333
}

npm/svelte/.eslintrc

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
},
1111
"rules": {
1212
"mocha/no-global-tests": "off",
13-
"no-unused-vars": "off",
14-
"no-console": "off",
15-
"@typescript-eslint/no-unused-vars": "off"
13+
"no-console": "off"
1614
}
1715
}

npm/svelte/src/mount.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const cleanup = () => {
3131
// Extract the component name from the object passed to mount
3232
const getComponentDisplayName = <T extends SvelteComponent>(Component: SvelteConstructor<T>): string => {
3333
if (Component.name) {
34-
const [_, match] = /Proxy\<(\w+)\>/.exec(Component.name) || []
34+
const [, match] = /Proxy\<(\w+)\>/.exec(Component.name) || []
3535

3636
return match || Component.name
3737
}

npm/vite-dev-server/.eslintrc

+1-21
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"rules": {
2222
"no-console": "off",
2323
"mocha/no-global-tests": "off",
24-
"@typescript-eslint/no-unused-vars": "off",
2524
"react/jsx-filename-extension": [
2625
"warn",
2726
{
@@ -32,24 +31,5 @@
3231
]
3332
}
3433
]
35-
},
36-
"overrides": [
37-
{
38-
"files": [
39-
"lib/*"
40-
],
41-
"rules": {
42-
"no-console": 1
43-
}
44-
},
45-
{
46-
"files": [
47-
"**/*.json"
48-
],
49-
"rules": {
50-
"quotes": "off",
51-
"comma-dangle": "off"
52-
}
53-
}
54-
]
34+
}
5535
}

npm/vite-dev-server/src/devServer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import debugFn from 'debug'
2-
import type { InlineConfig, UserConfig } from 'vite'
2+
import type { UserConfig } from 'vite'
33
import { getVite, Vite } from './getVite'
44
import { createViteDevServerConfig } from './resolveConfig'
55

npm/vue/.eslintrc

-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
},
2020
"rules": {
2121
"mocha/no-global-tests": "off",
22-
"no-unused-vars": "off",
2322
"no-console": "off",
24-
"@typescript-eslint/no-unused-vars": "off",
2523
"vue/multi-word-component-names": "off"
2624
}
2725
}

npm/vue/cypress/component/tailwind/redbox.cy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { mount, mountCallback } from '@cypress/vue'
1+
import { mount } from '@cypress/vue'
22
import RedBox from './RedBox.vue'
33

44
const tailwindCdnLink = 'https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css'

npm/vue2/.eslintrc

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
},
1111
"rules": {
1212
"mocha/no-global-tests": "off",
13-
"no-unused-vars": "off",
14-
"no-console": "off",
15-
"@typescript-eslint/no-unused-vars": "off"
13+
"no-console": "off"
1614
}
1715
}

npm/vue2/webpack.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// The default for running tests in this project
33
// https://vue-loader.vuejs.org/guide/#manual-setup
44
const VueLoaderPlugin = require('vue-loader/lib/plugin')
5-
const HtmlWebpackPlugin = require('html-webpack-plugin')
65
const path = require('path')
76
const pkg = require('package.json')
87

npm/webpack-batteries-included-preprocessor/.eslintrc.json

-11
This file was deleted.

npm/webpack-preprocessor/.eslintrc.json

-11
This file was deleted.

npm/xpath/.eslintrc

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
"cypress/globals": true
1010
},
1111
"rules": {
12-
"mocha/no-global-tests": "off",
13-
"no-unused-vars": "off",
14-
"no-console": "off",
15-
"@typescript-eslint/no-unused-vars": "off"
12+
"no-console": "off"
1613
}
1714
}

npm/xpath/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Adds XPath command to Cypress.io test runner",
55
"main": "src",
66
"scripts": {
7+
"lint": "eslint . --ext .ts,.js",
78
"cy:run": "node ../../scripts/cypress.js run --e2e",
89
"cy:open": "node ../../scripts/cypress.js open --e2e --project ${PWD}"
910
},

npm/xpath/src/index.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/// <reference types="cypress" />
22

33
declare namespace Cypress {
4+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
45
interface Chainable<Subject> {
56
/**
67
* Get one or more DOM elements by an XPath selector.
@@ -10,6 +11,6 @@ declare namespace Cypress {
1011
* cy.xpath(`//ul[@class="todo-list"]//li`)
1112
* .should('have.length', 3)
1213
*/
13-
xpath<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
14+
xpath<E extends Node = HTMLElement>(selector: string, options?: Partial<Loggable & Timeoutable>): Chainable<JQuery<E>>
1415
}
15-
}
16+
}

package.json

-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"ensure-deps": "./scripts/ensure-dependencies.sh",
4242
"get-next-version": "node scripts/get-next-version.js",
4343
"postinstall": "node ./scripts/run-postInstall.js",
44-
"jscodeshift": "jscodeshift -t ./node_modules/js-codemod/transforms/arrow-function-arguments.js",
4544
"lint": "lerna run lint --no-bail --concurrency 2",
4645
"lint-changed": "lint-changed",
4746
"prepare-release-artifacts": "node ./scripts/prepare-release-artifacts.js",
@@ -176,9 +175,6 @@
176175
"inquirer": "3.3.0",
177176
"inquirer-confirm": "2.0.3",
178177
"jest": "24.9.0",
179-
"js-codemod": "cpojer/js-codemod",
180-
"jscodemods": "https://github.com/cypress-io/jscodemods.git#01b546e",
181-
"jscodeshift": "0.7.0",
182178
"lazy-ass": "1.6.0",
183179
"lerna": "3.22.1",
184180
"lint-staged": "11.1.2",

0 commit comments

Comments
 (0)