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

Commit 5487243

Browse files
committed
Add prettier
This also sets up ESLint to get tighter tooling feedback for people who aren't me and don't have format-on-save.
1 parent 4f4a60c commit 5487243

File tree

4 files changed

+1594
-0
lines changed

4 files changed

+1594
-0
lines changed

Diff for: .eslintrc.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
parserOptions: {ecmaVersion: 6},
3+
plugins: ['prettier'],
4+
rules: {
5+
'prettier/prettier': 'error',
6+
},
7+
};

Diff for: package.json

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
],
1010
"main": "index.js",
1111
"scripts": {
12+
"lint": "eslint .",
13+
"format":
14+
"prettier --write *.js package.json .eslintrc.js 'examples/**/*.{js,json}' 'test/*.{js,jsx,json}'",
1215
"test": "node test"
1316
},
1417
"author": "Paul O’Shannessy <[email protected]>",
@@ -32,6 +35,9 @@
3235
"devDependencies": {
3336
"async": "^2.4.0",
3437
"create-react-class": "^15.5.3",
38+
"eslint": "^4.10.0",
39+
"eslint-plugin-prettier": "^2.3.1",
40+
"prettier": "^1.7.4",
3541
"prop-types": "^15.5.10",
3642
"react": "^16.0.0",
3743
"react-dom": "^16.0.0"

Diff for: prettier.config.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
printWidth: 80,
3+
semi: true,
4+
bracketSpacing: false,
5+
jsxBracketSameLine: true,
6+
singleQuote: true,
7+
trailingComma: 'es5',
8+
};

0 commit comments

Comments
 (0)