1.1.0 • Published 6 months ago
@sveltek/eslint-config v1.1.0
Installation
pnpm add -D @sveltek/eslint-configUsage
Linting Commands
Add lint commands for manual linting (optional):
// package.json
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint --fix ."
}
}JavaScript Config
// eslint.config.js
import { defineConfig, jsConfig, ignoresConfig } from '@sveltek/eslint-config'
export default defineConfig([jsConfig, ignoresConfig])TypeScript Config
// eslint.config.js
import {
defineConfig,
jsConfig,
tsConfig,
ignoresConfig,
} from '@sveltek/eslint-config'
export default defineConfig([jsConfig, tsConfig, ignoresConfig])Svelte/SvelteKit Config
Also, don't forget to add the
sveltelang key to theeslint.validatevscode setting:// .vscode/settings.json { "eslint.validate": ["javascript", "typescript", "svelte"] }
// eslint.config.js
import {
defineConfig,
jsConfig,
tsConfig,
svelteConfig,
ignoresConfig,
} from '@sveltek/eslint-config'
export default defineConfig([jsConfig, tsConfig, svelteConfig, ignoresConfig])Custom Setup
// eslint.config.js
import {
defineConfig,
globalIgnores,
jsConfig,
tsConfig,
ignores,
} from '@sveltek/eslint-config'
export default defineConfig([
jsConfig,
tsConfig,
svelteConfig,
{
files: jsConfig.files,
rules: {
// ...
},
},
{
files: tsConfig.files,
rules: {
// ...
},
},
{
files: svelteConfig.files,
rules: {
// ...
}
}
globalIgnores([...ignores, '**/dir/']),
])For more info on how to ignore files, see the official docs.
Community
Feel free to ask questions or share new ideas.
Use the official discussions to get involved.
License
Developed in 🇭🇷 Croatia, © Sveltek.
Released under the MIT license.