Skip to content

Commit 518d1e0

Browse files
committed
replace js-beautify with prettier
1 parent 4c25bfb commit 518d1e0

File tree

5 files changed

+45
-102
lines changed

5 files changed

+45
-102
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ max_line_length = 233
1212
indent_style = space
1313
indent_size = 2
1414

15+
[.prettierrc]
16+
indent_style = space
17+
indent_size = 2
18+
1519
[*.yml]
1620
indent_style = space
1721
indent_size = 2

.eslintrc.js

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module.exports = {
22
"root": true,
3-
"plugins": ["node"],
3+
"plugins": [
4+
"prettier",
5+
"node"
6+
],
47
"extends": ["eslint:recommended", "plugin:node/recommended"],
58
"env": {
69
"node": true,
@@ -9,7 +12,7 @@ module.exports = {
912
},
1013
"parserOptions": { "ecmaVersion": 2017 },
1114
"rules": {
12-
"quotes": ["error", "double"],
15+
"prettier/prettier": "error",
1316
"no-undef": "error",
1417
"no-extra-semi": "error",
1518
"semi": "error",
@@ -21,36 +24,12 @@ module.exports = {
2124
"brace-style": "error",
2225
"eol-last": "error",
2326
"no-extra-bind": "warn",
24-
"no-empty": "off",
25-
"no-multiple-empty-lines": "error",
26-
"no-multi-spaces": "error",
2727
"no-process-exit": "warn",
28-
"space-in-parens": "error",
29-
"no-trailing-spaces": "error",
3028
"no-use-before-define": "off",
3129
"no-unused-vars": ["error", { "args": "none" }],
32-
"key-spacing": "error",
33-
"space-infix-ops": "error",
3430
"no-unsafe-negation": "error",
3531
"no-loop-func": "warn",
36-
"space-before-function-paren": ["error", "never"],
37-
"space-before-blocks": "error",
38-
"object-curly-spacing": ["error", "always"],
3932
"indent": "off",
40-
"keyword-spacing": ["error", {
41-
"after": false,
42-
"overrides": {
43-
"const": { "after": true },
44-
"try": { "after": true },
45-
"else": { "after": true },
46-
"throw": { "after": true },
47-
"case": { "after": true },
48-
"return": { "after": true },
49-
"finally": { "after": true },
50-
"do": { "after": true },
51-
"of": { "after": true }
52-
}
53-
}],
5433
"no-console": "off",
5534
"valid-jsdoc": "error",
5635
"node/no-unsupported-features": "error",

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": true
4+
}

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"webpack-sources": "^1.0.1"
2727
},
2828
"devDependencies": {
29-
"beautify-lint": "^1.0.3",
3029
"benchmark": "^2.1.1",
3130
"bundle-loader": "~0.5.0",
3231
"codacy-coverage": "^2.0.1",
@@ -37,20 +36,21 @@
3736
"es6-promise-polyfill": "^1.1.1",
3837
"eslint": "^4.3.0",
3938
"eslint-plugin-node": "^5.1.1",
39+
"eslint-plugin-prettier": "^2.3.1",
4040
"express": "~4.13.1",
4141
"file-loader": "^1.1.6",
4242
"glob": "^7.1.2",
4343
"i18n-webpack-plugin": "^1.0.0",
4444
"istanbul": "^0.4.5",
4545
"jade": "^1.11.0",
4646
"jade-loader": "~0.8.0",
47-
"js-beautify": "^1.5.10",
4847
"json-loader": "^0.5.7",
4948
"less": "^2.5.1",
5049
"less-loader": "^4.0.3",
5150
"lodash": "^4.17.4",
5251
"mocha": "^3.2.0",
5352
"mocha-lcov-reporter": "^1.0.0",
53+
"prettier": "^1.8.2",
5454
"raw-loader": "~0.5.0",
5555
"react": "^15.2.1",
5656
"react-dom": "^15.2.1",
@@ -101,10 +101,10 @@
101101
"circleci:lint": "npm run lint-files",
102102
"build:examples": "cd examples && node buildAll.js",
103103
"pretest": "npm run lint-files",
104-
"lint-files": "npm run lint && npm run beautify-lint && npm run schema-lint",
104+
"lint-files": "npm run lint && npm run schema-lint",
105105
"lint": "eslint lib bin hot buildin \"test/*.js\" \"test/**/webpack.config.js\" \"examples/**/webpack.config.js\"",
106106
"fix": "npm run lint -- --fix",
107-
"beautify-lint": "beautify-lint \"lib/**/*.js\" \"hot/**/*.js\" \"bin/**/*.js\" \"benchmark/*.js\" \"test/*.js\" \"test/**/webpack.config.js\" \"examples/**/webpack.config.js\"",
107+
"pretty-files": "prettier \"lib/**.*\" \"bin/**.*\" \"hot/**.*\" \"buildin/**.*\" \"test/*.js\" \"test/**/webpack.config.js\" \"examples/**/webpack.config.js\" --write",
108108
"schema-lint": "mocha test/*.lint.js --opts test/lint-mocha.opts",
109109
"benchmark": "mocha --max-old-space-size=4096 --harmony --trace-deprecation test/*.benchmark.js -R spec",
110110
"cover": "npm run cover:init && npm run cover:all && npm run cover:report",
@@ -114,6 +114,6 @@
114114
"cover:unit": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover --report none node_modules/mocha/bin/_mocha -- test/*.unittest.js",
115115
"cover:report": "istanbul report",
116116
"cover:report-min": "istanbul report --report lcovonly",
117-
"publish-patch": "npm run lint && npm run beautify-lint && mocha && npm version patch && git push && git push --tags && npm publish"
117+
"publish-patch": "npm run lint && mocha && npm version patch && git push && git push --tags && npm publish"
118118
}
119119
}

yarn.lock

Lines changed: 27 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ async-each@^1.0.0:
244244
version "1.0.1"
245245
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d"
246246

247-
async@1.x, async@^1.4.0, async@^1.5.0:
247+
async@1.x, async@^1.4.0:
248248
version "1.5.2"
249249
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
250250

@@ -323,15 +323,6 @@ bcrypt-pbkdf@^1.0.0:
323323
dependencies:
324324
tweetnacl "^0.14.3"
325325

326-
beautify-lint@^1.0.3:
327-
version "1.0.4"
328-
resolved "https://registry.yarnpkg.com/beautify-lint/-/beautify-lint-1.0.4.tgz#954b10f0bcd0a93dd17d0ed519b8996b701247db"
329-
dependencies:
330-
async "^1.5.0"
331-
diff "^2.2.1"
332-
glob "^6.0.1"
333-
js-beautify "^1.5.10"
334-
335326
benchmark@^2.1.1:
336327
version "2.1.4"
337328
resolved "https://registry.yarnpkg.com/benchmark/-/benchmark-2.1.4.tgz#09f3de31c916425d498cc2ee565a0ebf3c2a5629"
@@ -357,7 +348,7 @@ bluebird@^2.3, bluebird@^2.9.x:
357348
version "2.11.0"
358349
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1"
359350

360-
bluebird@^3.0.5, bluebird@^3.5.0:
351+
bluebird@^3.5.0:
361352
version "3.5.1"
362353
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
363354

@@ -811,13 +802,6 @@ concat-stream@^1.5.0, concat-stream@^1.6.0:
811802
readable-stream "^2.2.2"
812803
typedarray "^0.0.6"
813804

814-
config-chain@~1.1.5:
815-
version "1.1.11"
816-
resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.11.tgz#aba09747dfbe4c3e70e766a6e41586e1859fc6f2"
817-
dependencies:
818-
ini "^1.3.4"
819-
proto-list "~1.2.1"
820-
821805
console-browserify@^1.1.0:
822806
version "1.1.0"
823807
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10"
@@ -1176,10 +1160,6 @@ diff@3.2.0:
11761160
version "3.2.0"
11771161
resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9"
11781162

1179-
diff@^2.2.1:
1180-
version "2.2.3"
1181-
resolved "https://registry.yarnpkg.com/diff/-/diff-2.2.3.tgz#60eafd0d28ee906e4e8ff0a52c1229521033bf99"
1182-
11831163
diff@^3.1.0:
11841164
version "3.4.0"
11851165
resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c"
@@ -1217,16 +1197,6 @@ ecc-jsbn@~0.1.1:
12171197
dependencies:
12181198
jsbn "~0.1.0"
12191199

1220-
editorconfig@^0.13.2:
1221-
version "0.13.3"
1222-
resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.13.3.tgz#e5219e587951d60958fd94ea9a9a008cdeff1b34"
1223-
dependencies:
1224-
bluebird "^3.0.5"
1225-
commander "^2.9.0"
1226-
lru-cache "^3.2.0"
1227-
semver "^5.1.0"
1228-
sigmund "^1.0.1"
1229-
12301200
ee-first@1.1.1:
12311201
version "1.1.1"
12321202
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
@@ -1315,6 +1285,13 @@ eslint-plugin-node@^5.1.1:
13151285
resolve "^1.3.3"
13161286
semver "5.3.0"
13171287

1288+
eslint-plugin-prettier@^2.3.1:
1289+
version "2.3.1"
1290+
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.3.1.tgz#e7a746c67e716f335274b88295a9ead9f544e44d"
1291+
dependencies:
1292+
fast-diff "^1.1.1"
1293+
jest-docblock "^21.0.0"
1294+
13181295
eslint-scope@^3.7.1:
13191296
version "3.7.1"
13201297
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"
@@ -1533,6 +1510,10 @@ fast-deep-equal@^1.0.0:
15331510
version "1.0.0"
15341511
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff"
15351512

1513+
fast-diff@^1.1.1:
1514+
version "1.1.2"
1515+
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154"
1516+
15361517
fast-json-stable-stringify@^2.0.0:
15371518
version "2.0.0"
15381519
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
@@ -1812,16 +1793,6 @@ glob@^5.0.15:
18121793
once "^1.3.0"
18131794
path-is-absolute "^1.0.0"
18141795

1815-
glob@^6.0.1:
1816-
version "6.0.4"
1817-
resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22"
1818-
dependencies:
1819-
inflight "^1.0.4"
1820-
inherits "2"
1821-
minimatch "2 || 3"
1822-
once "^1.3.0"
1823-
path-is-absolute "^1.0.0"
1824-
18251796
glob@^7.0.3, glob@^7.0.5, glob@^7.1.2:
18261797
version "7.1.2"
18271798
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
@@ -2102,9 +2073,9 @@ inherits@2.0.1:
21022073
version "2.0.1"
21032074
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1"
21042075

2105-
ini@^1.3.4, ini@~1.3.0:
2106-
version "1.3.5"
2107-
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
2076+
ini@~1.3.0:
2077+
version "1.3.4"
2078+
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e"
21082079

21092080
inquirer@^3.0.6:
21102081
version "3.3.0"
@@ -2399,6 +2370,10 @@ jade@^1.11.0:
23992370
void-elements "~2.0.1"
24002371
with "~4.0.0"
24012372

2373+
jest-docblock@^21.0.0:
2374+
version "21.2.0"
2375+
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414"
2376+
24022377
joi@^6.4.x:
24032378
version "6.10.1"
24042379
resolved "https://registry.yarnpkg.com/joi/-/joi-6.10.1.tgz#4d50c318079122000fe5f16af1ff8e1917b77e06"
@@ -2412,15 +2387,6 @@ js-base64@^2.1.9:
24122387
version "2.4.0"
24132388
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.0.tgz#9e566fee624751a1d720c966cd6226d29d4025aa"
24142389

2415-
js-beautify@^1.5.10:
2416-
version "1.7.5"
2417-
resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.7.5.tgz#69d9651ef60dbb649f65527b53674950138a7919"
2418-
dependencies:
2419-
config-chain "~1.1.5"
2420-
editorconfig "^0.13.2"
2421-
mkdirp "~0.5.0"
2422-
nopt "~3.0.1"
2423-
24242390
js-tokens@^3.0.0, js-tokens@^3.0.2:
24252391
version "3.0.2"
24262392
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
@@ -2687,12 +2653,6 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
26872653
dependencies:
26882654
js-tokens "^3.0.0"
26892655

2690-
lru-cache@^3.2.0:
2691-
version "3.2.0"
2692-
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-3.2.0.tgz#71789b3b7f5399bec8565dda38aa30d2a097efee"
2693-
dependencies:
2694-
pseudomap "^1.0.1"
2695-
26962656
lru-cache@^4.0.1, lru-cache@^4.1.1:
26972657
version "4.1.1"
26982658
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55"
@@ -3005,7 +2965,7 @@ node-pre-gyp@^0.6.39:
30052965
tar "^2.2.1"
30062966
tar-pack "^3.4.0"
30072967

3008-
nopt@3.x, nopt@~3.0.1:
2968+
nopt@3.x:
30092969
version "3.0.6"
30102970
resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
30112971
dependencies:
@@ -3547,6 +3507,10 @@ preserve@^0.2.0:
35473507
version "0.2.0"
35483508
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
35493509

3510+
prettier@^1.8.2:
3511+
version "1.8.2"
3512+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.8.2.tgz#bff83e7fd573933c607875e5ba3abbdffb96aeb8"
3513+
35503514
process-nextick-args@~1.0.6:
35513515
version "1.0.7"
35523516
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
@@ -3589,10 +3553,6 @@ prop-types@^15.5.10:
35893553
loose-envify "^1.3.1"
35903554
object-assign "^4.1.1"
35913555

3592-
proto-list@~1.2.1:
3593-
version "1.2.4"
3594-
resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849"
3595-
35963556
proxy-addr@~1.0.10:
35973557
version "1.0.10"
35983558
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.0.10.tgz#0d40a82f801fc355567d2ecb65efe3f077f121c5"
@@ -3604,7 +3564,7 @@ prr@~1.0.1:
36043564
version "1.0.1"
36053565
resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476"
36063566

3607-
pseudomap@^1.0.1, pseudomap@^1.0.2:
3567+
pseudomap@^1.0.2:
36083568
version "1.0.2"
36093569
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
36103570

@@ -4024,7 +3984,7 @@ semver@5.3.0:
40243984
version "5.3.0"
40253985
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
40263986

4027-
semver@^5.1.0, semver@^5.3.0:
3987+
semver@^5.3.0:
40283988
version "5.4.1"
40293989
resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"
40303990

@@ -4165,10 +4125,6 @@ should@^11.1.1:
41654125
should-type-adaptors "^1.0.1"
41664126
should-util "^1.0.0"
41674127

4168-
sigmund@^1.0.1:
4169-
version "1.0.1"
4170-
resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590"
4171-
41724128
signal-exit@^3.0.0, signal-exit@^3.0.2:
41734129
version "3.0.2"
41744130
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"

0 commit comments

Comments
 (0)