Skip to content

Commit dbe14cf

Browse files
author
Robert Jackson
committed
Add prettier setup.
1 parent 0cbf3c3 commit dbe14cf

6 files changed

Lines changed: 324 additions & 226 deletions

File tree

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
!.*
12
test/fixtures
2-
test/helpers
3+
test/helpers

.eslintrc.js

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
module.exports = {
2-
'env': {
3-
'browser': true,
4-
'node': true,
5-
'es6': true,
6-
},
7-
'extends': ['eslint:recommended', 'plugin:node/recommended'],
8-
'parserOptions': {
9-
'ecmaVersion': 2017
10-
},
11-
'rules': {
12-
'no-console': ['error', { 'allow': ['warn', 'error']}],
13-
'linebreak-style': [
14-
'error',
15-
'unix'
16-
],
17-
'semi': [
18-
'error',
19-
'always'
20-
]
21-
}
2+
parserOptions: {
3+
ecmaVersion: 2017,
4+
},
5+
extends: ['eslint:recommended', 'plugin:node/recommended', 'plugin:prettier/recommended'],
6+
plugins: ['prettier', 'node'],
7+
env: {
8+
browser: true,
9+
node: true,
10+
es6: true,
11+
},
12+
rules: {
13+
'no-console': ['error', { allow: ['warn', 'error'] }],
14+
},
2215
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.eslintcache
12
/node_modules
23
npm-debug.log
34
tmp*

.prettierrc

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

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "src/index.js",
66
"scripts": {
77
"changelog": "lerna-changelog",
8-
"lint:js": "node_modules/.bin/eslint src test",
8+
"lint:js": "eslint --cache .",
99
"test": "npm run-script lint:js && mocha",
1010
"preversion": "npm test",
1111
"postversion": "git push origin master --tags"
@@ -41,13 +41,16 @@
4141
"chai": "^4.1.0",
4242
"chai-as-promised": "^7.1.1",
4343
"ember-source": "3.8.0",
44-
"eslint": "^5.10.0",
44+
"eslint": "^6.5.1",
45+
"eslint-config-prettier": "^6.4.0",
4546
"eslint-plugin-chai-expect": "^2.0.1",
46-
"eslint-plugin-mocha": "^5.2.0",
47-
"eslint-plugin-node": "^8.0.0",
47+
"eslint-plugin-mocha": "^6.2.0",
48+
"eslint-plugin-node": "^10.0.0",
49+
"eslint-plugin-prettier": "^3.1.1",
4850
"express": "^4.15.4",
4951
"lerna-changelog": "^0.8.2",
5052
"mocha": "^5.2.0",
53+
"prettier": "^1.18.2",
5154
"rimraf": "^2.6.2",
5255
"temp": "^0.8.3"
5356
}

0 commit comments

Comments
 (0)