From cd9e99402d29bfed6a897a7371144b096ee5249c Mon Sep 17 00:00:00 2001 From: "Hugh A. Miles II" Date: Wed, 20 Oct 2021 20:53:52 -0400 Subject: [PATCH] feat: Add prettier to pre-commit workflow (#17134) * save * fix * fix pre-commit --- .github/workflows/superset-frontend.yml | 2 +- .pre-commit-config.yaml | 5 +++++ superset-frontend/.storybook/storybook.css | 2 +- superset-frontend/cypress-base/cypress.json | 4 +--- superset-frontend/cypress-base/tsconfig.json | 2 +- superset-frontend/src/common/components/.eslintrc | 6 +++--- superset-frontend/src/components/.eslintrc | 4 +--- superset-frontend/tsconfig.json | 2 +- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/superset-frontend.yml b/.github/workflows/superset-frontend.yml index afdcb889effc4..fbcc272f573bc 100644 --- a/.github/workflows/superset-frontend.yml +++ b/.github/workflows/superset-frontend.yml @@ -31,7 +31,7 @@ jobs: if: steps.check.outcome == 'failure' uses: actions/setup-node@v2 with: - node-version: '16' + node-version: "16" - name: Install dependencies if: steps.check.outcome == 'failure' uses: ./.github/actions/cached-dependencies diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 80202bebfab9a..a3c5fd6da43a9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -48,3 +48,8 @@ repos: hooks: - id: black language_version: python3 + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.2.1 # Use the sha or tag you want to point at + hooks: + - id: prettier + files: 'superset-frontend' diff --git a/superset-frontend/.storybook/storybook.css b/superset-frontend/.storybook/storybook.css index ce5f7a12419be..b4e2fce55b7df 100644 --- a/superset-frontend/.storybook/storybook.css +++ b/superset-frontend/.storybook/storybook.css @@ -1,3 +1,3 @@ -body{ +body { background: transparent; } diff --git a/superset-frontend/cypress-base/cypress.json b/superset-frontend/cypress-base/cypress.json index db4c628d1c212..4e37441d75d30 100644 --- a/superset-frontend/cypress-base/cypress.json +++ b/superset-frontend/cypress-base/cypress.json @@ -5,9 +5,7 @@ "numTestsKeptInMemory": 0, "experimentalFetchPolyfill": true, "requestTimeout": 10000, - "ignoreTestFiles": [ - "**/!(*.test.js|*.test.ts)" - ], + "ignoreTestFiles": ["**/!(*.test.js|*.test.ts)"], "video": false, "videoUploadOnPasses": false, "viewportWidth": 1280, diff --git a/superset-frontend/cypress-base/tsconfig.json b/superset-frontend/cypress-base/tsconfig.json index d047e2640fad7..e983ed3a3ecd0 100644 --- a/superset-frontend/cypress-base/tsconfig.json +++ b/superset-frontend/cypress-base/tsconfig.json @@ -8,7 +8,7 @@ "lib": ["es2019", "DOM"], "types": ["cypress"], "allowJs": true, - "noEmit": true, + "noEmit": true }, "files": ["cypress/support/index.d.ts"], "include": ["node_modules/cypress", "cypress/**/*.ts"] diff --git a/superset-frontend/src/common/components/.eslintrc b/superset-frontend/src/common/components/.eslintrc index 586abc67e8d22..84622e9fb2684 100644 --- a/superset-frontend/src/common/components/.eslintrc +++ b/superset-frontend/src/common/components/.eslintrc @@ -23,9 +23,9 @@ { "paths": [ { - "name": "@superset-ui/core", - "importNames": ["supersetTheme"], - "message": "Please use the theme directly from the ThemeProvider rather than importing supersetTheme." + "name": "@superset-ui/core", + "importNames": ["supersetTheme"], + "message": "Please use the theme directly from the ThemeProvider rather than importing supersetTheme." } ] } diff --git a/superset-frontend/src/components/.eslintrc b/superset-frontend/src/components/.eslintrc index a01df155ac687..84622e9fb2684 100644 --- a/superset-frontend/src/components/.eslintrc +++ b/superset-frontend/src/components/.eslintrc @@ -24,9 +24,7 @@ "paths": [ { "name": "@superset-ui/core", - "importNames": [ - "supersetTheme" - ], + "importNames": ["supersetTheme"], "message": "Please use the theme directly from the ThemeProvider rather than importing supersetTheme." } ] diff --git a/superset-frontend/tsconfig.json b/superset-frontend/tsconfig.json index ed0ce53498744..f0ef1971071d9 100644 --- a/superset-frontend/tsconfig.json +++ b/superset-frontend/tsconfig.json @@ -7,7 +7,7 @@ "forceConsistentCasingInFileNames": true, "importHelpers": false, "jsx": "preserve", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": ["dom", "dom.iterable", "esnext"], "module": "esnext", "moduleResolution": "node", "noImplicitAny": true,