From f8e2f64316354b36099a01eef0735ec0970f5b99 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Wed, 26 Mar 2025 19:40:28 +0100 Subject: frontend: Migrate to eslint-plugin-svelte 3.0 This includes a migration to a flat eslint.config.js, which will now also automatically ignore items from .gitignore. eslint-plugin-svelte 3.0 comes with a couple of changes to recommended rules as well, these are also addressed in this commit. --- frontend/eslint.config.mjs | 99 ---------------------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 frontend/eslint.config.mjs (limited to 'frontend/eslint.config.mjs') diff --git a/frontend/eslint.config.mjs b/frontend/eslint.config.mjs deleted file mode 100644 index 9e842a8..0000000 --- a/frontend/eslint.config.mjs +++ /dev/null @@ -1,99 +0,0 @@ -import { FlatCompat } from '@eslint/eslintrc'; -import js from '@eslint/js'; -import typescriptEslint from '@typescript-eslint/eslint-plugin'; -import tsParser from '@typescript-eslint/parser'; -import globals from 'globals'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; -import parser from 'svelte-eslint-parser'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); -const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all -}); - -export default [ - { - ignores: [ - '**/*.cjs', - '**/.DS_Store', - '**/node_modules', - 'build', - '.svelte-kit', - 'package', - '**/.env', - '**/.env.*', - '!**/.env.example', - 'coverage', - '**/pnpm-lock.yaml', - '**/package-lock.json', - '**/yarn.lock', - 'src/gql', - 'eslint.config.mjs' - ] - }, - ...compat.extends( - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended-type-checked', - 'plugin:@typescript-eslint/stylistic-type-checked', - 'plugin:svelte/recommended', - 'prettier' - ), - { - plugins: { - '@typescript-eslint': typescriptEslint - }, - - languageOptions: { - globals: { - ...globals.browser, - ...globals.node - }, - - parser: tsParser, - ecmaVersion: 2022, - sourceType: 'module', - - parserOptions: { - extraFileExtensions: ['.svelte'], - project: true, - tsconfigRootDir: '/home/wolf/src/wolf/hircine/frontend' - } - }, - - rules: { - 'no-console': 'warn', - eqeqeq: 'error' - } - }, - { - files: ['**/*.svelte'], - - languageOptions: { - parser: parser, - ecmaVersion: 5, - sourceType: 'script', - - parserOptions: { - parser: '@typescript-eslint/parser' - } - }, - - rules: { - '@typescript-eslint/no-unsafe-argument': 'off', - '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/no-unsafe-call': 'off', - '@typescript-eslint/no-unsafe-enum-comparison': 'off', - '@typescript-eslint/no-unsafe-member-access': 'off', - '@typescript-eslint/no-unused-expressions': 'off', - 'no-undef': 'off' - } - }, - ...compat.extends('plugin:@typescript-eslint/disable-type-checked').map((config) => ({ - ...config, - files: ['**/codegen.ts', '**/svelte.config.js'] - })) -]; -- cgit v1.2.3-2-gb3c3