From 9da77637b22d4ce294449f4ee6540d97645b2d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Tue, 5 Mar 2024 15:48:58 +0100 Subject: [PATCH] chore: bump to eslint-config `v2.8.0` (#2651) Co-authored-by: Anthony Fu --- .eslintignore | 15 - .eslintrc | 19 - .github/ISSUE_TEMPLATE/feature_request.md | 2 +- .vscode/settings.json | 45 +- CONTRIBUTING.md | 3 +- README.md | 11 +- components/account/AccountHoverWrapper.vue | 3 +- components/common/CommonScrollIntoView.vue | 6 +- .../NotificationPreferences.client.vue | 4 +- components/publish/PublishWidget.vue | 12 +- components/settings/SettingsItem.vue | 12 +- .../settings/SettingsProfileMetadata.vue | 3 +- components/status/StatusReplyingTo.vue | 3 +- components/status/StatusSpoiler.vue | 7 +- composables/command.ts | 3 +- composables/content-parse.ts | 5 +- composables/i18n.ts | 6 +- composables/magickeys.ts | 6 +- composables/masto/publish.ts | 35 +- composables/masto/statusDrafts.ts | 2 +- composables/masto/translate.ts | 7 +- .../createPushSubscription.ts | 6 +- .../push-notifications/usePushManager.ts | 5 +- composables/shiki.ts | 5 +- composables/tiptap/custom-emoji.ts | 6 +- composables/tiptap/emoji.ts | 14 +- config/i18n.config.ts | 3 +- docs/README.md | 2 +- docs/components/global/Logo.vue | 6 +- docs/components/global/TranslationState.vue | 4 +- docs/content/1.guide/1.index.md | 2 - docs/content/1.guide/2.features.md | 2 - docs/content/1.guide/3.contributing.md | 2 +- docs/content/80.pwa.md | 4 +- docs/content/99.privacy.md | 1 - docs/netlify.toml | 12 +- eslint.config.js | 37 + modules/emoji-mart-translation.ts | 3 +- modules/pwa/config.ts | 4 +- modules/pwa/runtime/pwa-plugin.client.ts | 3 +- modules/tauri/runtime/logging.client.ts | 3 +- netlify.toml | 12 +- nuxt.config.ts | 51 +- package.json | 6 +- pages/[[server]]/public/local.vue | 1 - pnpm-lock.yaml | 995 +++++++++++------- service-worker/share-target.ts | 5 +- service-worker/sw.ts | 4 +- 48 files changed, 896 insertions(+), 511 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc create mode 100644 eslint.config.js diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index f082429a..00000000 --- a/.eslintignore +++ /dev/null @@ -1,15 +0,0 @@ -*.css -*.png -*.ico -*.toml -*.patch -*.txt -Dockerfile -public/ -public-dev/ -public-staging/ -https-dev-config/localhost.crt -https-dev-config/localhost.key -Dockerfile -elk-translation-status.json -docs/translation-status.json diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 3319c362..00000000 --- a/.eslintrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "@antfu", - "ignorePatterns": ["!pages/public"], - "overrides": [ - { - "files": ["locales/**.json"], - "rules": { - "jsonc/sort-keys": "error" - } - } - ], - "rules": { - "vue/no-restricted-syntax":["error", { - "selector": "VElement[name='a']", - "message": "Use NuxtLink instead." - }], - "n/prefer-global/process": "off" - } -} diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 1bf9f7fc..20d6dc32 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,4 +2,4 @@ name: 🚀 New feature proposal about: Propose a new feature labels: 's: pending triage' ---- \ No newline at end of file +--- diff --git a/.vscode/settings.json b/.vscode/settings.json index 4b6c677a..bd7e45ee 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,10 +5,6 @@ "unmute", "unstorage" ], - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true - }, - "editor.formatOnSave": false, "files.associations": { "*.css": "postcss" }, @@ -23,7 +19,44 @@ "i18n-ally.preferredDelimiter": "_", "i18n-ally.sortKeys": true, "i18n-ally.sourceLanguage": "en", + + // Enable the ESlint flat config support + "eslint.experimental.useFlatConfig": true, + + // Disable the default formatter, use eslint instead "prettier.enable": false, - "volar.completion.preferredTagNameCase": "pascal", - "volar.completion.preferredAttrNameCase": "kebab" + "editor.formatOnSave": false, + + // Auto fix + "editor.codeActionsOnSave": { + "source.fixAll": "explicit", + "source.organizeImports": "never" + }, + + // Silent the stylistic rules in you IDE, but still auto fix them + "eslint.rules.customizations": [ + { "rule": "style/*", "severity": "off" }, + { "rule": "*-indent", "severity": "off" }, + { "rule": "*-spacing", "severity": "off" }, + { "rule": "*-spaces", "severity": "off" }, + { "rule": "*-order", "severity": "off" }, + { "rule": "*-dangle", "severity": "off" }, + { "rule": "*-newline", "severity": "off" }, + { "rule": "*quotes", "severity": "off" }, + { "rule": "*semi", "severity": "off" } + ], + + // Enable eslint for all supported languages + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "html", + "markdown", + "json", + "jsonc", + "yaml" + ] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2b764eac..d8ff4289 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,7 @@ For guidelines on contributing to the documentation, refer to the [docs README]( ### Online -You can use [StackBlitz Codeflow](https://stackblitz.com/codeflow) to fix bugs or implement features. You'll also see a Codeflow button on PRs to review them without a local setup. Once the elk repo has been cloned in Codeflow, the dev server will start automatically and print the URL to open the App. You should receive a prompt in the bottom-right suggesting to open it in the Editor or in another Tab. To learn more, check out the [Codeflow docs](https://developer.stackblitz.com/codeflow/what-is-codeflow). +You can use [StackBlitz Codeflow](https://stackblitz.com/codeflow) to fix bugs or implement features. You'll also see a Codeflow button on PRs to review them without a local setup. Once the elk repo has been cloned in Codeflow, the dev server will start automatically and print the URL to open the App. You should receive a prompt in the bottom-right suggesting to open it in the Editor or in another Tab. To learn more, check out the [Codeflow docs](https://developer.stackblitz.com/codeflow/what-is-codeflow). [![Open in Codeflow](https://developer.stackblitz.com/img/open_in_codeflow.svg)](https://pr.new/elk-zone/elk) @@ -21,7 +21,6 @@ To develop and test the Elk package: 2. Ensure using the latest Node.js (16.x). If you have [nvm](https://github.com/nvm-sh/nvm), you can run `nvm i` to install the required version. - 3. The package manager used to install and link dependencies must be [pnpm](https://pnpm.io/) v7. To use it you must first enable [Corepack](https://github.com/nodejs/corepack) by running `corepack enable`. (Note: on Linux in a standard Node 16+ environment, you should follow the instructions to install via Node's `corepack` rather than using the `curl` command) 4. Check out a branch where you can work and commit your changes: diff --git a/README.md b/README.md index 0a37b5d5..b85ee926 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ The Elk team maintains a deployment at: ### Self-Host Docker Deployment -In order to host Elk yourself you can use the provided Dockerfile to build a container with elk. Be aware, that Elk only loads properly if the connection is done via SSL/TLS. The Docker container itself does not provide any SSL/TLS handling. You'll have to add this bit yourself. -One could put Elk behind popular reverse proxies with SSL Handling like Traefik, NGINX etc. +In order to host Elk yourself you can use the provided Dockerfile to build a container with elk. Be aware, that Elk only loads properly if the connection is done via SSL/TLS. The Docker container itself does not provide any SSL/TLS handling. You'll have to add this bit yourself. +One could put Elk behind popular reverse proxies with SSL Handling like Traefik, NGINX etc. 1. checkout source ```git clone https://github.com/elk-zone/elk.git``` 1. got into new source dir: ```cd elk``` @@ -52,7 +52,6 @@ One could put Elk behind popular reverse proxies with SSL Handling like Traefik, > [!NOTE] > The provided Dockerfile creates a container which will eventually run Elk as non-root user and create a persistent named Docker volume upon first start (if that volume does not yet exist). This volume is always created with root permission. Failing to change the permissions of ```/elk/data``` inside this volume to UID:GID 911 (as specified for Elk in the Dockerfile) will prevent Elk from storing it's config for user accounts. You either have to fix the permission in the created named volume, or mount a directory with the correct permission to ```/elk/data``` into the container. - ### Ecosystem These are known deployments using Elk as an alternative Web client for Mastodon servers or as a base for other projects in the fediverse: @@ -107,7 +106,7 @@ We're really excited that you're interested in contributing to Elk! Before submi ### Online -You can use [StackBlitz Codeflow](https://stackblitz.com/codeflow) to fix bugs or implement features. You'll also see a Codeflow button on PRs to review them without a local setup. Once the elk repo has been cloned in Codeflow, the dev server will start automatically and print the URL to open the App. You should receive a prompt in the bottom-right suggesting to open it in the Editor or in another Tab. To learn more, check out the [Codeflow docs](https://developer.stackblitz.com/codeflow/what-is-codeflow). +You can use [StackBlitz Codeflow](https://stackblitz.com/codeflow) to fix bugs or implement features. You'll also see a Codeflow button on PRs to review them without a local setup. Once the elk repo has been cloned in Codeflow, the dev server will start automatically and print the URL to open the App. You should receive a prompt in the bottom-right suggesting to open it in the Editor or in another Tab. To learn more, check out the [Codeflow docs](https://developer.stackblitz.com/codeflow/what-is-codeflow). [![Open in Codeflow](https://developer.stackblitz.com/img/open_in_codeflow.svg)](https://pr.new/elk-zone/elk) @@ -158,8 +157,8 @@ You can consult the [PWA documentation](https://docs.elk.zone/pwa) to learn more ## 👨‍💻 Contributors - - + + ## 📄 License diff --git a/components/account/AccountHoverWrapper.vue b/components/account/AccountHoverWrapper.vue index 13ba07e7..36f63e2b 100644 --- a/components/account/AccountHoverWrapper.vue +++ b/components/account/AccountHoverWrapper.vue @@ -43,7 +43,8 @@ watch( } account.value = undefined - }, { immediate: true, flush: 'post' }, + }, + { immediate: true, flush: 'post' }, ) const userSettings = useUserSettings() diff --git a/components/common/CommonScrollIntoView.vue b/components/common/CommonScrollIntoView.vue index 1370815c..841f8484 100644 --- a/components/common/CommonScrollIntoView.vue +++ b/components/common/CommonScrollIntoView.vue @@ -1,5 +1,9 @@ diff --git a/components/status/StatusSpoiler.vue b/components/status/StatusSpoiler.vue index 4b6f0632..ff6149b6 100644 --- a/components/status/StatusSpoiler.vue +++ b/components/status/StatusSpoiler.vue @@ -1,5 +1,10 @@