Skip to content

Commit b8e3e11

Browse files
committed
feat(package): Add prettier
1 parent 1955516 commit b8e3e11

File tree

4 files changed

+79
-43
lines changed

4 files changed

+79
-43
lines changed

.eslintrc

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,19 @@
99
"sourceType": "module"
1010
},
1111
"globals": {},
12+
"extends": ["prettier"],
13+
"plugins": ["prettier"],
1214
"rules": {
15+
"prettier/prettier": "error",
1316
"block-scoped-var": 0,
1417
"camelcase": 0,
15-
"comma-spacing": [1, {"before": false, "after": true}],
1618
"consistent-return": 2,
1719
"curly": [2, "all"],
1820
"dot-notation": [1, { "allowKeywords": true }],
1921
"eqeqeq": [2, "allow-null"],
2022
"global-strict": [0, "never"],
2123
"guard-for-in": 2,
22-
"indent": [1, 2, {"SwitchCase": 1, "VariableDeclarator": 1}],
23-
"lines-around-comment": [1, {
24-
"beforeBlockComment": true,
25-
"beforeLineComment": true,
26-
"allowBlockStart": true,
27-
"allowObjectStart": true,
28-
"allowArrayStart": true
29-
}],
3024
"key-spacing": 0,
31-
"keyword-spacing": 1,
3225
"new-cap": 0,
3326
"no-alert": 2,
3427
"no-bitwise": 2,
@@ -42,7 +35,6 @@
4235
"no-extend-native": 2,
4336
"no-extra-bind": 2,
4437
"no-extra-parens": 0,
45-
"no-extra-semi": 2,
4638
"no-func-assign": 2,
4739
"no-implied-eval": 2,
4840
"no-invalid-regexp": 2,
@@ -51,7 +43,6 @@
5143
"no-loop-func": 2,
5244
"no-mixed-requires": 0,
5345
"no-multi-str": 2,
54-
"no-multi-spaces": 1,
5546
"no-native-reassign": 2,
5647
"no-new": 2,
5748
"no-param-reassign": 1,
@@ -69,24 +60,19 @@
6960
"no-use-before-define": 1,
7061
"no-useless-call": 2,
7162
"no-useless-concat": 2,
63+
"no-var": 2,
7264
"no-with": 2,
7365
"quotes": [0, "single"],
7466
"radix": 2,
75-
"semi": [1, "always"],
7667
"strict": 0,
77-
"space-before-blocks": 1,
78-
"space-before-function-paren": [1, {
79-
"anonymous": "always",
80-
"named": "never"
81-
}],
82-
"space-in-parens": [1, "never"],
83-
"space-infix-ops": 1,
8468
"valid-typeof": 2,
8569
"vars-on-top": 0,
86-
"wrap-iife": [2, "inside"],
87-
"prefer-const": ["error", {
88-
"destructuring": "any",
89-
"ignoreReadBeforeAssign": false
90-
}]
70+
"prefer-const": [
71+
"error",
72+
{
73+
"destructuring": "any",
74+
"ignoreReadBeforeAssign": false
75+
}
76+
]
9177
}
9278
}

.prettierrc

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

package-lock.json

Lines changed: 60 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
"@pattern-lab/patternengine-node-handlebars": "^2.0.0-alpha.2",
2525
"@pattern-lab/patternengine-node-underscore": "^2.0.0-alpha.1",
2626
"eslint": "3.5.0",
27+
"eslint-config-prettier": "^2.9.0",
28+
"eslint-plugin-prettier": "^2.5.0",
29+
"prettier": "1.10.2",
2730
"rewire": "2.5.2",
2831
"tap": "11.0.1"
2932
},
@@ -57,7 +60,7 @@
5760
"license": "MIT",
5861
"scripts": {
5962
"lint": "eslint core/**/*.js",
60-
"pretest": "npm run lint",
63+
"prettier": "prettier --config .prettierrc --write ./core/**/*.js",
6164
"test": "tap test/*_tests.js --reporter spec --coverage"
6265
},
6366
"engines": {

0 commit comments

Comments
 (0)