Skip to content

Commit 3d1dae4

Browse files
committed
build: use prettier
2 parents f13ff92 + c0ae8eb commit 3d1dae4

File tree

7 files changed

+1435
-15
lines changed

7 files changed

+1435
-15
lines changed

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
.babelrc
2+
.eslintrc
23
.eslintcache
34
.eslintrc
45
.idea
56
.nyc_output
7+
.prettierrc
68
.storybook
79
.travis.yml
810
commitlint.config.js

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"trailingComma": "es5",
5+
"parser": "babylon"
6+
}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,3 @@ npm i
3939
* semantic-release
4040
* Travis CI
4141
* Coveralls
42-

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"lint": "eslint src test stories --cache",
1111
"lint:fix": "eslint --fix src test stories --cache",
1212
"lint:watch": "esw --watch src test stories --cache",
13+
"lint": "eslint src test stories --cache",
14+
"lint:fix": "eslint --fix src test stories --cache",
15+
"lint:watch": "esw --watch src test stories --cache",
16+
"prettier": "prettier --write src/**/*.js test/**/*.js stories/**/*.js",
17+
"prettier:check": "prettier --list-different src/**/*.js test/**/*.js stories/**/*.js",
1318
"flow": "flow",
1419
"flow:coverage": "for file in src/**.js test/**.js; do echo $file; flow coverage $file; done",
1520
"flow:watch": "flow-watch -e js,js.flow,flowconfig --ignore es/ --ignore node_modules/ --watch .flowconfig --watch src/ --watch test/",
@@ -19,7 +24,7 @@
1924
"test:watch": "NODE_ENV=production BABEL_ENV=test mocha --watch $npm_package_config_mocha",
2025
"codecov": "nyc report --reporter=text-lcov > coverage.lcov; codecov",
2126
"commitmsg": "commitlint -e $GIT_PARAMS",
22-
"precommit": "npm run lint && flow",
27+
"precommit": "npm run lint && npm run prettier:check && flow",
2328
"prepush": "npm test",
2429
"prepublishOnly": "npm run clean && npm run lint && flow && npm test && npm run build",
2530
"open:coverage": "open coverage/lcov-report/index.html",
@@ -104,6 +109,8 @@
104109
"jsdom-global": "^3.0.2",
105110
"mocha": "^5.0.0",
106111
"nyc": "^11.4.1",
112+
"prettier": "^1.15.1",
113+
"prettier-eslint": "^8.8.2",
107114
"react": "^16.2.0",
108115
"react-dom": "^16.2.0",
109116
"rimraf": "^2.6.0",

test/clearConsole.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* eslint-env node */
2+
3+
if (process.argv.indexOf('--watch') >= 0) {
4+
before(() => process.stdout.write('\u001b[2J\u001b[1;1H\u001b[3J'))
5+
}

test/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// @flow
22

3-
import {describe, it} from 'mocha'
3+
import { describe, it } from 'mocha'
44
import * as React from 'react'
5-
import {mount} from 'enzyme'
6-
import {expect} from 'chai'
5+
import { mount } from 'enzyme'
6+
import { expect } from 'chai'
77

88
import Hello from '../src/index'
99

0 commit comments

Comments
 (0)