From 9049c166b49fc6f94a093dcf5fe15b5caf0a2926 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Fri, 31 Jan 2020 19:40:30 +0800 Subject: [PATCH] Run prettier on more supported files (#7456) --- .azure-pipelines/jobs/dev-lint.yml | 4 +- .github/ISSUE_TEMPLATE/formatting.md | 3 + .github/ISSUE_TEMPLATE/integration.md | 2 + .github/workflows/lint.yml | 5 +- .prettierignore | 7 + package.json | 2 +- website/data/languages.yml | 44 +++---- website/pages/googlefe164a33bda4034b.html | 2 +- website/pages/playground-redirect.html | 4 +- website/pages/playground/index.html | 153 ++++++++++++---------- website/sidebars.json | 17 +-- website/static/overrides.css | 2 +- website/versions.json | 4 +- 13 files changed, 132 insertions(+), 117 deletions(-) diff --git a/.azure-pipelines/jobs/dev-lint.yml b/.azure-pipelines/jobs/dev-lint.yml index 2e61d195c..a72082874 100644 --- a/.azure-pipelines/jobs/dev-lint.yml +++ b/.azure-pipelines/jobs/dev-lint.yml @@ -7,8 +7,8 @@ steps: displayName: "Check JSDoc types" - script: yarn lint displayName: "Lint code" - - script: yarn lint-docs - displayName: "Lint docs" + - script: yarn lint-prettier + displayName: "Lint prettier" - script: yarn spellcheck displayName: "Spellcheck" - script: yarn && echo "Listing changed files:" && git diff --name-only --exit-code && echo "No files changed during lint." diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index 5de791af3..38648d8a7 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -28,17 +28,20 @@ Tip! Don't write this stuff manually. **Prettier 1.19.1** [Playground link](https://prettier.io/playground/#.....) + ```sh # Options (if any): --single-quote ``` **Input:** + ```jsx // code snippet ``` **Output:** + ```jsx // code snippet ``` diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index ac867bf61..4e0269d7b 100644 --- a/.github/ISSUE_TEMPLATE/integration.md +++ b/.github/ISSUE_TEMPLATE/integration.md @@ -19,12 +19,14 @@ BEFORE SUBMITTING AN ISSUE: --> **Environments:** + - Prettier Version: 1.19.1 - Running Prettier via: - Runtime: - Operating System: **Steps to reproduce:** + **Expected behavior:** diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6fd4095e7..f9af900e5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,12 +29,11 @@ jobs: - name: Lint code run: yarn lint - - name: Lint docs - run: yarn lint-docs + - name: Lint prettier + run: yarn lint-prettier - name: Spellcheck run: yarn spellcheck - name: Check file changes run: yarn && echo "Listing changed files:" && git diff --name-only --exit-code && echo "No files changed during lint." - diff --git a/.prettierignore b/.prettierignore index b62d4d2b8..f306015e3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,9 @@ dist/ +.cache/ +coverage/ +/tests/ +!/tests/**/jsfmt.spec.js +/tests_integration/cli/ +/tests_integration/plugins/ +/website/build/ cspell.json diff --git a/package.json b/package.json index 156ef8449..8df0dbdfc 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "check-types": "tsc", "lint": "cross-env EFF_NO_LINK_RULES=true eslint . --format friendly", "lint-changelog": "node ./scripts/lint-changelog.js", - "lint-docs": "prettier {.,docs,website,website/blog,changelog_unreleased,changelog_unreleased/*}/*.md --check", + "lint-prettier": "prettier \"**/*.{md,json,yml,html,css}\" --check", "lint-dist": "eslint --no-eslintrc --no-ignore --env=es6,browser \"dist/!(bin-prettier|index|third-party).js\"", "build": "node --max-old-space-size=3072 ./scripts/build/build.js", "build-docs": "node ./scripts/build-docs.js", diff --git a/website/data/languages.yml b/website/data/languages.yml index 0c31c7970..ea9615ce2 100644 --- a/website/data/languages.yml +++ b/website/data/languages.yml @@ -2,37 +2,37 @@ showName: true image: /images/languages/tools_js.svg variants: - - "[JSX](https://facebook.github.io/jsx/)" - - "[Flow](https://flow.org)" - - "[TypeScript](https://www.typescriptlang.org)" - - "[JSON](https://json.org)" + - "[JSX](https://facebook.github.io/jsx/)" + - "[Flow](https://flow.org)" + - "[TypeScript](https://www.typescriptlang.org)" + - "[JSON](https://json.org)" - name: HTML showName: true image: /images/languages/tools_html.svg variants: - - "[Vue](https://vuejs.org)" - - "[Angular](https://angular.io)" + - "[Vue](https://vuejs.org)" + - "[Angular](https://angular.io)" - name: CSS showName: true image: /images/languages/tools_css.svg variants: - - "[Less](http://lesscss.org)" - - "[SCSS](https://sass-lang.com)" - - "[`styled-components`](https://styled-components.com) 💅" - - "[`styled-jsx`](https://npmjs.com/styled-jsx)" + - "[Less](http://lesscss.org)" + - "[SCSS](https://sass-lang.com)" + - "[`styled-components`](https://styled-components.com) 💅" + - "[`styled-jsx`](https://npmjs.com/styled-jsx)" - name: GraphQL nameLink: https://graphql.org showName: true image: /images/languages/tools_gql.svg variants: - - "[GraphQL Schemas](https://graphql.org/learn/schema/)" + - "[GraphQL Schemas](https://graphql.org/learn/schema/)" - name: Markdown showName: true image: /images/languages/tools_md.svg variants: - - "[CommonMark](https://commonmark.org)" - - "[GitHub-Flavored Markdown](https://github.github.com/gfm/)" - - "[MDX](https://mdxjs.com)" + - "[CommonMark](https://commonmark.org)" + - "[GitHub-Flavored Markdown](https://github.github.com/gfm/)" + - "[MDX](https://mdxjs.com)" - name: YAML nameLink: https://yaml.org showName: true @@ -42,11 +42,11 @@ showName: true image: /images/languages/tools_wip.svg variants: - - "[Elm](https://github.com/gicentre/prettier-plugin-elm) (via [`elm-format`](https://github.com/avh4/elm-format))" - - "[Java](https://github.com/jhipster/prettier-java)" - - "[PHP](https://github.com/prettier/plugin-php)" - - "[PostgreSQL](https://github.com/benjie/prettier-plugin-pg-sql/)" - - "[Ruby](https://github.com/prettier/plugin-ruby)" - - "[Swift](https://github.com/prettier/plugin-swift)" - - "[TOML](https://github.com/bd82/toml-tools/tree/master/packages/prettier-plugin-toml)" - - "[XML](https://github.com/prettier/plugin-xml)" + - "[Elm](https://github.com/gicentre/prettier-plugin-elm) (via [`elm-format`](https://github.com/avh4/elm-format))" + - "[Java](https://github.com/jhipster/prettier-java)" + - "[PHP](https://github.com/prettier/plugin-php)" + - "[PostgreSQL](https://github.com/benjie/prettier-plugin-pg-sql/)" + - "[Ruby](https://github.com/prettier/plugin-ruby)" + - "[Swift](https://github.com/prettier/plugin-swift)" + - "[TOML](https://github.com/bd82/toml-tools/tree/master/packages/prettier-plugin-toml)" + - "[XML](https://github.com/prettier/plugin-xml)" diff --git a/website/pages/googlefe164a33bda4034b.html b/website/pages/googlefe164a33bda4034b.html index ddbd1a531..ce6b15ff1 100644 --- a/website/pages/googlefe164a33bda4034b.html +++ b/website/pages/googlefe164a33bda4034b.html @@ -1 +1 @@ -google-site-verification: googlefe164a33bda4034b.html \ No newline at end of file +google-site-verification: googlefe164a33bda4034b.html diff --git a/website/pages/playground-redirect.html b/website/pages/playground-redirect.html index 89add823e..3146524c1 100644 --- a/website/pages/playground-redirect.html +++ b/website/pages/playground-redirect.html @@ -26,9 +26,7 @@ ); } else { const el = document.createElement("p"); - el.textContent = `The referrer URL (${ - document.referrer - }) was not recognized. Sorry :(`; + el.textContent = `The referrer URL (${document.referrer}) was not recognized. Sorry :(`; document.body.appendChild(el); } diff --git a/website/pages/playground/index.html b/website/pages/playground/index.html index 09da42cae..fe111e8fc 100644 --- a/website/pages/playground/index.html +++ b/website/pages/playground/index.html @@ -1,82 +1,101 @@ - + - - - - Prettier + + + + Prettier - + - - - - - - - - - + + + + + + + + + - - + + - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - - - - + + + + - -
- - -

Prettier

-
- - - - GitHub + +
+ + +

Prettier

- -
-
+ + + GitHub + + +
- +
- + - - + + + + diff --git a/website/sidebars.json b/website/sidebars.json index 121100e41..ac70b94e0 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -18,19 +18,8 @@ "integrating-with-linters", "ignore" ], - "Configuring Prettier": [ - "options", - "configuration" - ], - "Editors": [ - "editors", - "webstorm", - "vim" - ], - "Misc": [ - "technical-details", - "related-projects", - "for-enterprise" - ] + "Configuring Prettier": ["options", "configuration"], + "Editors": ["editors", "webstorm", "vim"], + "Misc": ["technical-details", "related-projects", "for-enterprise"] } } diff --git a/website/static/overrides.css b/website/static/overrides.css index 96201a980..12f1d7b73 100644 --- a/website/static/overrides.css +++ b/website/static/overrides.css @@ -377,7 +377,7 @@ em { .usersSection a:hover { color: white !important; } -.usersSection .alignCenter{ +.usersSection .alignCenter { display: flex; align-items: center; } diff --git a/website/versions.json b/website/versions.json index f04c01410..81304d20b 100644 --- a/website/versions.json +++ b/website/versions.json @@ -1,3 +1 @@ -[ - "stable" -] +["stable"]