From f98f8600347171f07fdebeca156c4f1ecc84a4b9 Mon Sep 17 00:00:00 2001 From: hensm Date: Fri, 3 Jun 2022 16:45:44 +0100 Subject: [PATCH] Fix svelte linting --- .eslintrc.json | 23 +++- .prettierrc.json | 3 +- ext/.eslintrc.json | 5 + ext/src/ui/options/Options.svelte | 2 +- ext/src/ui/popup/Popup.svelte | 4 - package-lock.json | 184 ++++++++++++++++++------------ package.json | 8 +- 7 files changed, 141 insertions(+), 88 deletions(-) create mode 100644 ext/.eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json index 53d96b6..69b7cf1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,7 +1,7 @@ { "root": true, "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint"], + "plugins": ["@typescript-eslint", "svelte3"], "extends": ["eslint:recommended", "prettier"], "rules": { "no-useless-escape": "off", @@ -16,7 +16,9 @@ } ] }, - + "parserOptions": { + "extraFileExtensions": ".svelte" + }, "overrides": [ { "files": ["*/bin/**/*.js"], @@ -25,7 +27,14 @@ } }, { - "files": ["**/*.ts", "**/*.tsx"], + "files": ["ext/**/*.svelte"], + "processor": "svelte3/svelte3", + "rules": { + "no-undef": "off" + } + }, + { + "files": ["**/*.ts"], "extends": "plugin:@typescript-eslint/recommended", "rules": { "@typescript-eslint/no-empty-interface": "off", @@ -41,8 +50,12 @@ { "allowedNames": ["this_"] } - ] + ], + "no-undef": "off" } } - ] + ], + "settings": { + "svelte3/typescript": true + } } diff --git a/.prettierrc.json b/.prettierrc.json index 0ad740f..f018e5c 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -2,5 +2,6 @@ "arrowParens": "avoid", "tabWidth": 4, "trailingComma": "none", - "quoteProps": "consistent" + "quoteProps": "consistent", + "plugins": ["prettier-plugin-svelte"] } diff --git a/ext/.eslintrc.json b/ext/.eslintrc.json new file mode 100644 index 0000000..b99c111 --- /dev/null +++ b/ext/.eslintrc.json @@ -0,0 +1,5 @@ +{ + "env": { + "browser": true + } +} diff --git a/ext/src/ui/options/Options.svelte b/ext/src/ui/options/Options.svelte index 13f65d1..b168602 100644 --- a/ext/src/ui/options/Options.svelte +++ b/ext/src/ui/options/Options.svelte @@ -1,5 +1,5 @@