From 271a88e3a08a1d821679182966102027647c5f05 Mon Sep 17 00:00:00 2001 From: Niek van der Maas Date: Mon, 20 Mar 2023 15:35:03 +0100 Subject: [PATCH 1/3] Actually run linter on .svelte files --- .eslintrc.cjs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index d2f5af4..7182233 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,13 +1,25 @@ module.exports = { - extends: 'standard-with-typescript', parser: '@typescript-eslint/parser', - parserOptions: { // add these parser options - project: ['./tsconfig.json'] + parserOptions: { + tsconfigRootDir: __dirname, + project: ['./tsconfig.json'], + extraFileExtensions: ['.svelte'] }, + extends: ['standard-with-typescript'], plugins: [ 'svelte3', '@typescript-eslint' ], + // Disable these rules: import/first, import/no-duplicates, import/no-mutable-exports, import/no-unresolved, import/prefer-default-export + // Reference: https://github.com/sveltejs/eslint-plugin-svelte3/blob/master/OTHER_PLUGINS.md#eslint-plugin-import + rules: { + 'import/first': 'off', + 'import/no-duplicates': 'off', + 'import/no-mutable-exports': 'off', + 'import/no-unresolved': 'off', + 'import/prefer-default-export': 'off', + 'no-multiple-empty-lines': ['error', { max: 2, maxBOF: 2, maxEOF: 0 }] // See: https://github.com/sveltejs/eslint-plugin-svelte3/issues/41 + }, overrides: [ { files: [ From 5fb12c1f41d6f1c1009ef640fec2035f4aa89946 Mon Sep 17 00:00:00 2001 From: Niek van der Maas Date: Mon, 20 Mar 2023 15:35:07 +0100 Subject: [PATCH 2/3] Linting --- src/App.svelte | 22 +-- src/lib/Chat.svelte | 330 ++++++++++++++++++++--------------------- src/lib/Code.svelte | 118 +++++++-------- src/lib/Export.svelte | 42 +++--- src/lib/Sidebar.svelte | 32 ++-- src/lib/Storage.svelte | 70 ++++----- src/lib/Types.svelte | 50 +++---- 7 files changed, 332 insertions(+), 332 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 20c4a14..5bcf594 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,20 +1,20 @@ diff --git a/src/lib/Chat.svelte b/src/lib/Chat.svelte index f9ae94f..ce69fda 100644 --- a/src/lib/Chat.svelte +++ b/src/lib/Chat.svelte @@ -1,7 +1,7 @@