Sveltek's config for ESLint.
pnpm add -D @sveltek/eslint-config
Add lint
commands for manual linting (optional):
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint --fix ."
}
}
// eslint.config.js
import { jsConfig, ignoresConfig } from '@sveltek/eslint-config'
export default [jsConfig, ignoresConfig]
// eslint.config.js
import { jsConfig, tsConfig, ignoresConfig } from '@sveltek/eslint-config'
export default [jsConfig, tsConfig, ignoresConfig]
[!NOTE]
Also, don't forget to add the
svelte
lang key to theeslint.validate
vscode setting:// .vscode/settings.json { "eslint.validate": ["javascript", "typescript", "svelte"] }
// eslint.config.js
import {
jsConfig,
tsConfig,
svelteConfig,
ignoresConfig,
} from '@sveltek/eslint-config'
export default [jsConfig, tsConfig, svelteConfig, ignoresConfig]
import {
jsConfig,
tsConfig,
svelteConfig,
ignores,
} from '@sveltek/eslint-config'
export default [
jsConfig,
tsConfig,
svelteConfig,
{
files: jsConfig.files,
rules: {
// ...
},
},
{
files: tsConfig.files,
rules: {
// ...
},
},
{
files: svelteConfig.files,
rules: {
// ...
}
}
{
ignores: [...ignores, '**/dir/**/*'],
},
]
Feel free to ask questions or share new ideas.
Use the official discussions to get involved.
Developed in ðŸ‡ðŸ‡· Croatia, © Sveltek.
Released under the MIT license.