diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 197ef63..0000000 --- a/.eslintignore +++ /dev/null @@ -1,15 +0,0 @@ -.DS_Store -node_modules -/build -/.svelte-kit -/package -.env -.env.* -!.env.example - -# Ignore files for PNPM, NPM and YARN -pnpm-lock.yaml -package-lock.json -yarn.lock - -.fonts \ No newline at end of file diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index b747c65..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,26 +0,0 @@ -/** @type { import("eslint").Linter.FlatConfig } */ -module.exports = { - root: true, - extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:svelte/recommended', 'prettier'], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - parserOptions: { - sourceType: 'module', - ecmaVersion: 2020, - extraFileExtensions: ['.svelte'] - }, - env: { - browser: true, - es2017: true, - node: true - }, - overrides: [ - { - files: ['*.svelte'], - parser: 'svelte-eslint-parser', - parserOptions: { - parser: '@typescript-eslint/parser' - } - } - ] -}; diff --git a/bun.lockb b/bun.lockb index 810ef71..d850796 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..c838826 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,74 @@ +import typescriptEslint from '@typescript-eslint/eslint-plugin'; +import globals from 'globals'; +import tsParser from '@typescript-eslint/parser'; +import parser from 'svelte-eslint-parser'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import js from '@eslint/js'; +import { FlatCompat } from '@eslint/eslintrc'; + +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: [ + '**/.DS_Store', + '**/node_modules', + 'build', + '.svelte-kit', + 'package', + '**/.env', + '**/.env.*', + '!**/.env.example', + '**/pnpm-lock.yaml', + '**/package-lock.json', + '**/yarn.lock', + '**/.fonts' + ] + }, + ...compat.extends( + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:svelte/recommended', + 'prettier' + ), + { + plugins: { + '@typescript-eslint': typescriptEslint + }, + + languageOptions: { + globals: { + ...globals.browser, + ...globals.node + }, + + parser: tsParser, + ecmaVersion: 2020, + sourceType: 'module', + + parserOptions: { + extraFileExtensions: ['.svelte'] + } + } + }, + { + files: ['**/*.svelte'], + + languageOptions: { + parser: parser, + ecmaVersion: 5, + sourceType: 'script', + + parserOptions: { + parser: '@typescript-eslint/parser' + } + } + } +]; diff --git a/package.json b/package.json index 85c8ac9..a9b2173 100644 --- a/package.json +++ b/package.json @@ -12,15 +12,18 @@ "format": "prettier --write ." }, "devDependencies": { + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "^9.13.0", "@sveltejs/adapter-cloudflare": "^4.7.4", "@sveltejs/enhanced-img": "^0.3.10", "@sveltejs/kit": "^2.7.3", "@sveltejs/vite-plugin-svelte": "^4.0.0", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", - "eslint": "^8.57.1", + "@typescript-eslint/eslint-plugin": "^8.11.0", + "@typescript-eslint/parser": "^8.11.0", + "eslint": "^9.13.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.46.0", + "globals": "^15.11.0", "lightningcss": "^1.27.0", "prettier": "^3.3.3", "prettier-plugin-svelte": "^3.2.7",