Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Commit f981cc8

Browse files
committed
use prettier-eslint
1 parent 6dbd3fa commit f981cc8

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

index.js

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ const defaultOptions = {
1414
{
1515
test: /\.jsx?$/,
1616
exclude: [/node_modules/],
17-
use: [{
18-
loader: require.resolve('babel-loader'),
19-
options: {
20-
presets: [
21-
'babel-preset-env',
22-
'babel-preset-react',
23-
].map(require.resolve),
17+
use: [
18+
{
19+
loader: require.resolve('babel-loader'),
20+
options: {
21+
presets: ['babel-preset-env', 'babel-preset-react'].map(
22+
require.resolve
23+
),
24+
},
2425
},
25-
}],
26+
],
2627
},
2728
],
2829
},
@@ -62,8 +63,16 @@ const preprocessor = (options = {}) => {
6263
}
6364

6465
// user can override the default options
65-
let webpackOptions = Object.assign({}, defaultOptions.webpackOptions, options.webpackOptions)
66-
let watchOptions = Object.assign({}, defaultOptions.watchOptions, options.watchOptions)
66+
let webpackOptions = Object.assign(
67+
{},
68+
defaultOptions.webpackOptions,
69+
options.webpackOptions
70+
)
71+
let watchOptions = Object.assign(
72+
{},
73+
defaultOptions.watchOptions,
74+
options.watchOptions
75+
)
6776

6877
// we're provided a default output path that lives alongside Cypress's
6978
// app data files so we don't have to worry about where to put the bundled
@@ -140,9 +149,9 @@ const preprocessor = (options = {}) => {
140149
log('watching')
141150
}
142151

143-
const bundler = file.shouldWatch ?
144-
compiler.watch(watchOptions, handle) :
145-
compiler.run(handle)
152+
const bundler = file.shouldWatch
153+
? compiler.watch(watchOptions, handle)
154+
: compiler.run(handle)
146155

147156
// when the spec or project is closed, we need to clean up the cached
148157
// bundle promise and stop the watcher via `bundler.close()`

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"ban": "ban",
2828
"deps": "deps-ok && dependency-check --no-dev .",
2929
"license": "license-checker --production --onlyunknown --csv",
30-
"lint": "eslint --fix *.js",
30+
"lint": "prettier-eslint --write '*.js'",
31+
"pretest": "npm run lint",
3132
"secure": "nsp check",
3233
"size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";",
3334
"test": "mocha",
@@ -43,13 +44,14 @@
4344
"deps-ok": "1.2.1",
4445
"dont-crack": "1.2.1",
4546
"eslint": "4.6.1",
46-
"eslint-plugin-cypress-dev": "1.0.0",
47+
"eslint-plugin-cypress-dev": "1.0.2",
4748
"eslint-plugin-mocha": "4.11.0",
4849
"github-post-release": "1.13.1",
4950
"license-checker": "13.0.3",
5051
"mocha": "3.5.0",
5152
"mockery": "2.1.0",
5253
"nsp": "2.7.0",
54+
"prettier-eslint-cli": "4.4.0",
5355
"semantic-release": "8.2.0",
5456
"simple-commit-message": "3.3.1",
5557
"sinon": "3.2.1",

0 commit comments

Comments
 (0)