Skip to content

Commit c88781a

Browse files
committed
Upgrade to eslint@9
1 parent baa34ca commit c88781a

File tree

5 files changed

+34
-36
lines changed

5 files changed

+34
-36
lines changed

.eslintignore

Lines changed: 0 additions & 14 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 19 deletions
This file was deleted.

build.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env zx
2+
/* global $, fs, argv, echo, chalk */
23

34
await $`npm run lint && npx svelte-package`
45
const packed = await $`npx vite build -c vite.dist.config.js`

eslint.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import svelte from 'eslint-plugin-svelte'
3+
import prettier from 'eslint-config-prettier'
4+
import globals from 'globals'
5+
6+
/** @type {import('eslint').Linter.Config[]} */
7+
export default [
8+
js.configs.recommended,
9+
...svelte.configs['flat/recommended'],
10+
prettier,
11+
...svelte.configs['flat/prettier'],
12+
{
13+
languageOptions: {
14+
globals: {
15+
...globals.browser,
16+
...globals.node
17+
}
18+
},
19+
rules: {
20+
'no-tabs': 'error',
21+
'no-unexpected-multiline': 'error',
22+
'svelte/no-at-html-tags': 'off'
23+
}
24+
},
25+
{
26+
ignores: ['build/', '.svelte-kit/', 'dist/', 'temp/']
27+
}
28+
]

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
1010
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
1111
"format": "prettier --plugin-search-dir . --write .",
12-
"lint": "prettier --plugin-search-dir . --check . && eslint . && npm run check",
12+
"lint": "prettier --plugin-search-dir . --check . && eslint && npm run check",
1313
"test": "playwright test",
1414
"prepublishOnly": "echo 'Did you mean to publish `./package/`, instead of `./`?' && exit 1",
1515
"build": "zx build.mjs",
@@ -25,12 +25,14 @@
2525
"@sveltejs/kit": "^2.5.27",
2626
"@sveltejs/package": "^2.3.5",
2727
"@sveltejs/vite-plugin-svelte": "^3.1.2",
28+
"@types/eslint": "^9.6.1",
2829
"autoprefixer": "^10.4.20",
2930
"camelcase": "^7.0.1",
3031
"daisyui": "^3.9.4",
31-
"eslint": "^8.57.0",
32-
"eslint-config-prettier": "^8.10.0",
32+
"eslint": "^9.10.0",
33+
"eslint-config-prettier": "^9.1.0",
3334
"eslint-plugin-svelte": "^2.44.0",
35+
"globals": "^15.9.0",
3436
"is-port-reachable": "^4.0.0",
3537
"postcss": "^8.4.47",
3638
"postcss-load-config": "^4.0.2",

0 commit comments

Comments
 (0)