Skip to content

Commit 720f550

Browse files
committed
Integrate Prettier with ESLint
1 parent 6cec1fc commit 720f550

4 files changed

Lines changed: 48 additions & 6 deletions

File tree

.eslintrc.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module.exports = {
22
env: {
3-
"shared-node-browser": true
3+
"shared-node-browser": true,
44
},
5-
extends: "airbnb-base",
5+
extends: ["airbnb-base", "plugin:prettier/recommended"],
66
globals: {
7-
document: true
7+
document: true,
88
},
99
rules: {
10-
"no-underscore-dangle": "off"
11-
}
10+
"no-underscore-dangle": "off",
11+
},
1212
};

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,17 @@
4646
"devDependencies": {
4747
"browserify": "~3.46.1",
4848
"eslint-config-airbnb-base": "^13.1.0",
49+
"eslint-config-prettier": "^3.1.0",
4950
"eslint-plugin-import": "^2.14.0",
51+
"eslint-plugin-prettier": "^3.0.0",
5052
"grunt": "~0.4.5",
5153
"grunt-browserify": "~1.3.2",
5254
"grunt-cli": "~0.1.13",
5355
"grunt-contrib-uglify": "~0.7.0",
5456
"grunt-contrib-watch": "~0.6.1",
5557
"jest": "^23.6.0",
56-
"jest-runner-eslint": "^0.6.0"
58+
"jest-runner-eslint": "^0.6.0",
59+
"prettier": "^1.14.3"
5760
},
5861
"engines": {
5962
"node": "*"

prettier.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
trailingComma: "es5",
3+
};

yarn.lock

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,13 @@ eslint-config-airbnb-base@^13.1.0:
13601360
object.assign "^4.1.0"
13611361
object.entries "^1.0.4"
13621362

1363+
eslint-config-prettier@^3.1.0:
1364+
version "3.1.0"
1365+
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-3.1.0.tgz#2c26d2cdcfa3a05f0642cd7e6e4ef3316cdabfa2"
1366+
integrity sha512-QYGfmzuc4q4J6XIhlp8vRKdI/fI0tQfQPy1dME3UOLprE+v4ssH/3W9LM2Q7h5qBcy5m0ehCrBDU2YF8q6OY8w==
1367+
dependencies:
1368+
get-stdin "^6.0.0"
1369+
13631370
eslint-import-resolver-node@^0.3.1:
13641371
version "0.3.2"
13651372
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a"
@@ -1392,6 +1399,13 @@ eslint-plugin-import@^2.14.0:
13921399
read-pkg-up "^2.0.0"
13931400
resolve "^1.6.0"
13941401

1402+
eslint-plugin-prettier@^3.0.0:
1403+
version "3.0.0"
1404+
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.0.tgz#f6b823e065f8c36529918cdb766d7a0e975ec30c"
1405+
integrity sha512-4g11opzhqq/8+AMmo5Vc2Gn7z9alZ4JqrbZ+D4i8KlSyxeQhZHlmIrY8U9Akf514MoEhogPa87Jgkq87aZ2Ohw==
1406+
dependencies:
1407+
prettier-linter-helpers "^1.0.0"
1408+
13951409
eslint-restricted-globals@^0.1.1:
13961410
version "0.1.1"
13971411
resolved "https://registry.yarnpkg.com/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz#35f0d5cbc64c2e3ed62e93b4b1a7af05ba7ed4d7"
@@ -1669,6 +1683,11 @@ fast-deep-equal@^1.0.0:
16691683
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614"
16701684
integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=
16711685

1686+
fast-diff@^1.1.2:
1687+
version "1.1.2"
1688+
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154"
1689+
integrity sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==
1690+
16721691
fast-json-stable-stringify@^2.0.0:
16731692
version "2.0.0"
16741693
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
@@ -1882,6 +1901,11 @@ get-stdin@^4.0.1:
18821901
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
18831902
integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=
18841903

1904+
get-stdin@^6.0.0:
1905+
version "6.0.0"
1906+
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b"
1907+
integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==
1908+
18851909
get-stream@^3.0.0:
18861910
version "3.0.0"
18871911
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
@@ -4052,6 +4076,18 @@ preserve@^0.2.0:
40524076
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
40534077
integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=
40544078

4079+
prettier-linter-helpers@^1.0.0:
4080+
version "1.0.0"
4081+
resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
4082+
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
4083+
dependencies:
4084+
fast-diff "^1.1.2"
4085+
4086+
prettier@^1.14.3:
4087+
version "1.14.3"
4088+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895"
4089+
integrity sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg==
4090+
40554091
pretty-bytes@^1.0.0:
40564092
version "1.0.4"
40574093
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-1.0.4.tgz#0a22e8210609ad35542f8c8d5d2159aff0751c84"

0 commit comments

Comments
 (0)