Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit 9518794

Browse files
committed
Add prettier in a pre-commit hook
1 parent db47650 commit 9518794

File tree

3 files changed

+290
-23
lines changed

3 files changed

+290
-23
lines changed

.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"trailingComma": "es5",
3+
"quotes": "single"
4+
}

package.json

+22-16
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
{
22
"name": "draft-js-markdown-plugin",
33
"version": "0.4.0",
4-
"description": "A DraftJS plugin for supporting Markdown syntax shortcuts, fork of draft-js-markdown-shortcuts-plugin",
4+
"description":
5+
"A DraftJS plugin for supporting Markdown syntax shortcuts, fork of draft-js-markdown-shortcuts-plugin",
56
"main": "lib/index.js",
67
"scripts": {
78
"build": "npm run clean && npm run build:js",
8-
"build:demo": "NODE_ENV=production webpack --config demo/webpack.config.prod.js && rm -rf demo/public/css && cp -R demo/publicTemplate/* demo/public/",
9-
"build:js": "BABEL_DISABLE_CACHE=1 BABEL_ENV=production NODE_ENV=production node_modules/.bin/babel --out-dir='lib' --ignore='**/__test__/*' src",
10-
"clean": "node_modules/.bin/rimraf lib; node_modules/.bin/rimraf demo/public",
9+
"build:demo":
10+
"NODE_ENV=production webpack --config demo/webpack.config.prod.js && rm -rf demo/public/css && cp -R demo/publicTemplate/* demo/public/",
11+
"build:js":
12+
"BABEL_DISABLE_CACHE=1 BABEL_ENV=production NODE_ENV=production node_modules/.bin/babel --out-dir='lib' --ignore='**/__test__/*' src",
13+
"clean":
14+
"node_modules/.bin/rimraf lib; node_modules/.bin/rimraf demo/public",
1115
"dev": "node_modules/.bin/babel-node ./demo/server.js",
12-
"test": "jest"
16+
"test": "jest",
17+
"precommit": "lint-staged"
1318
},
1419
"repository": {
1520
"type": "git",
1621
"url": "git+https://github.com/withspectrum/draft-js-markdown-plugin.git"
1722
},
18-
"keywords": [
19-
"draftjs",
20-
"editor",
21-
"plugin",
22-
"markdown"
23-
],
23+
"keywords": ["draftjs", "editor", "plugin", "markdown"],
2424
"author": "Max Stoiber <[email protected]>",
2525
"license": "MIT",
2626
"bugs": {
2727
"url": "https://github.com/withspectrum/draft-js-markdown-plugin/issues"
2828
},
2929
"homepage": "https://github.com/withspectrum/draft-js-markdown-plugin#readme",
30+
"lint-staged": {
31+
"*.{js,json,css}": ["prettier --write", "git add"]
32+
},
3033
"devDependencies": {
3134
"autoprefixer": "^6.5.3",
3235
"babel-cli": "^6.18.0",
@@ -47,7 +50,8 @@
4750
"css-modules-require-hook": "^4.0.5",
4851
"dirty-chai": "^1.2.2",
4952
"draft-js-plugins-editor": "2.0.0-rc2",
50-
"draft-js-prism": "ngs/draft-js-prism#6edb31c3805dd1de3fb897cc27fced6bac1bafbb",
53+
"draft-js-prism":
54+
"ngs/draft-js-prism#6edb31c3805dd1de3fb897cc27fced6bac1bafbb",
5155
"enzyme": "^2.6.0",
5256
"eslint": "^3.11.1",
5357
"eslint-config-airbnb": "^13.0.0",
@@ -60,13 +64,16 @@
6064
"file-loader": "^0.9.0",
6165
"flow-bin": "^0.36.0",
6266
"history": "^2.0.0",
67+
"husky": "^0.14.3",
6368
"jsdom": "^9.8.3",
69+
"lint-staged": "^4.2.1",
6470
"mocha": "^3.2.0",
6571
"mocha-junit-reporter": "^1.12.1",
6672
"mocha-multi-reporters": "^1.1.1",
6773
"npm-watch": "^0.1.6",
6874
"nyc": "^10.0.0",
6975
"postcss-loader": "^1.1.1",
76+
"prettier": "^1.7.0",
7077
"prismjs": "^1.6.0",
7178
"react": "^15.4.1",
7279
"react-addons-pure-render-mixin": "^15.4.1",
@@ -84,13 +91,12 @@
8491
"webpack-hot-middleware": "^2.13.2"
8592
},
8693
"peerDependencies": {
87-
"draft-js-plugins-editor": "~2.0.0-rc.1 || 2.0.0-rc2 || 2.0.0-rc1 || 2.0.0-beta12",
94+
"draft-js-plugins-editor":
95+
"~2.0.0-rc.1 || 2.0.0-rc2 || 2.0.0-rc1 || 2.0.0-beta12",
8896
"react": "^15.0.0",
8997
"react-dom": "^15.0.0"
9098
},
91-
"contributors": [
92-
"Atsushi Nagase <[email protected]>"
93-
],
99+
"contributors": ["Atsushi Nagase <[email protected]>"],
94100
"dependencies": {
95101
"decorate-component-with-props": "^1.0.2",
96102
"draft-js": "~0.10.1",

0 commit comments

Comments
 (0)