Skip to content

Commit 03c70d8

Browse files
committed
Prettier setup
1 parent 626dc53 commit 03c70d8

File tree

5 files changed

+160
-85
lines changed

5 files changed

+160
-85
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
bin
33
dist
4+
src/transformers/__testfixtures__

.eslintrc.js

+27-22
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
module.exports = {
2-
extends: 'airbnb-base',
3-
env: {
4-
'node': true,
5-
},
6-
root: true,
7-
rules: {
8-
'arrow-parens': ['error', 'as-needed'],
9-
'comma-dangle': ['error', 'always-multiline'],
10-
'import/order': ['error', {
11-
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
12-
}],
13-
'indent': ['error', 4, {'SwitchCase': 1}],
14-
'max-len': ['error', 200, 4, {'ignoreComments': true, 'ignoreUrls': true}],
15-
'no-unused-vars': ['error', {'vars': 'all', 'args': 'none'}],
16-
'space-before-function-paren': ['error', 'never'],
17-
'space-in-parens': ['error', 'never'],
18-
'no-underscore-dangle': 'off',
19-
'no-param-reassign': 'off',
20-
'no-console': 'off',
21-
'no-warning-comments': ['warn', { 'terms': ['fixme'], 'location': 'start' }],
22-
}
23-
}
2+
extends: ['eslint:recommended', 'prettier'],
3+
parser: 'babel-eslint',
4+
plugins: ['import', 'prettier'],
5+
env: {
6+
node: true,
7+
es6: true,
8+
},
9+
root: true,
10+
rules: {
11+
'prettier/prettier': [
12+
'error',
13+
{ trailingComma: 'es5', singleQuote: true, printWidth: 90, tabWidth: 4, },
14+
],
15+
16+
'import/order': [
17+
'error',
18+
{
19+
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
20+
},
21+
],
22+
'no-unused-vars': ['error', { vars: 'all', args: 'none' }],
23+
'no-underscore-dangle': 'off',
24+
'no-param-reassign': 'off',
25+
'no-console': 'off',
26+
'no-warning-comments': ['warn', { terms: ['fixme'], location: 'start' }],
27+
},
28+
};

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ node_js:
33
- '6'
44
- '4'
55
script:
6-
- yarn
6+
- yarn run ci
77
cache: yarn

package.json

+10-5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"clean": "rm -rf lib coverage npm-debug.log dist",
2424
"lint": "eslint --fix src",
2525
"prepublish": "npm run clean && npm run check && npm run build",
26+
"ci": "eslint src && npm run test:cov",
2627
"test:cov": "npm run test -- --coverage",
2728
"test:watch": "npm run test -- --watch",
2829
"test": "jest --runInBand"
@@ -54,19 +55,23 @@
5455
},
5556
"devDependencies": {
5657
"babel-cli": "^6.14.0",
58+
"babel-eslint": "^7.2.2",
5759
"babel-jest": "^16.0.0",
5860
"babel-preset-es2015-node4": "^2.1.0",
59-
"eslint": "^3.5.0",
60-
"eslint-config-airbnb-base": "^7.1.0",
61-
"eslint-plugin-import": "^1.15.0",
62-
"jest": "^19.0.2"
61+
"eslint": "^3.19.0",
62+
"eslint-config-prettier": "^1.6.0",
63+
"eslint-plugin-import": "^2.2.0",
64+
"eslint-plugin-prettier": "^2.0.1",
65+
"jest": "^19.0.2",
66+
"prettier": "^1.0.2"
6367
},
6468
"jest": {
6569
"collectCoverageFrom": [
6670
"src/**/*.js"
6771
],
6872
"coverageReporters": [
69-
"text", "html"
73+
"text",
74+
"html"
7075
],
7176
"coveragePathIgnorePatterns": [
7277
"/node_modules/",

0 commit comments

Comments
 (0)