Skip to content

Commit

Permalink
Integrate prettier into eslint and CLI
Browse files Browse the repository at this point in the history
The VSCode extension for Prettier appears to have stopped working, and
this gives us the same config as appears to be default with VSCode.

It also appears to match the create-react-app defaults.

ESLint config from https://medium.com/technical-credit/using-prettier-with-vs-code-and-create-react-app-67c2449b9d08
  • Loading branch information
TBBle committed May 26, 2018
1 parent fe6060f commit 532d3f2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": "react-app"
}
"extends": "react-app",
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error"
}
}
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "es5"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"canvas-prebuilt": "^1.6.5-prerelease.1",
"echarts": "^4.0.4",
"echarts-for-react": "^2.0.8",
"eslint-plugin-prettier": "^2.6.0",
"gh-pages": "^1.1.0",
"prettier": "^1.12.1",
"probability-distributions": "^0.9.1",
Expand Down
15 changes: 15 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3353,6 +3353,13 @@ [email protected]:
emoji-regex "^6.1.0"
jsx-ast-utils "^2.0.0"

eslint-plugin-prettier@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.0.tgz#33e4e228bdb06142d03c560ce04ec23f6c767dd7"
dependencies:
fast-diff "^1.1.1"
jest-docblock "^21.0.0"

[email protected]:
version "7.7.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz#f606c719dbd8a1a2b3d25c16299813878cca0160"
Expand Down Expand Up @@ -3653,6 +3660,10 @@ fast-deep-equal@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"

fast-diff@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154"

fast-json-stable-stringify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
Expand Down Expand Up @@ -5082,6 +5093,10 @@ jest-diff@^22.4.0, jest-diff@^22.4.3:
jest-get-type "^22.4.3"
pretty-format "^22.4.3"

jest-docblock@^21.0.0:
version "21.2.0"
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414"

jest-docblock@^22.4.0, jest-docblock@^22.4.3:
version "22.4.3"
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-22.4.3.tgz#50886f132b42b280c903c592373bb6e93bb68b19"
Expand Down

0 comments on commit 532d3f2

Please sign in to comment.