Skip to content

Commit

Permalink
feat(svelte): update components to use runes, update eslint config to…
Browse files Browse the repository at this point in the history
… use new flatfile config
  • Loading branch information
VaiTon committed Jan 22, 2025
1 parent 2cbf4c5 commit f39ee89
Show file tree
Hide file tree
Showing 21 changed files with 372 additions and 384 deletions.
81 changes: 30 additions & 51 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsEslint from 'typescript-eslint';
import eslintPluginSvelte from 'eslint-plugin-svelte';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslint from '@eslint/js';
import svelteParser from 'svelte-eslint-parser';
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 [
eslint.configs.recommended,
...tsEslint.configs.recommended,
...eslintPluginSvelte.configs['flat/recommended'],
eslintConfigPrettier,
...eslintPluginSvelte.configs['flat/prettier'],
{
files: ['**/*.svelte'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: { ...globals.node, ...globals.browser },
parser: svelteParser,
parserOptions: {
parser: tsEslint.parser
}
}
},
{
files: ['svelte.config.js'],
languageOptions: {
globals: { ...globals.node }
}
},
{
ignores: [
'**/*.cjs',
Expand All @@ -29,42 +42,8 @@ export default [
'!**/.env.example',
'**/pnpm-lock.yaml',
'**/package-lock.json',
'**/yarn.lock'
'**/yarn.lock',
'.vercel'
]
},
...compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:svelte/recommended'
),
{
plugins: {
'@typescript-eslint': typescriptEslint
},

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

parser: tsParser,
ecmaVersion: 2020,
sourceType: 'module'
}
},
{
files: ['**/*.svelte'],

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

parserOptions: {
parser: '@typescript-eslint/parser'
}
}
}
];
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.17.0",
"@eslint/js": "^9.18.0",
"@iconify-json/akar-icons": "^1.2.2",
"@iconify-json/eos-icons": "^1.2.2",
"@iconify-json/ic": "^1.2.2",
Expand All @@ -37,31 +37,31 @@
"@tailwindcss/typography": "^0.5.15",
"@types/jsdom": "^21.1.7",
"@types/katex": "^0.16.7",
"@typescript-eslint/eslint-plugin": "^8.18.1",
"@typescript-eslint/parser": "^8.18.1",
"@vite-pwa/sveltekit": "^0.6.7",
"autoprefixer": "^10.4.20",
"daisyui": "^4.12.22",
"dayjs": "^1.11.13",
"dompurify": "^3.2.3",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-svelte": "^2.46.1",
"fuse.js": "^7.0.0",
"globals": "^15.13.0",
"katex": "^0.16.21",
"marked": "^10.0.0",
"postcss": "^8.4.49",
"prettier": "^3.4.2",
"prettier-plugin-svelte": "^3.3.2",
"prettier-plugin-svelte": "^3.3.3",
"shiki": "^1.24.2",
"svelte": "^5.14.0",
"svelte-check": "^4.1.1",
"svelte": "^5.19.1",
"svelte-check": "^4.1.4",
"svelte-eslint-parser": "^0.43.0",
"svelte-local-storage-store": "^0.6.4",
"tailwindcss": "^3.4.16",
"tocbot": "^4.32.2",
"tslib": "^2.8.1",
"typescript": "^5.7.2",
"typescript": "^5.7.3",
"typescript-eslint": "^8.21.0",
"vite": "^6.0.11",
"vite-plugin-pwa": "^0.21",
"workbox-build": "^7.3.0"
Expand Down
Loading

0 comments on commit f39ee89

Please sign in to comment.