From e47dcf598355ac88fbd0362132b90f06b2dd3a35 Mon Sep 17 00:00:00 2001 From: Marc Lorenz Date: Tue, 24 Mar 2026 11:27:56 +0100 Subject: [PATCH] add linters and fix build --- .oxlintrc.json | 10 ++++++++++ .prettierrc.json | 6 ++++++ eslint.config.ts | 26 ++++++++++++++++++++++++++ src/components/LimelightButton.vue | 4 +--- src/utils/webviewer.ts | 3 +++ 5 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 .oxlintrc.json create mode 100644 .prettierrc.json create mode 100644 eslint.config.ts diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 0000000..d5648b9 --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,10 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["eslint", "typescript", "unicorn", "oxc", "vue"], + "env": { + "browser": true + }, + "categories": { + "correctness": "error" + } +} diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..334a585 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "semi": true, + "singleQuote": true, + "printWidth": 100 +} diff --git a/eslint.config.ts b/eslint.config.ts new file mode 100644 index 0000000..89fdc89 --- /dev/null +++ b/eslint.config.ts @@ -0,0 +1,26 @@ +import { globalIgnores } from 'eslint/config' +import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript' +import pluginVue from 'eslint-plugin-vue' +import pluginOxlint from 'eslint-plugin-oxlint' +import skipFormatting from 'eslint-config-prettier/flat' + +// To allow more languages other than `ts` in `.vue` files, uncomment the following lines: +// import { configureVueProject } from '@vue/eslint-config-typescript' +// configureVueProject({ scriptLangs: ['ts', 'tsx'] }) +// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup + +export default defineConfigWithVueTs( + { + name: 'app/files-to-lint', + files: ['**/*.{vue,ts,mts,tsx}'], + }, + + globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']), + + ...pluginVue.configs['flat/essential'], + vueTsConfigs.recommended, + + ...pluginOxlint.buildFromOxlintConfigFile('.oxlintrc.json'), + + skipFormatting, +) diff --git a/src/components/LimelightButton.vue b/src/components/LimelightButton.vue index cba750a..31ce210 100644 --- a/src/components/LimelightButton.vue +++ b/src/components/LimelightButton.vue @@ -10,7 +10,6 @@