mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-22 06:59:30 -06:00
Decaffeinate helper scripts (#4781)
* decaf script setup * update gitignore * fix conflicts, remove decaffeinate script hooks Co-authored-by: Brian Mann <brian.mann86@gmail.com>
This commit is contained in:
13
.eslintrc.decaffeinate.js
Normal file
13
.eslintrc.decaffeinate.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const _ = require('lodash')
|
||||
const baseConfig = require('./.eslintrc.json')
|
||||
|
||||
module.exports = _.defaultsDeep({}, baseConfig, {
|
||||
rules: {
|
||||
// auto-fix removing some common unnecessary returns
|
||||
'@cypress/dev/no-return-before': 'error',
|
||||
// make sure we use arrow callback
|
||||
'prefer-arrow-callback': 'error',
|
||||
// since our jscodemod scripts will format one-line-body functions as single line
|
||||
'arrow-body-style': ['error', 'always'],
|
||||
},
|
||||
})
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -64,3 +64,6 @@ scripts/support
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
binary-url.json
|
||||
|
||||
# Allows us to dynamically create eslint rules that override the default for Decaffeinate scripts
|
||||
.eslintrc.js
|
||||
|
||||
18
.vscode/tasks.json
vendored
18
.vscode/tasks.json
vendored
@@ -6,7 +6,13 @@
|
||||
{
|
||||
"label": "decaffeinate-bulk file",
|
||||
"type": "shell",
|
||||
"command": "npm run decaffeinate-bulk -- --file ${file} convert",
|
||||
"command": "npm run decaffeinate-bulk -- convert --file ${file}",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "decaffeinate-bulk multiple files",
|
||||
"type": "shell",
|
||||
"command": "npm run decaffeinate-bulk -- convert --file ${file} ${file}",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
@@ -14,16 +20,6 @@
|
||||
"type": "shell",
|
||||
"command": "npm run decaffeinate-bulk -- --dir ${fileDirname} convert",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "decaffeinate",
|
||||
"type": "shell",
|
||||
"command": "npm run decaffeinate -- ${file}"
|
||||
},
|
||||
{
|
||||
"label": "jscodeshift",
|
||||
"type": "shell",
|
||||
"command": "npm run jscodeshift -- ${file}"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -25,8 +25,9 @@
|
||||
"cypress:run": "node ./cli/bin/cypress run --dev",
|
||||
"cypress:run:debug": "node ./scripts/debug.js cypress:run",
|
||||
"cypress:verify": "node ./cli/bin/cypress verify --dev",
|
||||
"decaffeinate": "decaffeinate --use-cs2 --loose",
|
||||
"predecaffeinate-bulk": "shx cp .eslintrc.decaffeinate.js .eslintrc.js",
|
||||
"decaffeinate-bulk": "bulk-decaffeinate",
|
||||
"postdecaffeinate-bulk": "shx rm .eslintrc.js",
|
||||
"dev": "node ./scripts/start.js",
|
||||
"dev-debug": "node ./scripts/debug.js dev",
|
||||
"docker": "./scripts/run-docker-local.sh",
|
||||
|
||||
Reference in New Issue
Block a user