@sveltek/eslint-config

Sveltek's config for ESLint.


Installation

pnpm add -D @sveltek/eslint-config

Setup

Add lint commands for manual linting (optional):

package.json

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint --fix ."
  }
}

Usage

JS

// eslint.config.js

import { jsConfig, ignoresConfig } from '@sveltek/eslint-config'

export default [jsConfig, ignoresConfig]

TS

// eslint.config.js

import { jsConfig, tsConfig, ignoresConfig } from '@sveltek/eslint-config'

export default [jsConfig, tsConfig, ignoresConfig]

Svelte/SvelteKit

[!NOTE]

Also, don't forget to add the svelte lang key to the eslint.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]

Customization

eslint.config.js

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/**/*'],
  },
]

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.

Top categories

Loading Svelte Themes