Skip to content

Commit ed90b14

Browse files
refactor: move linting to each lib to enable caching (#24424)
1 parent 8d85c80 commit ed90b14

File tree

82 files changed

+418
-266
lines changed

Some content is hidden

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

82 files changed

+418
-266
lines changed

.eslintignore

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

cli/.eslintignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
**/__snapshots__
2+
/build
3+
4+
# cli/types is linted by tslint/dtslint
5+
/types
6+
7+
# these are all copied from dist'd builds from the individual libs
8+
/angular
9+
/react
10+
/react18
11+
/vue
12+
/vue2
13+
/svelte
14+
/mount-utils

cli/__snapshots__/build_spec.js

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
exports['package.json build outputs expected properties 1'] = {
2-
"name": "test",
3-
"engines": "test engines",
4-
"version": "x.y.z",
5-
"buildInfo": "replaced by normalizePackageJson",
6-
"description": "Cypress is a next generation front end testing tool built for the modern web",
7-
"homepage": "https://github.com/cypress-io/cypress",
8-
"license": "MIT",
9-
"bugs": {
10-
"url": "https://github.com/cypress-io/cypress/issues"
2+
'name': 'test',
3+
'engines': 'test engines',
4+
'version': 'x.y.z',
5+
'buildInfo': 'replaced by normalizePackageJson',
6+
'description': 'Cypress is a next generation front end testing tool built for the modern web',
7+
'homepage': 'https://github.com/cypress-io/cypress',
8+
'license': 'MIT',
9+
'bugs': {
10+
'url': 'https://github.com/cypress-io/cypress/issues',
1111
},
12-
"repository": {
13-
"type": "git",
14-
"url": "https://github.com/cypress-io/cypress.git"
12+
'repository': {
13+
'type': 'git',
14+
'url': 'https://github.com/cypress-io/cypress.git',
1515
},
16-
"keywords": [
17-
"automation",
18-
"browser",
19-
"cypress",
20-
"cypress.io",
21-
"e2e",
22-
"end-to-end",
23-
"integration",
24-
"component",
25-
"mocks",
26-
"runner",
27-
"spies",
28-
"stubs",
29-
"test",
30-
"testing"
16+
'keywords': [
17+
'automation',
18+
'browser',
19+
'cypress',
20+
'cypress.io',
21+
'e2e',
22+
'end-to-end',
23+
'integration',
24+
'component',
25+
'mocks',
26+
'runner',
27+
'spies',
28+
'stubs',
29+
'test',
30+
'testing',
3131
],
32-
"types": "types",
33-
"scripts": {
34-
"postinstall": "node index.js --exec install",
35-
"size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";"
36-
}
32+
'types': 'types',
33+
'scripts': {
34+
'postinstall': 'node index.js --exec install',
35+
'size': 't="$(npm pack .)"; wc -c "${t}"; tar tvf "${t}"; rm "${t}";',
36+
},
3737
}

cli/__snapshots__/cypress_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
exports['cypress .run resolves with contents of tmp file 1'] = {
2-
"code": 0,
3-
"failingTests": []
2+
'code': 0,
3+
'failingTests': [],
44
}

cli/__snapshots__/errors_spec.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ Cypress Version: 1.2.3
5050
`
5151

5252
exports['child kill error object'] = {
53-
"description": "The Test Runner unexpectedly exited via a [36mexit[39m event with signal [36mSIGKILL[39m",
54-
"solution": "Please search Cypress documentation for possible solutions:\n\n [34mhttps://on.cypress.io[39m\n\nCheck if there is a GitHub issue describing this crash:\n\n [34mhttps://github.com/cypress-io/cypress/issues[39m\n\nConsider opening a new issue."
53+
'description': 'The Test Runner unexpectedly exited via a [36mexit[39m event with signal [36mSIGKILL[39m',
54+
'solution': 'Please search Cypress documentation for possible solutions:\n\n [34mhttps://on.cypress.io[39m\n\nCheck if there is a GitHub issue describing this crash:\n\n [34mhttps://github.com/cypress-io/cypress/issues[39m\n\nConsider opening a new issue.',
5555
}
5656

5757
exports['Error message'] = `
@@ -74,29 +74,29 @@ Cypress Version: 1.2.3
7474
`
7575

7676
exports['errors individual has the following errors 1'] = [
77-
"CYPRESS_RUN_BINARY",
78-
"binaryNotExecutable",
79-
"childProcessKilled",
80-
"failedDownload",
81-
"failedUnzip",
82-
"failedUnzipWindowsMaxPathLength",
83-
"incompatibleHeadlessFlags",
84-
"incompatibleTestTypeFlags",
85-
"incompatibleTestingTypeAndFlag",
86-
"invalidCacheDirectory",
87-
"invalidConfigFile",
88-
"invalidCypressEnv",
89-
"invalidOS",
90-
"invalidRunProjectPath",
91-
"invalidSmokeTestDisplayError",
92-
"invalidTestingType",
93-
"missingApp",
94-
"missingDependency",
95-
"missingXvfb",
96-
"nonZeroExitCodeXvfb",
97-
"notInstalledCI",
98-
"smokeTestFailure",
99-
"unexpected",
100-
"unknownError",
101-
"versionMismatch"
77+
'CYPRESS_RUN_BINARY',
78+
'binaryNotExecutable',
79+
'childProcessKilled',
80+
'failedDownload',
81+
'failedUnzip',
82+
'failedUnzipWindowsMaxPathLength',
83+
'incompatibleHeadlessFlags',
84+
'incompatibleTestTypeFlags',
85+
'incompatibleTestingTypeAndFlag',
86+
'invalidCacheDirectory',
87+
'invalidConfigFile',
88+
'invalidCypressEnv',
89+
'invalidOS',
90+
'invalidRunProjectPath',
91+
'invalidSmokeTestDisplayError',
92+
'invalidTestingType',
93+
'missingApp',
94+
'missingDependency',
95+
'missingXvfb',
96+
'nonZeroExitCodeXvfb',
97+
'notInstalledCI',
98+
'smokeTestFailure',
99+
'unexpected',
100+
'unknownError',
101+
'versionMismatch',
102102
]

cli/__snapshots__/run_spec.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
exports['exec run .processRunOptions does not remove --record option when using --browser 1'] = [
2-
"--run-project",
2+
'--run-project',
33
null,
4-
"--browser",
5-
"test browser",
6-
"--record",
7-
"foo"
4+
'--browser',
5+
'test browser',
6+
'--record',
7+
'foo',
88
]
99

1010
exports['exec run .processRunOptions passes --browser option 1'] = [
11-
"--run-project",
11+
'--run-project',
1212
null,
13-
"--browser",
14-
"test browser"
13+
'--browser',
14+
'test browser',
1515
]
1616

1717
exports['exec run .processRunOptions passes --record option 1'] = [
18-
"--run-project",
18+
'--run-project',
1919
null,
20-
"--record",
21-
"my record id"
20+
'--record',
21+
'my record id',
2222
]
2323

2424
exports['exec run .processRunOptions defaults to e2e testingType 1'] = [
25-
"--run-project",
26-
null
25+
'--run-project',
26+
null,
2727
]

cli/__snapshots__/spawn_spec.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
exports['lib/exec/spawn .start forces colors and streams when supported 1'] = {
2-
"FORCE_COLOR": "1",
3-
"DEBUG_COLORS": "1",
4-
"MOCHA_COLORS": "1",
5-
"FORCE_STDIN_TTY": "1",
6-
"FORCE_STDOUT_TTY": "1",
7-
"FORCE_STDERR_TTY": "1"
2+
'FORCE_COLOR': '1',
3+
'DEBUG_COLORS': '1',
4+
'MOCHA_COLORS': '1',
5+
'FORCE_STDIN_TTY': '1',
6+
'FORCE_STDOUT_TTY': '1',
7+
'FORCE_STDERR_TTY': '1',
88
}
99

1010
exports['lib/exec/spawn .start does not force colors and streams when not supported 1'] = {
11-
"FORCE_COLOR": "0",
12-
"DEBUG_COLORS": "0",
13-
"FORCE_STDIN_TTY": "0",
14-
"FORCE_STDOUT_TTY": "0",
15-
"FORCE_STDERR_TTY": "0"
11+
'FORCE_COLOR': '0',
12+
'DEBUG_COLORS': '0',
13+
'FORCE_STDIN_TTY': '0',
14+
'FORCE_STDOUT_TTY': '0',
15+
'FORCE_STDERR_TTY': '0',
1616
}
1717

1818
exports['lib/exec/spawn .start detects kill signal exits with error on SIGKILL 1'] = `

cli/__snapshots__/util_spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
exports['config_as_object 1'] = {
2-
"config": "{\"baseUrl\":\"http://localhost:2000\",\"watchForFileChanges\":false}"
2+
'config': '{"baseUrl":"http://localhost:2000","watchForFileChanges":false}',
33
}
44

55
exports['env_as_object 1'] = {
6-
"env": "{\"foo\":\"bar\",\"magicNumber\":1234,\"host\":\"kevin.dev.local\"}"
6+
'env': '{"foo":"bar","magicNumber":1234,"host":"kevin.dev.local"}',
77
}
88

99
exports['env_as_string 1'] = {
10-
"env": "foo=bar"
10+
'env': 'foo=bar',
1111
}
1212

1313
exports['others_unchanged 1'] = {
14-
"foo": "bar"
14+
'foo': 'bar',
1515
}
1616

1717
exports['reporter_options_as_object 1'] = {
18-
"reporterOptions": "{\"mochaFile\":\"results/my-test-output.xml\",\"toConsole\":true}"
18+
'reporterOptions': '{"mochaFile":"results/my-test-output.xml","toConsole":true}',
1919
}
2020

2121
exports['spec_as_array 1'] = {
22-
"spec": "[\"a\",\"b\",\"c\"]"
22+
'spec': '["a","b","c"]',
2323
}
2424

2525
exports['spec_as_string 1'] = {
26-
"spec": "x,y,z"
26+
'spec': 'x,y,z',
2727
}

cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"test-unit": "yarn unit",
1717
"test-watch": "yarn unit --watch",
1818
"types": "yarn dtslint",
19+
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json,.vue .",
1920
"unit": "cross-env BLUEBIRD_DEBUG=1 NODE_ENV=test mocha --reporter mocha-multi-reporters --reporter-options configFile=../mocha-reporter-config.json"
2021
},
2122
"dependencies": {

0 commit comments

Comments
 (0)