fix eslint

This commit is contained in:
Viktor Rådberg
2025-11-17 22:04:34 +01:00
parent 6690a3b256
commit 55c02385b5
4 changed files with 53 additions and 19 deletions

View File

@@ -1,18 +0,0 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}

26
eslint.config.mjs Normal file
View File

@@ -0,0 +1,26 @@
import js from '@eslint/js';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
);

View File

@@ -11,7 +11,7 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"generate-icons": "npx @svgr/cli src/Icons/svgs",
"force-deploy": "pnpm run build && firebase deploy --only hosting",
@@ -28,6 +28,7 @@
"zod": "^4.1.12"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
"@svgr/cli": "^8.1.0",
"@tailwindcss/postcss": "^4.1.17",
"@types/prop-types": "^15.7.15",
@@ -47,6 +48,7 @@
"prop-types": "^15.8.1",
"tailwindcss": "^4.1.17",
"typescript": "^5.9.3",
"typescript-eslint": "^8.47.0",
"vite": "^7.2.2",
"vite-plugin-pwa": "^1.1.0"
}

24
pnpm-lock.yaml generated
View File

@@ -33,6 +33,9 @@ importers:
specifier: ^4.1.12
version: 4.1.12
devDependencies:
'@eslint/js':
specifier: ^9.39.1
version: 9.39.1
'@svgr/cli':
specifier: ^8.1.0
version: 8.1.0(typescript@5.9.3)
@@ -90,6 +93,9 @@ importers:
typescript:
specifier: ^5.9.3
version: 5.9.3
typescript-eslint:
specifier: ^8.47.0
version: 8.47.0(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3)
vite:
specifier: ^7.2.2
version: 7.2.2(@types/node@24.10.1)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(yaml@2.8.1)
@@ -4969,6 +4975,13 @@ packages:
typedarray-to-buffer@3.1.5:
resolution: {integrity: sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==}
typescript-eslint@8.47.0:
resolution: {integrity: sha512-Lwe8i2XQ3WoMjua/r1PHrCTpkubPYJCAfOurtn+mtTzqB6jNd+14n9UN1bJ4s3F49x9ixAm0FLflB/JzQ57M8Q==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <6.0.0'
typescript@5.9.3:
resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}
engines: {node: '>=14.17'}
@@ -10956,6 +10969,17 @@ snapshots:
dependencies:
is-typedarray: 1.0.0
typescript-eslint@8.47.0(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3):
dependencies:
'@typescript-eslint/eslint-plugin': 8.47.0(@typescript-eslint/parser@8.47.0(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3)
'@typescript-eslint/parser': 8.47.0(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3)
'@typescript-eslint/typescript-estree': 8.47.0(typescript@5.9.3)
'@typescript-eslint/utils': 8.47.0(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3)
eslint: 9.39.1(jiti@2.6.1)
typescript: 5.9.3
transitivePeerDependencies:
- supports-color
typescript@5.9.3: {}
unbox-primitive@1.1.0: