Skip to content

Commit 42250f8

Browse files
bahmutovkuceb
andauthored
Update to the current Cypress Eslint plugin (cypress-io#394)
* update eslint cypress plugin * add lint ci job * fix many eslint errors * more fixes * more fixes * link linter from development doc * fix circleci file * more linting * add a couple of folders that do not lint to eslint ignore file * Update .eslintignore Co-Authored-By: Ben Kucera <[email protected]> * fix application actions linting * add more settings Co-authored-by: Ben Kucera <[email protected]>
1 parent 33dab4d commit 42250f8

File tree

53 files changed

+1550
-959
lines changed

Some content is hidden

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

53 files changed

+1550
-959
lines changed

Diff for: .eslintignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
examples/blogs__e2e-snapshots/snapshots.js
2+
examples/blogs__element-coverage/src
3+
examples/preprocessors__typescript-webpack/dist
4+
node_modules
5+
**/vendor
6+
# don't ignore hidden files, useful for formatting json config files
7+
!.*

Diff for: .eslintrc

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
2+
"plugins": [
3+
"@cypress/dev"
4+
],
25
"extends": [
3-
"plugin:cypress-dev/general",
4-
"plugin:cypress-dev/tests"
6+
"plugin:@cypress/dev/general",
7+
"plugin:@cypress/dev/tests"
58
],
69
"env": {
710
"node": true

Diff for: Development.md

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
- there is a script [test-examples.js](test-examples.js) useful to run all examples one by one
55
* note that the script only runs an example if it has `npm run test:ci` script command.
66

7+
### Linting
8+
9+
Many recipes are linted using [@cypress/eslint-plugin-dev](https://github.com/cypress-io/eslint-plugin-dev). You can lint a single folder or lint and auto-fix with:
10+
11+
```shell
12+
$ npx eslint examples/blogs__vue-vuex-rest/cypress
13+
$ npx eslint examples/blogs__vue-vuex-rest/cypress --fix
14+
```
15+
716
### Testing in specific browser
817

918
You can test some examples using a specific browser. For example, to run just some folders using Brave browser, call

Diff for: circle.yml

+26-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,28 @@ jobs:
7272
- app
7373
- .cache/Cypress
7474

75+
lint:
76+
working_directory: ~/app
77+
docker:
78+
- image: cypress/base:10
79+
steps:
80+
- attach_workspace:
81+
at: ~/
82+
- run: |
83+
npx eslint examples/blogs__a11y \
84+
examples/blogs__application-actions \
85+
examples/blogs__codepen-demo \
86+
examples/blogs__direct-control-angular \
87+
examples/blogs__e2e-api-testing \
88+
examples/blogs__e2e-snapshots \
89+
examples/blogs__element-coverage \
90+
examples/blogs__testing-redux-store/cypress \
91+
examples/blogs__vue-vuex-rest/cypress \
92+
examples/preprocessors__grep \
93+
examples/preprocessors__typescript-browserify \
94+
examples/preprocessors__typescript-webpack \
95+
examples/unit-testing__react
96+
7597
# dummy job running after all end-to-end tests
7698
after-tests:
7799
docker:
@@ -223,14 +245,16 @@ jobs:
223245
# and then use this list from workflow definition
224246
all_jobs: &all_jobs
225247
- build
248+
- lint:
249+
requires:
250+
- build
226251
- test-examples:
227252
requires:
228253
- build
229254
filters:
230255
branches:
231256
only:
232257
- master
233-
- allow-testing-in-chunks
234258

235259
- test-examples-chrome:
236260
requires:
@@ -398,6 +422,7 @@ all_jobs: &all_jobs
398422
- after-tests:
399423
requires:
400424
- build
425+
- lint
401426
- blogs__a11y
402427
- blogs__application-actions
403428
- blogs__direct-control-angular

Diff for: examples/blogs__a11y/cypress/integration/failing-spec.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ describe('A11y fails', () => {
88
cy.contains('p', 'hard to read')
99
})
1010

11-
// skip this test on purpose - if you enable it
12-
// it will fail with color contrast error
11+
// NOTE: skip this test on purpose - enable to see failing color contrast check
1312
it.skip('does not pass accessibility check', () => {
1413
cy.contains('p', 'hard to read')
1514
cy.injectAxe()

0 commit comments

Comments
 (0)