Skip to content

Commit fb8efed

Browse files
committed
Add prettier config to eslint
1 parent 20c7490 commit fb8efed

File tree

5 files changed

+42
-7
lines changed

5 files changed

+42
-7
lines changed

.eslintrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"parser": "babel-eslint",
3-
"plugins": ["flowtype", "react"],
3+
"plugins": ["flowtype", "react", "prettier"],
44
"env": {
55
"node": true,
66
"es6": true
77
},
8+
"rules": {
9+
"prettier/prettier": "error"
10+
},
811
"extends": ["eslint:recommended", "plugin:react/recommended"]
912
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@
5858
"babel-register": "^6.24.1",
5959
"eslint": "^4.1.0",
6060
"eslint-plugin-flowtype": "^2.36.0",
61+
"eslint-plugin-prettier": "^2.3.1",
6162
"eslint-plugin-react": "^7.0.1",
6263
"faucet": "0.0.1",
6364
"flow-bin": "^0.56.0",
6465
"isparta": "^4.0.0",
66+
"prettier": "^1.7.2",
6567
"react": "^16.0.0",
6668
"react-dom": "^16.0.0",
6769
"react-test-renderer": "^16.0.0",

test/loader.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,16 @@ test("should not convert data-* and aria-* props", function(t) {
126126
})
127127
.then(component => render(React.createElement(component)))
128128
.then(r => {
129-
t.notEqual(Object.keys(r.props).indexOf("data-foo"), -1, "data-* shouldn't be camelCased");
130-
t.notEqual(Object.keys(r.props).indexOf("aria-label"), -1, "aria-* shouldn't be camelCased");
129+
t.notEqual(
130+
Object.keys(r.props).indexOf("data-foo"),
131+
-1,
132+
"data-* shouldn't be camelCased"
133+
);
134+
t.notEqual(
135+
Object.keys(r.props).indexOf("aria-label"),
136+
-1,
137+
"aria-* shouldn't be camelCased"
138+
);
131139
})
132140
.catch(t.end);
133141
});

test/svgo.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ test("fills essential plugins when empty", function(t) {
99
});
1010

1111
test("enable disabled essential plugins", function(t) {
12-
let opts = { full: true, plugins: ["removeDoctype", { removeComments: false }] };
12+
let opts = {
13+
full: true,
14+
plugins: ["removeDoctype", { removeComments: false }]
15+
};
1316
validateAndFix(opts);
1417
t.equal(opts.plugins.length, 3);
1518
t.equal(opts.plugins[1].removeComments, true);

yarn.lock

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,6 +1438,13 @@ eslint-plugin-flowtype@^2.36.0:
14381438
dependencies:
14391439
lodash "^4.15.0"
14401440

1441+
eslint-plugin-prettier@^2.3.1:
1442+
version "2.3.1"
1443+
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.3.1.tgz#e7a746c67e716f335274b88295a9ead9f544e44d"
1444+
dependencies:
1445+
fast-diff "^1.1.1"
1446+
jest-docblock "^21.0.0"
1447+
14411448
eslint-plugin-react@^7.0.1:
14421449
version "7.4.0"
14431450
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.4.0.tgz#300a95861b9729c087d362dd64abcc351a74364a"
@@ -1590,6 +1597,10 @@ fast-deep-equal@^1.0.0:
15901597
version "1.0.0"
15911598
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff"
15921599

1600+
fast-diff@^1.1.1:
1601+
version "1.1.2"
1602+
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154"
1603+
15931604
fast-levenshtein@~2.0.4:
15941605
version "2.0.6"
15951606
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
@@ -1672,9 +1683,9 @@ flat-cache@^1.2.1:
16721683
graceful-fs "^4.1.2"
16731684
write "^0.2.1"
16741685

1675-
flow-bin@^0.55.0:
1676-
version "0.55.0"
1677-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.55.0.tgz#9083da9327bd8cab6b4076d63d85f2247a7eae1b"
1686+
flow-bin@^0.56.0:
1687+
version "0.56.0"
1688+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.56.0.tgz#ce43092203a344ba9bf63c0cabe95d95145f6cad"
16781689

16791690
for-each@~0.3.2:
16801691
version "0.3.2"
@@ -2218,6 +2229,10 @@ istanbul@^0.4.0:
22182229
which "^1.1.1"
22192230
wordwrap "^1.0.0"
22202231

2232+
jest-docblock@^21.0.0:
2233+
version "21.2.0"
2234+
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414"
2235+
22212236
jodid25519@^1.0.0:
22222237
version "1.0.2"
22232238
resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967"
@@ -2704,6 +2719,10 @@ preserve@^0.2.0:
27042719
version "0.2.0"
27052720
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
27062721

2722+
prettier@^1.7.2:
2723+
version "1.7.2"
2724+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.2.tgz#81371e64018aafc69cf1031956c70e029339f54e"
2725+
27072726
private@^0.1.6:
27082727
version "0.1.6"
27092728
resolved "https://registry.yarnpkg.com/private/-/private-0.1.6.tgz#55c6a976d0f9bafb9924851350fe47b9b5fbb7c1"

0 commit comments

Comments
 (0)