Skip to content

Commit

Permalink
upgrade to svelte 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Randomblock1 committed Nov 11, 2024
1 parent e128d28 commit 9487e6e
Show file tree
Hide file tree
Showing 12 changed files with 594 additions and 497 deletions.
30 changes: 0 additions & 30 deletions .eslintrc.cjs

This file was deleted.

2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
"bracketSameLine": true,
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
74 changes: 74 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -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',
'dev-dist',
'**/pnpm-lock.yaml',
'**/package-lock.json',
'**/yarn.lock'
]
},
...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'
}
}
}
];
Loading

0 comments on commit 9487e6e

Please sign in to comment.