From 6a0783b1df46e23072c676e9f056e25da18da992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E6=9D=89?= Date: Sun, 22 Mar 2020 21:45:38 +0800 Subject: [PATCH 1/3] fix yarn format on win10 --- package.json | 2 +- src/database.test.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 08561b4ca..05bbc8519 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", - "format": "prettier --write '**/*.md' '{worker,src}/**/*.{js,ts,jsx,tsx}' 'public/**/*.html'", + "format": "prettier --write **/*.md {worker,src}/**/*.{js,ts,jsx,tsx} public/**/*.html", "lint": "eslint --ext .js,.jsx,.ts,.tsx src/ worker/" }, "devDependencies": { diff --git a/src/database.test.ts b/src/database.test.ts index 6d02e5cd2..062ec6841 100644 --- a/src/database.test.ts +++ b/src/database.test.ts @@ -32,7 +32,8 @@ test("database names should be sorted alphabetically", () => { }); test("a database path (if any) should ends with a trailing slash", () => { - const invalidEntries = Object.entries(DATABASE) - .filter(([_, value]) => "path" in value && !value.path.endsWith("/")); + const invalidEntries = Object.entries(DATABASE).filter( + ([_, value]) => "path" in value && !value.path.endsWith("/") + ); expect(invalidEntries).toEqual([]); -}) +}); From c52170202160af5e45deac79242889cc954ddc0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E6=9D=89?= Date: Sun, 22 Mar 2020 22:53:55 +0800 Subject: [PATCH 2/3] make ci broken if files are not formatted --- .github/workflows/ci.yml | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d5e3965b..2daf65735 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: node-version: 12 - run: yarn --frozen-lockfile - run: yarn run lint - - run: yarn format --check + - run: yarn format:check - run: CI=true yarn test - name: Publish Production if: github.ref == 'refs/heads/master' && github.event_name == 'push' && github.repository == 'denoland/deno_website2' diff --git a/package.json b/package.json index 05bbc8519..3a653dc3e 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", - "format": "prettier --write **/*.md {worker,src}/**/*.{js,ts,jsx,tsx} public/**/*.html", + "format": "yarn format:check --write", + "format:check": "prettier --check **/*.md {worker,src}/**/*.{js,ts,jsx,tsx} public/**/*.html", "lint": "eslint --ext .js,.jsx,.ts,.tsx src/ worker/" }, "devDependencies": { From 786604c9548e8cf891478454d51118af3a91ff9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E6=9D=89?= Date: Sun, 22 Mar 2020 23:02:19 +0800 Subject: [PATCH 3/3] follow the naming rules --- .github/workflows/ci.yml | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2daf65735..a1b125285 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: node-version: 12 - run: yarn --frozen-lockfile - run: yarn run lint - - run: yarn format:check + - run: yarn format_check - run: CI=true yarn test - name: Publish Production if: github.ref == 'refs/heads/master' && github.event_name == 'push' && github.repository == 'denoland/deno_website2' diff --git a/package.json b/package.json index 3a653dc3e..8ad55ce9d 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", - "format": "yarn format:check --write", - "format:check": "prettier --check **/*.md {worker,src}/**/*.{js,ts,jsx,tsx} public/**/*.html", + "format": "yarn format_check --write", + "format_check": "prettier --check **/*.md {worker,src}/**/*.{js,ts,jsx,tsx} public/**/*.html", "lint": "eslint --ext .js,.jsx,.ts,.tsx src/ worker/" }, "devDependencies": {