Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svelte 5 upgrade and fixed immediate breaking changes #592

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .eslintignore

This file was deleted.

84 changes: 0 additions & 84 deletions .eslintrc.cjs

This file was deleted.

124 changes: 124 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
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",
".vscode",
"src/translations/paraglide",
"**/pnpm-lock.yaml",
"**/package-lock.json",
"**/yarn.lock",
],
},
...compat.extends(
"eslint:recommended",
"plugin:eslint-comments/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/stylistic",
"plugin:svelte/recommended",
"plugin:svelte/prettier",
"prettier",
),
{
plugins: {
"@typescript-eslint": typescriptEslint,
},

linterOptions: {
reportUnusedDisableDirectives: true,
},

languageOptions: {
globals: {
...globals.browser,
...globals.node,
},

parser: tsParser,
ecmaVersion: 2020,
sourceType: "module",

parserOptions: {
extraFileExtensions: [".svelte"],
},
},

rules: {
"eslint-comments/require-description": "warn",

"no-restricted-imports": [
"warn",
{
patterns: [
{
group: ["../**/*[a-zA-Z0-9_-]*/*"],
message:
"\nIt looks like you're importing from a different subtree. Consider whether the imported code should really be shared. Suggestions:\n1) Write new code specific to your usage.\n2) Move the imported code to a shared location, e.g. a parent folder.\n3) Verify that you're using the correct path alias, e.g. $lib.",
},
{
importNamePattern: "^(goto|redirect)",
group: [
"$app/navigation",
"sveltekit-flash-message/server",
"@sveltejs/kit",
],
message:
"Use the goto and redirect wrappers from $lib/utils/redirect instead",
},
{
importNamePattern: "^(superForm)",
group: ["sveltekit-superforms", "sveltekit-superforms/client"],
message:
"Use the superForm from $lib/utils/client/superForms instead",
},
],
},
],

"@typescript-eslint/consistent-type-definitions": "off",

"@typescript-eslint/array-type": [
"error",
{
default: "array-simple",
},
],
},
},
{
files: ["**/*.svelte"],

languageOptions: {
parser: parser,
ecmaVersion: 5,
sourceType: "script",

parserOptions: {
parser: "@typescript-eslint/parser",
},
},
},
];
Loading
Loading