Enable eslint prettier plugin

Summary:
After adding this plugin, you just need to install https://github.com/AtomLinter/linter-eslint Atom package to surface ESLint errors(including prettier errors) in Nuclide linter UI. You also got auto-fix support in the Nuclide UI. Similarly, in VSCode, you can install https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint plugin to surface ESLint error in VSCode UI.
One caveat is that, eslint-plugin-prettier uses its own version of prettier(1.3.1) which may diverge from what we want. If we really found a file that diverge in formatting, we may have to add it into .eslintignore to ignore from UI/linter.
Closes https://github.com/facebook/prepack/pull/816

Differential Revision: D5444642

Pulled By: yinghuitan

fbshipit-source-id: 1670129d62e5e799a50c53d78387b5ded4c2c964
This commit is contained in:
Jeffrey Tan 2017-07-18 13:53:50 -07:00 committed by Facebook Github Bot
parent 6faf389083
commit 3c0b057e1a
4 changed files with 24 additions and 0 deletions

View File

@ -2,3 +2,4 @@ test262
lib
underscore-with-tests.js
flow-typed
test/**/*.js

View File

@ -8,6 +8,7 @@
"flowtype",
"header",
"flow-header",
"prettier"
],
"ecmaFeatures": {
@ -214,5 +215,11 @@
" ",
]
],
// Prettier
"prettier/prettier": ["error", {
"trailingComma": "es5",
"printWidth": 120,
}]
}
}

View File

@ -78,6 +78,7 @@
"eslint-plugin-flow-header": "^0.1.1",
"eslint-plugin-flowtype": "^2.20.0",
"eslint-plugin-header": "^1.0.0",
"eslint-plugin-prettier": "^2.1.2",
"flow-bin": "^0.47.0",
"graceful-fs": "^4.1.11",
"invariant": "^2.2.0",

View File

@ -1943,6 +1943,13 @@ eslint-plugin-header@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-header/-/eslint-plugin-header-1.0.0.tgz#3990ec8be67e30694fcbee672c5f8a5ae4c80cf8"
eslint-plugin-prettier@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.1.2.tgz#4b90f4ee7f92bfbe2e926017e1ca40eb628965ea"
dependencies:
fast-diff "^1.1.1"
jest-docblock "^20.0.1"
eslint@2.2.x:
version "2.2.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-2.2.0.tgz#6c8d743a91546595ba186eded096682f47598de8"
@ -2143,6 +2150,10 @@ fancy-log@^1.1.0:
chalk "^1.1.1"
time-stamp "^1.0.0"
fast-diff@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.1.tgz#0aea0e4e605b6a2189f0e936d4b7fbaf1b7cfd9b"
fast-levenshtein@~2.0.4:
version "2.0.6"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
@ -2990,6 +3001,10 @@ istanbul@0.4.5, istanbul@^0.4.5:
which "^1.1.1"
wordwrap "^1.0.0"
jest-docblock@^20.0.1:
version "20.0.3"
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712"
jodid25519@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967"