[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.

k5kit / eslint.config.js
2.0 kB 74 lines
1import prettier from 'eslint-config-prettier' 2import { includeIgnoreFile } from '@eslint/compat' 3import js from '@eslint/js' 4import svelte from 'eslint-plugin-svelte' 5import globals from 'globals' 6import { fileURLToPath } from 'node:url' 7import ts from 'typescript-eslint' 8import svelteConfig from './svelte.config.js' 9 10const gitignore_path = fileURLToPath(new URL('./.gitignore', import.meta.url)) 11 12export 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)