Skip to content

Commit

Permalink
Integrate eslint with prettier
Browse files Browse the repository at this point in the history
Passing through Prettier+ESLint for formatting but only ESLint for
linting/checking.
  • Loading branch information
hypest committed May 3, 2018
1 parent 150cf18 commit 7e3a19a
Show file tree
Hide file tree
Showing 4 changed files with 500 additions and 422 deletions.
1 change: 0 additions & 1 deletion .travis/travis-checks-js.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ fi

if [ "$CHECK_CORRECTNESS" = true ] ; then
npm run flow || pFail
npm run prettier:check || pFail
npm run lint || pFail
fi

Expand Down
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"javascript.validate.enable": false
"javascript.validate.enable": false,

// Enable/disable default JavaScript formatter (For Prettier)
"javascript.format.enable": false,

// Use 'prettier-eslint' instead of 'prettier'. Other settings will only be fallbacks in case they could not be inferred from eslint rules.
"prettier.eslintIntegration": true,
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
"test": "cross-env NODE_ENV=test node node_modules/jest/bin/jest.js --verbose --config jest.config.js",
"test:debug": "cross-env NODE_ENV=test node --inspect-brk node_modules/jest/bin/jest.js --runInBand --verbose --config jest.config.js",
"flow": "flow",
"prettier": "prettier --write $npm_package_config_jsfiles $npm_package_config_scssfiles",
"prettier:check": "prettier -l $npm_package_config_jsfiles $npm_package_config_scssfiles",
"prettier": "prettier-eslint --write $npm_package_config_jsfiles $npm_package_config_scssfiles",
"clean": "yarn test --clearCache; watchman watch-del-all; rm -rf node_modules; rm -f yarn.lock; rm -rf $TMPDIR/react-*; rm -rf $TMPDIR/metro-cache-*; rm -rf $TMPDIR/jest_*",
"clean:install": "yarn clean; yarn",
"lint": "eslint $npm_package_config_jsfiles",
Expand All @@ -57,6 +56,7 @@
"jsx-to-string": "^1.3.1",
"memize": "^1.0.5",
"node-sass": "^4.8.3",
"prettier-eslint": "^8.8.1",
"react": "16.2.0",
"react-native": "0.52.0",
"react-native-recyclerview-list": "git+https://github.com/wordpress-mobile/react-native-recyclerview-list.git#bfccbaab6b5954e18f8b0ed441ba38275853b79c",
Expand Down
Loading

0 comments on commit 7e3a19a

Please sign in to comment.