From 54e5146f9f7cc1cecdc0a254496dd96b754daae0 Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Sat, 6 Feb 2021 10:14:53 +0100 Subject: [PATCH] prettier: mirror chessground scripts and more excludes --- .github/workflows/lint.yml | 16 ++---------- .prettierignore | 20 ++++++++++++-- .prettierrc | 14 ---------- .prettierrc.json | 5 ++++ COPYING.md | 53 ++++++++++++++++++-------------------- package.json | 5 ++-- 6 files changed, 52 insertions(+), 61 deletions(-) delete mode 100644 .prettierrc create mode 100644 .prettierrc.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7e23248fc1..666b67dfec 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,22 +1,10 @@ name: Lint code -on: - push: - pull_request: +on: [push, pull_request] jobs: lint: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v1 - - - name: Setup Node.js 14.x - uses: actions/setup-node@v1 - with: - node-version: 14.x - - - name: Install and lint - run: | - yarn - yarn lint + - run: yarn install && yarn run check-format diff --git a/.prettierignore b/.prettierignore index ea78de8774..ccec3aef38 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,18 @@ -public/vendor/ -public/javascript/vendor/ +modules +app +public +project + +dist/ +ui/common/**/*.js +ui/common/**/*.d.ts +ui/game/**/*.js +ui/game/**/*.d.ts +ui/nvui/**/*.js +ui/nvui/**/*.d.ts + +*.min.js + +.bloop/ +.bsp/ +.metals/ diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 1154726c26..0000000000 --- a/.prettierrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "arrowParens": "avoid", - "proseWrap": "never", - "quoteProps": "consistent", - "trailingComma": "all", - "overrides": [ - { - "files": "*.{json}", - "options": { - "printWidth": 1000 - } - } - ] -} diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000000..4a955966ff --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "printWidth": 120, + "arrowParens": "avoid" +} diff --git a/COPYING.md b/COPYING.md index 2054e5141e..2f8d5157b0 100644 --- a/COPYING.md +++ b/COPYING.md @@ -1,5 +1,4 @@ -Copying Lila -============ +# Copying Lila Any file in this project that does not state otherwise and is not listed as an exception below is part of lila and copyright (c) 2012-2019 the lila authors. @@ -17,22 +16,21 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -See the LICENSE file for a copy of the *GNU Affero General Public License*. +See the LICENSE file for a copy of the _GNU Affero General Public License_. -Additional permission under GNU AGPL version 3 section 7 --------------------------------------------------------- +## Additional permission under GNU AGPL version 3 section 7 If you modify this Program, or any covered work, by linking or combining it with Highcharts (or a modified version of that library), containing parts -covered by the terms of the *Creative Commons (CC) Attribution-NonCommercial* +covered by the terms of the _Creative Commons (CC) Attribution-NonCommercial_ licence, the licensors of this Program grant you additional permission to convey the resulting work. Corresponding Source for a non-source form of such a combination shall include the source code for the parts of Highcharts used as well as that of the covered work. -Exceptions (free) ------------------ +## Exceptions (free) + Files | Author(s) | License --- | --- | --- public/font/lichess.{sfd,woff,woff2} | [Dave Gandy](http://fontawesome.io/), [GitHub](https://github.com/primer/octicons), [Webalys](http://www.webalys.com/), [Zurb](http://zurb.com/playground/foundation-icon-fonts-3), [Daniel Bruce](http://www.entypo.com/), [Shapemade](http://steadysets.com/), [Sergey Shmidt](http://designmodo.com/linecons-free/) and the Lichess authors | [OFL](http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL), [MIT](https://github.com/primer/octicons/blob/master/LICENSE), [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/), AGPLv3+ @@ -70,9 +68,9 @@ public/sounds/nes | [Enigmahack](https://github.com/Enigmahack) | AGPLv3+ public/sounds/piano | [Enigmahack](https://github.com/Enigmahack) | AGPLv3+ public/sounds/sfx | [Enigmahack](https://github.com/Enigmahack) | AGPLv3+ -Exceptions (non-free) ---------------------- +## Exceptions (non-free) + Files | Author(s) | License --- | --- | --- public/logo, public/favicon.ico, public/apple-touch-icon.png | [sadsnake1](https://github.com/sadsnake1) | Only use to refer to lichess.org @@ -86,25 +84,24 @@ public/piece/reillycraig | [Reilly Craig](https://instagram.com/fader_) | public/piece/riohacha | | public/images/staunton/piece/Staunton | [Eden Murs](https://userstyles.org/styles/134558/lichess-pieces-3d-staunton) (?) | -* The other sounds in public/sound. -* The other artwork in public/images. +- The other sounds in public/sound. +- The other artwork in public/images. -External services ------------------ +## External services Lichess as deployed on https://lichess.org/ also uses these external services: -* [Cloudflare](https://www.cloudflare.com/) to serve static assets, DNS lookups for email validation -* [Mailgun](https://www.mailgun.com/) for transactional email -* [prismic.io](https://prismic.io/) for help/documentation pages and the blog -* [twitch](https://www.twitch.tv/) for featured livestreams -* [YouTube](https://www.youtube.com) for featured livestreams and the [Video library](https://lichess.org/video) -* [stripe](https://stripe.com/) and [PayPal](https://www.paypal.com) for [Patron donations](https://lichess.org/patron) -* [Spreadshirt](https://shop.spreadshirt.com/lichess-org) for the [Swag store](https://lichess.org/swag) -* [check.torproject.org](https://check.torproject.org/exit-addresses) for a list or Tor exit nodes -* [detectlanguage.com](https://detectlanguage.com/) -* Fallback to [Google Fonts](https://fonts.google.com/) -* [Google Cloud Messaging](https://developers.google.com/cloud-messaging/) and [OneSignal](https://onesignal.com/) for mobile notifications -* [reCAPTCHA](https://www.google.com/recaptcha/) -* [PeerJS](https://peerjs.com/) for voice chat -* [crowdin](https://crowdin.com/project/lichess) for localization +- [Cloudflare](https://www.cloudflare.com/) to serve static assets, DNS lookups for email validation +- [Mailgun](https://www.mailgun.com/) for transactional email +- [prismic.io](https://prismic.io/) for help/documentation pages and the blog +- [twitch](https://www.twitch.tv/) for featured livestreams +- [YouTube](https://www.youtube.com) for featured livestreams and the [Video library](https://lichess.org/video) +- [stripe](https://stripe.com/) and [PayPal](https://www.paypal.com) for [Patron donations](https://lichess.org/patron) +- [Spreadshirt](https://shop.spreadshirt.com/lichess-org) for the [Swag store](https://lichess.org/swag) +- [check.torproject.org](https://check.torproject.org/exit-addresses) for a list or Tor exit nodes +- [detectlanguage.com](https://detectlanguage.com/) +- Fallback to [Google Fonts](https://fonts.google.com/) +- [Google Cloud Messaging](https://developers.google.com/cloud-messaging/) and [OneSignal](https://onesignal.com/) for mobile notifications +- [reCAPTCHA](https://www.google.com/recaptcha/) +- [PeerJS](https://peerjs.com/) for voice chat +- [crowdin](https://crowdin.com/project/lichess) for localization diff --git a/package.json b/package.json index f1e40337b6..0f259294d8 100644 --- a/package.json +++ b/package.json @@ -26,9 +26,8 @@ "xml2js": "0.4.19" }, "scripts": { - "format": "yarn prettier --write", - "lint": "yarn prettier --list-different", - "prettier": "prettier \"**/*.{ts,js,json,md,scss,yaml,yml}\"" + "format": "prettier --write .", + "check-format": "prettier --check ." }, "workspaces": [ "ui",