From b4a8a43f4e9739d3cf14066217d154489030c0a8 Mon Sep 17 00:00:00 2001 From: dkundel Date: Tue, 1 Oct 2019 16:41:01 -0700 Subject: [PATCH] chore: add prettier for formatting --- __tests__/data.test.js | 8 +++---- package-lock.json | 47 ++++++++++++++++++++++++++++++++---------- package.json | 4 +++- 3 files changed, 43 insertions(+), 16 deletions(-) diff --git a/__tests__/data.test.js b/__tests__/data.test.js index a587fa5ebe..03c9707be7 100644 --- a/__tests__/data.test.js +++ b/__tests__/data.test.js @@ -43,7 +43,7 @@ describe('pixels', () => { expect(hasTileName || hasColor).toBeTruthy(); } - }) + }); test('every pixel should have a hex code color if present', async () => { const pixels = await loadJson('pixels.json'); @@ -55,13 +55,13 @@ describe('pixels', () => { expect(pixel.color).toMatch(/#[0-9a-f]{3,6}/i); } } - }) + }); - test('claimed name doesn\'t have brackets', async () => { + test("claimed name doesn't have brackets", async () => { const pixels = await loadJson('pixels.json'); for (const pixel of pixels.data) { if (pixel.username !== '') expect(pixel.username).not.toMatch(/^\<.*\>$/); } - }) + }); }); diff --git a/package-lock.json b/package-lock.json index 4bf2c9deb4..9e99851ac9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3231,7 +3231,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -3252,12 +3253,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3272,17 +3275,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -3399,7 +3405,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -3411,6 +3418,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3425,6 +3433,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -3432,12 +3441,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -3456,6 +3467,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -3536,7 +3548,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -3548,6 +3561,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -3633,7 +3647,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -3669,6 +3684,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3688,6 +3704,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -3731,12 +3748,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -7317,6 +7336,12 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "prettier": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", + "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", + "dev": true + }, "pretty": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pretty/-/pretty-2.0.0.tgz", diff --git a/package.json b/package.json index 38057afca0..20dc0cdfc9 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "start": "eleventy --serve", "build": "eleventy", + "pretest": "prettier --write \"**/*.js\"", "test": "jest" }, "repository": { @@ -25,7 +26,8 @@ "common-tags": "^1.8.0", "danger": "^9.2.0", "dot-prop": "^5.1.0", - "jest": "^24.9.0" + "jest": "^24.9.0", + "prettier": "^1.18.2" }, "dependencies": { "nes.css": "^2.2.0"