Skip to content

Commit

Permalink
Prettierify code. (rjsf-team#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
n1k0 authored Mar 9, 2017
1 parent 399ece1 commit 4ef657c
Show file tree
Hide file tree
Showing 71 changed files with 4,214 additions and 3,296 deletions.
8 changes: 2 additions & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/react-in-jsx-scope": 2,
"react/jsx-space-before-closing": [1, "never"],
"react/jsx-closing-bracket-location": [1, "after-props"],

"react/jsx-space-before-closing": [1, "always"],
"curly": [2],
"indent": [2, 2, {"SwitchCase": 1}],
"quotes": [2, "double"],
"linebreak-style": [2, "unix"],
"semi": [2, "always"],
"comma-dangle": [0],
Expand All @@ -19,7 +15,7 @@
"ignoreRestSiblings": true
}],
"no-console": [0],
"object-curly-spacing": [2, "never"],
"object-curly-spacing": [2, "always"],
"keyword-spacing": ["error"]
},
"env": {
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ node_js:
env:
- ACTION=test
- ACTION="run lint"
- ACTION="run cs-check"
- ACTION="run dist"
script:
- npm $ACTION
1 change: 1 addition & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ If this is related to existing tickets, include links to them as well.
* [ ] **I'm adding or updating code**
- [ ] I've added and/or updated tests
- [ ] I've updated docs if needed
- [ ] I've run `npm run cs-format` on my branch to conform my code to [prettier](https://github.com/prettier/prettier) coding style
* [ ] **I'm adding a new feature**
- [ ] I've updated the playground with an example use of the feature
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1322,10 +1322,24 @@ This component follows [JSON Schema](http://json-schema.org/documentation.html)
- Use radio list for enums: https://jsfiddle.net/f2y3fq7L/2/
- Reading file input data: https://jsfiddle.net/f9vcb6pL/1/
- Custom errors messages with transformErrors : https://jsfiddle.net/revolunet/5r3swnr4/
## Contributing
### Coding style
All the JavaScript code in this project conforms to the [prettier](https://github.com/prettier/prettier) coding style. A command is provided to ensure your code is always formatted accordingly:
```
$ npm run cs-format
```
The `cs-check` command ensures all files conform to that style:
```
$ npm run cs-check
```
### Development server
```
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/",
"build:dist": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.js --optimize-minimize",
"build:playground": "rimraf build && cross-env NODE_ENV=production webpack --config webpack.config.prod.js --optimize-minimize && cp playground/index.prod.html build/index.html",
"cs-check": "prettier-check --jsx-bracket-same-line '{playground,src,test}/**/*.js'",
"cs-format": "prettier --jsx-bracket-same-line '{playground,src,test}/**/*.js' --write",
"dist": "npm run build:lib && npm run build:dist",
"lint": "eslint src test playground",
"publish-to-gh-pages": "npm run build:playground && gh-pages --dist build/",
Expand Down Expand Up @@ -45,11 +47,11 @@
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"babel-register": "^6.18.0",
"codemirror": "^5.20.2",
"eslint": "^3.15.0",
"chai": "^3.3.0",
"codemirror": "^5.20.2",
"cross-env": "^2.0.1",
"css-loader": "^0.23.1",
"eslint": "^3.15.0",
"eslint-plugin-react": "^4.2.3",
"estraverse": "^4.2.0",
"estraverse-fb": "^1.3.1",
Expand All @@ -59,6 +61,8 @@
"html": "0.0.10",
"jsdom": "^8.3.0",
"mocha": "^2.5.3",
"prettier": "^0.22.0",
"prettier-check": "^1.0.0",
"react": "^15.0.0",
"react-addons-test-utils": "^15.3.2",
"react-codemirror": "^0.2.3",
Expand Down
Loading

0 comments on commit 4ef657c

Please sign in to comment.