[READ-ONLY] Mirror of https://github.com/probablykasper/k5kit. Utilities for TypeScript and Svelte
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix eslint

Kasper (Jun 28, 2025, 12:50 AM +0200) e4ab214c 95f2b18a

+124 -93
+74
eslint.config.js
··· 1 + import prettier from 'eslint-config-prettier' 2 + import { includeIgnoreFile } from '@eslint/compat' 3 + import js from '@eslint/js' 4 + import svelte from 'eslint-plugin-svelte' 5 + import globals from 'globals' 6 + import { fileURLToPath } from 'node:url' 7 + import ts from 'typescript-eslint' 8 + import svelteConfig from './svelte.config.js' 9 + 10 + const gitignore_path = fileURLToPath(new URL('./.gitignore', import.meta.url)) 11 + 12 + export default ts.config( 13 + includeIgnoreFile(gitignore_path), 14 + js.configs.recommended, 15 + ...ts.configs.recommended, 16 + ...svelte.configs.recommended, 17 + prettier, 18 + ...svelte.configs.prettier, 19 + { 20 + languageOptions: { 21 + globals: { ...globals.browser, ...globals.node }, 22 + }, 23 + rules: { 24 + // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects. 25 + // see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors 26 + 'no-undef': 'off', 27 + }, 28 + }, 29 + { 30 + files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'], 31 + languageOptions: { 32 + parserOptions: { 33 + projectService: true, 34 + extraFileExtensions: ['.svelte'], 35 + parser: ts.parser, 36 + svelteConfig, 37 + }, 38 + }, 39 + }, 40 + { 41 + rules: { 42 + '@typescript-eslint/naming-convention': [ 43 + 'error', 44 + { 45 + selector: 'variableLike', 46 + format: ['snake_case', 'UPPER_CASE', 'PascalCase'], 47 + leadingUnderscore: 'allow', 48 + }, 49 + { 50 + selector: 'parameter', 51 + modifiers: ['destructured'], 52 + format: null, 53 + }, 54 + { 55 + selector: 'variable', 56 + modifiers: ['destructured'], 57 + format: null, 58 + }, 59 + ], 60 + '@typescript-eslint/no-unused-expressions': 'off', 61 + '@typescript-eslint/no-unused-vars': [ 62 + 'error', 63 + { 64 + caughtErrorsIgnorePattern: '^_', 65 + argsIgnorePattern: '^_', 66 + varsIgnorePattern: '^_', 67 + }, 68 + ], 69 + eqeqeq: ['error', 'always'], 70 + 'svelte/button-has-type': 'error', 71 + 'svelte/require-each-key': 'off', // Unnecessary each key probably has performance downside 72 + }, 73 + }, 74 + )
-67
eslint.config.mjs
··· 1 - import js from '@eslint/js' 2 - import ts from 'typescript-eslint' 3 - import svelte from 'eslint-plugin-svelte' 4 - import prettier from 'eslint-config-prettier' 5 - import globals from 'globals' 6 - 7 - /** @type {import('eslint').Linter.Config[]} */ 8 - export default [ 9 - js.configs.recommended, 10 - ...ts.configs.recommended, 11 - ...svelte.configs['flat/recommended'], 12 - prettier, 13 - ...svelte.configs['flat/prettier'], 14 - { 15 - languageOptions: { 16 - globals: { 17 - ...globals.browser, 18 - ...globals.node, 19 - }, 20 - }, 21 - }, 22 - { 23 - files: ['**/*.svelte'], 24 - languageOptions: { 25 - parserOptions: { 26 - parser: ts.parser, 27 - }, 28 - }, 29 - }, 30 - { 31 - ignores: ['build/', '.svelte-kit/', 'dist/'], 32 - }, 33 - { 34 - rules: { 35 - '@typescript-eslint/naming-convention': [ 36 - 'error', 37 - { 38 - selector: 'variableLike', 39 - format: ['snake_case', 'UPPER_CASE', 'PascalCase'], 40 - leadingUnderscore: 'allow', 41 - }, 42 - { 43 - selector: 'parameter', 44 - modifiers: ['destructured'], 45 - format: null, 46 - }, 47 - { 48 - selector: 'variable', 49 - modifiers: ['destructured'], 50 - format: null, 51 - }, 52 - ], 53 - '@typescript-eslint/no-unused-expressions': 'off', 54 - '@typescript-eslint/no-unused-vars': [ 55 - 'error', 56 - { 57 - caughtErrorsIgnorePattern: '^_', 58 - argsIgnorePattern: '^_', 59 - varsIgnorePattern: '^_', 60 - }, 61 - ], 62 - eqeqeq: ['error', 'always'], 63 - 'svelte/button-has-type': 'error', 64 - 'svelte/require-each-key': 'off', // Unnecessary each key probably has performance downside 65 - }, 66 - }, 67 - ]
+41 -20
package-lock.json
··· 8 8 "name": "kutils", 9 9 "version": "0.0.1", 10 10 "devDependencies": { 11 + "@eslint/compat": "^1.2.5", 12 + "@eslint/js": "^9.18.0", 11 13 "@sveltejs/adapter-auto": "^6.0.1", 12 14 "@sveltejs/kit": "^2.22.0", 13 15 "@sveltejs/package": "^2.3.11", 14 16 "@sveltejs/vite-plugin-svelte": "^5.1.0", 15 17 "@tailwindcss/vite": "^4.1.10", 16 - "eslint": "^9.29.0", 17 - "eslint-config-prettier": "^10.1.5", 18 - "eslint-plugin-svelte": "^3.9.3", 18 + "eslint": "^9.18.0", 19 + "eslint-config-prettier": "^10.0.1", 20 + "eslint-plugin-svelte": "^3.0.0", 21 + "globals": "^16.0.0", 19 22 "prettier": "^3.6.1", 20 23 "prettier-plugin-svelte": "^3.4.0", 21 24 "publint": "^0.3.12", ··· 23 26 "svelte-check": "^4.2.2", 24 27 "tailwindcss": "^4.1.10", 25 28 "typescript": "^5.8.3", 26 - "typescript-eslint": "^8.35.0", 29 + "typescript-eslint": "^8.20.0", 27 30 "vite": "^6.3.5" 28 31 }, 29 32 "peerDependencies": { ··· 517 520 "node": "^12.0.0 || ^14.0.0 || >=16.0.0" 518 521 } 519 522 }, 523 + "node_modules/@eslint/compat": { 524 + "version": "1.3.1", 525 + "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.3.1.tgz", 526 + "integrity": "sha512-k8MHony59I5EPic6EQTCNOuPoVBnoYXkP+20xvwFjN7t0qI3ImyvyBgg+hIVPwC8JaxVjjUZld+cLfBLFDLucg==", 527 + "dev": true, 528 + "license": "Apache-2.0", 529 + "engines": { 530 + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 531 + }, 532 + "peerDependencies": { 533 + "eslint": "^8.40 || 9" 534 + }, 535 + "peerDependenciesMeta": { 536 + "eslint": { 537 + "optional": true 538 + } 539 + } 540 + }, 520 541 "node_modules/@eslint/config-array": { 521 542 "version": "0.20.1", 522 543 "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.1.tgz", ··· 577 598 }, 578 599 "funding": { 579 600 "url": "https://opencollective.com/eslint" 601 + } 602 + }, 603 + "node_modules/@eslint/eslintrc/node_modules/globals": { 604 + "version": "14.0.0", 605 + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", 606 + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", 607 + "dev": true, 608 + "license": "MIT", 609 + "engines": { 610 + "node": ">=18" 611 + }, 612 + "funding": { 613 + "url": "https://github.com/sponsors/sindresorhus" 580 614 } 581 615 }, 582 616 "node_modules/@eslint/js": { ··· 2250 2284 } 2251 2285 } 2252 2286 }, 2253 - "node_modules/eslint-plugin-svelte/node_modules/globals": { 2254 - "version": "16.2.0", 2255 - "resolved": "https://registry.npmjs.org/globals/-/globals-16.2.0.tgz", 2256 - "integrity": "sha512-O+7l9tPdHCU320IigZZPj5zmRCFG9xHmx9cU8FqU2Rp+JN714seHV+2S9+JslCpY4gJwU2vOGox0wzgae/MCEg==", 2257 - "dev": true, 2258 - "license": "MIT", 2259 - "engines": { 2260 - "node": ">=18" 2261 - }, 2262 - "funding": { 2263 - "url": "https://github.com/sponsors/sindresorhus" 2264 - } 2265 - }, 2266 2287 "node_modules/eslint-scope": { 2267 2288 "version": "8.4.0", 2268 2289 "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", ··· 2543 2564 } 2544 2565 }, 2545 2566 "node_modules/globals": { 2546 - "version": "14.0.0", 2547 - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", 2548 - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", 2567 + "version": "16.2.0", 2568 + "resolved": "https://registry.npmjs.org/globals/-/globals-16.2.0.tgz", 2569 + "integrity": "sha512-O+7l9tPdHCU320IigZZPj5zmRCFG9xHmx9cU8FqU2Rp+JN714seHV+2S9+JslCpY4gJwU2vOGox0wzgae/MCEg==", 2549 2570 "dev": true, 2550 2571 "license": "MIT", 2551 2572 "engines": {
+8 -5
package.json
··· 11 11 "prepack": "svelte-kit sync && svelte-package && publint", 12 12 "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", 13 13 "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", 14 - "lint": "npx svelte-kit sync && svelte-check --tsconfig ./tsconfig.json && eslint src *.js && prettier --check src *.js", 14 + "lint": "npx svelte-kit sync && svelte-check --tsconfig ./tsconfig.json && eslint src *.js && prettier --check src *.js && eslint .", 15 15 "format": "prettier --write src *.js && eslint --fix src *.js" 16 16 }, 17 17 "files": [ ··· 46 46 "svelte": "^5.0.0" 47 47 }, 48 48 "devDependencies": { 49 + "@eslint/compat": "^1.2.5", 50 + "@eslint/js": "^9.18.0", 49 51 "@sveltejs/adapter-auto": "^6.0.1", 50 52 "@sveltejs/kit": "^2.22.0", 51 53 "@sveltejs/package": "^2.3.11", 52 54 "@sveltejs/vite-plugin-svelte": "^5.1.0", 53 55 "@tailwindcss/vite": "^4.1.10", 54 - "eslint": "^9.29.0", 55 - "eslint-config-prettier": "^10.1.5", 56 - "eslint-plugin-svelte": "^3.9.3", 56 + "eslint": "^9.18.0", 57 + "eslint-config-prettier": "^10.0.1", 58 + "eslint-plugin-svelte": "^3.0.0", 59 + "globals": "^16.0.0", 57 60 "prettier": "^3.6.1", 58 61 "prettier-plugin-svelte": "^3.4.0", 59 62 "publint": "^0.3.12", ··· 61 64 "svelte-check": "^4.2.2", 62 65 "tailwindcss": "^4.1.10", 63 66 "typescript": "^5.8.3", 64 - "typescript-eslint": "^8.35.0", 67 + "typescript-eslint": "^8.20.0", 65 68 "vite": "^6.3.5" 66 69 }, 67 70 "keywords": [
+1 -1
svelte.config.js
··· 5 5 const config = { 6 6 // Consult https://svelte.dev/docs/kit/integrations 7 7 // for more information about preprocessors 8 - preprocess: vitePreprocess(), 8 + preprocess: vitePreprocess({ script: true }), 9 9 10 10 kit: { 11 11 // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.