diff --git a/README.md b/README.md index f4a2934d0c..61da2772a4 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,9 @@ export default antfu({ stylistic: { indent: 2, // 4, or 'tab' quotes: 'single', // or 'double' + overrides: { + 'style/brace-style': ['error', '1tbs', { allowSingleLine: true }], + }, }, // TypeScript and Vue are auto-detected, you can also explicitly enable them: @@ -457,6 +460,29 @@ export default antfu({ }) ``` +To control which rules apply to your Svelte files, you can apply overrides like this: + +```js +// eslint.config.js +import { antfu } from '@antfu/eslint-config' + +export default antfu({ + svelte: true, +}).overrides({ + 'antfu/svelte/rules': { + rules: { + 'svelte/no-dom-manipulating': 'error', + }, + }, + 'antfu/typescript/rules': { + files: ['**/*.svelte'], + rules: { + 'prefer-destructuring': 'error', + }, + }, +}) +``` + Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually: ```bash