Skip to content

Commit

Permalink
temp 07/01/19 [skip ci] main lint files
Browse files Browse the repository at this point in the history
  • Loading branch information
kuceb committed Jul 1, 2019
1 parent c13e94a commit 458aede
Show file tree
Hide file tree
Showing 49 changed files with 563 additions and 472 deletions.
27 changes: 24 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
__snapshots__
# unignore hidden files
!.*

**/__snapshots__
**/build
**/cypress/fixtures
**/dist
**/dist-test
**/node_modules
**/support/fixtures
**/test/fixtures
**/vendor

# cli/types is linted by tslint/dtslint
cli/types
# packages/example is not linted (think about changing this)
packages/example

packages/extension/test/helpers/background.js
packages/server/lib/scaffold/plugins/index.js
packages/server/lib/scaffold/support/index.js
packages/server/lib/scaffold/support/commands.js
packages/server/test/fixtures
packages/example/cypress

packages/launcher/lib/**/*.js

**/package-lock.json
**/tsconfig.json
73 changes: 5 additions & 68 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,72 +1,9 @@
{
"plugins": [
"@cypress/dev"
],
"extends": [
"plugin:cypress-dev/general"
"plugin:@cypress/dev/general"
],
"rules": {
"no-multiple-empty-lines": ["error", { "max": 1 } ],
"no-else-return": [ "error", { "allowElseIf": false } ],
"brace-style": ["error", "1tbs", { "allowSingleLine": false }],
"no-unneeded-ternary": ["error"],
"array-bracket-newline": ["error", "consistent"],
"arrow-body-style": ["error", "always"],
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": "*",
"next": "return"
},
{
"blankLine": "always",
"prev": [
"const",
"let",
"var",
"if",
"while",
"export",
"cjs-export",
"import",
"cjs-import"
],
"next": "*"
},
{
"blankLine": "any",
"prev": [
"const",
"let",
"var",
"import",
"cjs-import"
],
"next": [
"const",
"let",
"var",
"import",
"cjs-import"
]
}
]
},
"env": {
"es6": true,
"node": true
},
"parserOptions": {
"ecmaFeatures": {
"legacyDecorators": true
}
},
"overrides": [
{
"files": [
"**/*.jsx"
],
"rules": {
"arrow-body-style": "off"
}
}
]
"rules": {}
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ _test-output
cypress.zip
tmp/
.nyc_output
.vscode/settings.json

# from extension
Cached Theme.pak
Expand Down
28 changes: 28 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"eslint.autoFixOnSave": true,
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "typescript",
"autoFix": true
},
{
"language": "typescriptreact",
"autoFix": true
},
{
"language": "json",
"autoFix": true
},
{
"language": "coffeescript",
"autoFix": false
}
],
"eslint.options": {
"rules": {
"no-debugger": "off"
}
}
}
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--ignore-engines true
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,16 @@ DEBUG=cypress:launcher
### Coding Style

We use [eslint](https://eslint.org/) to lint all JavaScript code and follow rules specified in
[eslint-plugin-cypress-dev](https://github.com/cypress-io/eslint-plugin-cypress-dev) plugin.
[@cypress/eslint-plugin-dev](https://github.com/cypress-io/cypress-eslint-plugin-dev) plugin.

When you edit files, you can quickly fix all changed files before committing using
When you edit files, you can quickly fix all changed files before you commit using

```bash
npm run lint-changed
npm run lint-changed-fix
```

When committing files, we run Git pre-commit hook to fix the staged JS files. See the `precommit-lint` script in [package.json](package.json). This might change JS files and you would need to commit the changes again.
When committing files, we run a Git pre-commit hook to lint the staged JS files. See the `lint-staged` script in [package.json](package.json).
If this command fails, you may need to run `npm run lint-changed-fix` and commit those changes.

### Tests

Expand Down
5 changes: 2 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ jobs:
- attach_workspace:
at: ~/
- run: npm run lint
- run: npm run all lint

unit-tests:
<<: *defaults
Expand Down Expand Up @@ -237,7 +236,7 @@ jobs:
- store_test_results:
path: /tmp/cypress

lint-typescript:
lint-types:
<<: *defaults
parallelism: 1
steps:
Expand Down Expand Up @@ -717,7 +716,7 @@ linux-workflow: &linux-workflow
name: Linux lint
requires:
- build
- lint-typescript:
- lint-types:
requires:
- build
# unit, integration and e2e tests
Expand Down
53 changes: 26 additions & 27 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
{
"name": "cypress",
"version": "0.0.0",
"main": "index.js",
"private": true,
"bin": {
"cypress": "bin/cypress"
},
"engines": {
"node": ">=4.0.0"
},
"files": [
"bin",
"lib",
"index.js",
"types/**/*.d.ts"
],
"main": "index.js",
"scripts": {
"prebuild": "npm run test-dependencies && node ./scripts/start-build.js",
"build": "node ./scripts/build.js",
"check-deps": "node ../scripts/check-deps.js --verbose",
"check-deps-pre": "npm run check-deps -- --prescript",
"dtslint": "dtslint types",
"postinstall": "node ./scripts/post-install.js",
"prerelease": "npm run build",
"release": "cd build && releaser --no-node --no-changelog",
"size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";",
"pretest": "npm run check-deps-pre",
"test": "npm run test-unit",
"test-debug": "node --inspect --debug-brk $(bin-up _mocha)",
"test-dependencies": "npm run check-deps && dependency-check . --no-dev",
"pretest-unit": "npm run check-deps-pre",
"test-unit": "npm run unit",
"pretest-watch": "npm run check-deps-pre",
"test-watch": "npm run unit -- --watch",
"check-deps": "node ../scripts/check-deps.js --verbose",
"check-deps-pre": "npm run check-deps -- --prescript",
"test-dependencies": "npm run check-deps && dependency-check . --no-dev",
"test-debug": "node --inspect --debug-brk $(bin-up _mocha)",
"unit": "BLUEBIRD_DEBUG=1 NODE_ENV=test bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../mocha-reporter-config.json",
"lint": "bin-up eslint --fix *.js scripts/*.js bin/* lib/*.js lib/**/*.js test/*.js test/**/*.js",
"dtslint": "dtslint types",
"prebuild": "npm run test-dependencies && node ./scripts/start-build.js",
"build": "node ./scripts/build.js",
"prerelease": "npm run build",
"release": "cd build && releaser --no-node --no-changelog",
"size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";"
"unit": "BLUEBIRD_DEBUG=1 NODE_ENV=test bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../mocha-reporter-config.json"
},
"types": "types",
"dependencies": {
"@cypress/listr-verbose-renderer": "0.4.1",
"@cypress/xvfb": "1.2.4",
Expand Down Expand Up @@ -58,7 +56,7 @@
"moment": "2.24.0",
"ramda": "0.24.1",
"request": "2.88.0",
"request-progress": "3.0.0",
"request-progress": "0.4.0",
"supports-color": "5.5.0",
"tmp": "0.1.0",
"url": "0.11.0",
Expand Down Expand Up @@ -94,10 +92,11 @@
"snap-shot-it": "7.7.1",
"spawn-mock": "1.0.0"
},
"files": [
"bin",
"lib",
"index.js",
"types/**/*.d.ts"
]
"bin": {
"cypress": "bin/cypress"
},
"types": "types",
"engines": {
"node": ">=4.0.0"
}
}
Loading

0 comments on commit 458aede

Please sign in to comment.