Skip to content

Commit

Permalink
chore: upgrade eslint to v9
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloricciuti committed Jul 28, 2024
1 parent b06a2c3 commit 042265b
Show file tree
Hide file tree
Showing 11 changed files with 367 additions and 283 deletions.
13 changes: 0 additions & 13 deletions .eslintignore

This file was deleted.

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

This file was deleted.

54 changes: 54 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import js from '@eslint/js';
import ts from 'typescript-eslint';
import svelte from 'eslint-plugin-svelte';
import prettier from 'eslint-config-prettier';
import globals from 'globals';

/** @type {import('eslint').Linter.Config[]} */
export default [
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser,
svelteFeatures: {
experimentalGenerics: true,
},
},
},
},
{
ignores: [
'**/.svelte-kit',
'**/build',
'**/node_modules',
'**/static',
'**/package',
'**/lz-string/*',
],
},
{
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^(_|\\$\\$)',
varsIgnorePattern: '^(_|\\$\\$)',
caughtErrorsIgnorePattern: '^(_|\\$\\$)',
},
],
},
},
];
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
"@sveltejs/kit": "^2.5.0",
"@sveltejs/package": "^2.2.6",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"eslint": "^8.56.0",
"eslint-plugin-svelte": "^2.35.1",
"eslint": "^9.8.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.43.0",
"globals": "^15.8.0",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.1",
"svelte": "^4.2.11",
Expand All @@ -58,6 +58,7 @@
"svelte-typewriter-store": "^0.0.5",
"tslib": "^2.6.2",
"typescript": "^5.0.0",
"typescript-eslint": "8.0.0-alpha.54",
"vite": "^5.1.3",
"vitest": "^2.0.0"
},
Expand Down
3 changes: 3 additions & 0 deletions playground/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@
let lz_changes = 0;
$: {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
$obj;
obj_changes++;
}
$: {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
$arr;
arr_changes++;
}
$: {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
$lz;
lz_changes++;
}
Expand Down
2 changes: 2 additions & 0 deletions playground/src/routes/equalityFn/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
let obj_changes = 0;
$: {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
$obj;
obj_changes++;
}
Expand All @@ -25,6 +26,7 @@
let store_changes = 0;
$: {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
$params;
store_changes++;
}
Expand Down
1 change: 1 addition & 0 deletions playground/src/routes/queryparameters/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
let change_in_store = 0;
$: {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
$store;
change_in_store++;
}
Expand Down
Loading

0 comments on commit 042265b

Please sign in to comment.