Skip to content

Commit 639801a

Browse files
refactor: updated depencencies regarding prettier (#1307)
* refactor: updated husky and pretty-quick dependencies and updated to the new config storage model and removed husky and pretty-quick from packages/core, as this should be possible to get triggered from root * refactor: updated prettier dependency and removed rules "trailingComma": "es5" as this is the new default * fix: added missing comma * refactor: regenerated yarn.lock file * refactor(husky): made additional necessary changes for the installation as well as moved husky to the devDependencies, as defined by the software doc itself * refactor(pinst): remove that solution again see typicode/husky#884 * refactor(code): integrated prettier feedback that was enforced like this by eslint * refactor(husky): updated husky and added pinst Yarn 2 doesn't support prepare lifecycle script, so husky needs to be installed differently (this doesn't apply to Yarn 1 though) * Revert "refactor(husky): updated husky and added pinst" This reverts commit e834b42. * refactor(husky): updated husky Co-authored-by: Josef Bredreck <[email protected]>
1 parent 7ecca69 commit 639801a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+352
-354
lines changed

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install pretty-quick --staged

.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"singleQuote": true,
3-
"trailingComma": "es5",
43
"endOfLine": "auto"
54
}

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
"eslint-config-prettier": "^6.0.0",
1919
"eslint-plugin-import": "^2.18.2",
2020
"eslint-plugin-prettier": "^3.1.0",
21-
"prettier": "^1.14.3",
2221
"lerna": "3.17.0",
23-
"pretty-quick": "^1.11.1",
2422
"auto": "^9.40.5",
25-
"@auto-it/released": "^9.40.5"
23+
"@auto-it/released": "^9.40.5",
24+
"prettier": "^2.2.1",
25+
"pretty-quick": "^3.1.0"
2626
},
2727
"repository": {
2828
"type": "git",
@@ -41,7 +41,8 @@
4141
"publish": "npx lerna publish -m \"[skip travis] chore(release): publish %s\"",
4242
"postpublish": "auto release",
4343
"preview:docs": "cd packages/docs && yarn production",
44-
"preview:hbs": "cd packages/development-edition-engine-handlebars && yarn pl:starterkit && yarn pl:build"
44+
"preview:hbs": "cd packages/development-edition-engine-handlebars && yarn pl:starterkit && yarn pl:build",
45+
"prepare": "husky install"
4546
},
4647
"nyc": {
4748
"exclude": [
@@ -50,5 +51,8 @@
5051
"packages/core/test",
5152
"packages/live-server"
5253
]
54+
},
55+
"devDependencies": {
56+
"husky": "^6.0.0"
5357
}
5458
}

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"eslint": "4.18.2",
3535
"eslint-config-prettier": "2.9.0",
3636
"eslint-plugin-prettier": "2.6.0",
37-
"prettier": "1.11.1",
37+
"prettier": "2.2.1",
3838
"proxyquire": "2.1.3",
3939
"tap": "14.11.0"
4040
},

packages/core/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@
3030
"eslint-config-prettier": "^6.0.0",
3131
"eslint-plugin-import": "^2.18.2",
3232
"eslint-plugin-prettier": "^3.1.0",
33-
"husky": "0.14.3",
3433
"jsdoc-to-markdown": "5.0.1",
35-
"prettier": "^1.14.3",
36-
"pretty-quick": "^1.11.1",
34+
"prettier": "^2.2.1",
3735
"rewire": "2.5.2",
3836
"standard-version": "9.1.1",
3937
"tap": "14.11.0"

packages/core/src/lib/addPattern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const logger = require('./log');
44

5-
module.exports = function(pattern, patternlab) {
5+
module.exports = function (pattern, patternlab) {
66
//add the link to the global object
77
if (!patternlab.data.link) {
88
patternlab.data.link = {};

packages/core/src/lib/annotation_exporter.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const _ = require('lodash');
66
const mp = require('./markdown_parser');
77
const logger = require('./log');
88

9-
const annotations_exporter = function(pl) {
9+
const annotations_exporter = function (pl) {
1010
const paths = pl.config.paths;
1111
let oldAnnotations;
1212

@@ -68,7 +68,7 @@ const annotations_exporter = function(pl) {
6868
//let annotations = annotations;
6969
const markdown_parser = parser;
7070

71-
return function(filePath) {
71+
return function (filePath) {
7272
const annotationsMD = fs.readFileSync(path.resolve(filePath), 'utf8');
7373

7474
//take the annotation snippets and split them on our custom delimiter
@@ -110,13 +110,13 @@ const annotations_exporter = function(pl) {
110110
}
111111

112112
return {
113-
gather: function() {
113+
gather: function () {
114114
return gatherAnnotations();
115115
},
116-
gatherJS: function() {
116+
gatherJS: function () {
117117
return parseAnnotationsJS();
118118
},
119-
gatherMD: function() {
119+
gatherMD: function () {
120120
return parseAnnotationsMD();
121121
},
122122
};

packages/core/src/lib/buildFooter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ let render = require('./render'); //eslint-disable-line prefer-const
1313
* @param patternPartial - the partial key to build this for, either viewall-patternPartial or a viewall-patternGroup-all
1414
* @returns A promise which resolves with the HTML
1515
*/
16-
module.exports = function(patternlab, patternPartial, uikit) {
16+
module.exports = function (patternlab, patternPartial, uikit) {
1717
//first render the general footer
1818
return render(Pattern.createEmpty({ extendedTemplate: uikit.footer }), {
1919
patternData: JSON.stringify({
2020
patternPartial: patternPartial,
2121
}),
2222
cacheBuster: patternlab.cacheBuster,
2323
})
24-
.then(footerPartial => {
24+
.then((footerPartial) => {
2525
let allFooterData;
2626
try {
2727
allFooterData = jsonCopy(
@@ -36,7 +36,7 @@ module.exports = function(patternlab, patternPartial, uikit) {
3636

3737
return render(patternlab.userFoot, allFooterData);
3838
})
39-
.catch(reason => {
39+
.catch((reason) => {
4040
console.log(reason);
4141
logger.error('Error building buildFooterHTML');
4242
});

packages/core/src/lib/buildListItems.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const items = [
2626
'twenty',
2727
];
2828

29-
module.exports = function(container) {
29+
module.exports = function (container) {
3030
//combine all list items into one structure
3131
const list = [];
3232
for (const item in container.listitems) {

0 commit comments

Comments
 (0)