Skip to content

Commit

Permalink
Copied Flow+Lint+Prettier config from reactjs.org repo; pre-commit ho…
Browse files Browse the repository at this point in the history
…ok was super annoying
  • Loading branch information
bvaughn committed Oct 15, 2017
1 parent b6443a9 commit de54f93
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 302 deletions.
17 changes: 7 additions & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
{
"extends": [
"prettier"
"fbjs"
],
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module"
},
"plugins": [
"flowtype",
"prettier",
"react"
],
"parser": "babel-eslint",
"rules": {
"no-unused-vars": [ERROR, {"args": "all", "argsIgnorePattern": "^_"}],
"react/jsx-uses-react": ERROR,
"react/jsx-uses-vars": ERROR,
"prettier/prettier": ERROR
"max-len": 0
},
"env": {
"node": true,
"browser": true
}
}
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
.*/WindowScroller/.*

.*/node_modules/babel-plugin-transform-react-remove-prop-types/.*
.*/node_modules/graphql/.*

[include]

Expand Down
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"bracketSpacing": false,
"jsxBracketSameLine": true,
"parser": "flow",
"printWidth": 80,
"singleQuote": true,
"trailingComma": "all"
}
20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"build:demo": "npm run clean:demo && cross-env NODE_ENV=production webpack --config webpack.config.demo.js -p --bail",
"build:es": "npm run clean:es && cross-env NODE_ENV=production cross-env BABEL_ENV=es babel source --out-dir dist/es --ignore *.example.js,*.test.js,source/demo/,source/tests.js",
"build:umd": "npm run clean:umd && cross-env NODE_ENV=production webpack --config webpack.config.umd.js --bail",
"check-all": "yarn prettier && yarn lint && yarn flow",
"ci-check": "yarn prettier:diff && yarn lint && yarn flow",
"clean": "npm run clean:commonjs && npm run clean:demo && npm run clean:es && npm run clean:umd",
"clean:commonjs": "rimraf dist/commonjs",
"clean:demo": "rimraf build",
Expand All @@ -26,24 +28,17 @@
"typecheck": "flow check",
"prebuild": "npm run typecheck && npm run lint",
"predeploy": "cp ./circle.yml ./build/",
"print": "prettier --parser flow --write 'source/**/*.js'",
"prettier": "prettier --config .prettierrc --write '{playground,source}/**/*.js'",
"prettier:diff": "prettier --config .prettierrc --list-different '{playground,source}/**/*.js'",
"postpublish": "npm run deploy",
"posttest": "[ -z \"$CI\" ] || codecov",
"precommit": "flow check && lint-staged",
"prepublish": "npm run build",
"start": "cross-env NODE_ENV=development webpack-dev-server --hot --inline --config webpack.config.dev.js",
"test": "npm run test:jest",
"test:jest": "jest --no-watchman --runInBand",
"watch": "watch 'clear && npm run test -s' source",
"watch:jest": "jest --no-watchman --watch"
},
"lint-staged": {
"*.js": [
"prettier --parser flow --write",
"eslint",
"git add"
]
},
"files": [
"dist",
"styles.css"
Expand Down Expand Up @@ -106,10 +101,15 @@
"cross-env": "^5.0.1",
"css-loader": "^0.28.4",
"eslint": "^4.2.0",
"eslint-config-fbjs": "^2.0.0",
"eslint-config-prettier": "^2.3.0",
"eslint-config-react": "^1.1.7",
"eslint-plugin-babel": "^4.1.2",
"eslint-plugin-flowtype": "^2.35.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-prettier": "^2.1.2",
"eslint-plugin-react": "^7.1.0",
"eslint-plugin-relay": "^0.0.19",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.2",
Expand All @@ -120,11 +120,9 @@
"husky": "^0.14.3",
"immutable": "^3.7.5",
"jest": "^18.1.0",
"lint-staged": "^4.0.2",
"postcss": "^5.0.14",
"postcss-cli": "^2.3.3",
"postcss-loader": "^0.9.1",
"pre-commit": "^1.2.2",
"prettier": "^1.5.3",
"raf": "^3.3.0",
"react": "^16.0.0",
Expand Down
Loading

0 comments on commit de54f93

Please sign in to comment.