Created
October 25, 2023 22:17
-
-
Save huntabyte/b73073a93a7a664f3cbad7c50376c9c9 to your computer and use it in GitHub Desktop.
Svelte eslint config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
root: true, | |
extends: [ | |
"eslint:recommended", | |
"plugin:@typescript-eslint/recommended", | |
"plugin:svelte/recommended", | |
"prettier" | |
], | |
parser: "@typescript-eslint/parser", | |
plugins: ["@typescript-eslint"], | |
parserOptions: { | |
sourceType: "module", | |
ecmaVersion: "latest", | |
extraFileExtensions: [".svelte"] | |
}, | |
env: { | |
browser: true, | |
es2024: true, | |
node: true | |
}, | |
globals: { $$Generic: "readable", NodeJS: true }, | |
rules: { | |
"no-console": "warn", | |
"@typescript-eslint/no-unused-vars": [ | |
"warn", | |
{ | |
argsIgnorePattern: "^_", | |
varsIgnorePattern: "^_" | |
} | |
], | |
"svelte/no-target-blank": "error", | |
"svelte/no-immutable-reactive-statements": "error", | |
"svelte/prefer-style-directive": "error", | |
"svelte/no-reactive-literals": "error", | |
"svelte/no-useless-mustaches": "error", | |
"svelte/button-has-type": "off", | |
"svelte/require-each-key": "off", | |
"svelte/no-at-html-tags": "off", | |
"svelte/no-unused-svelte-ignore": "off", | |
"svelte/require-stores-init": "off" | |
}, | |
overrides: [ | |
{ | |
files: ["*.svelte"], | |
parser: "svelte-eslint-parser", | |
parserOptions: { | |
parser: "@typescript-eslint/parser" | |
}, | |
rules: { | |
"@typescript-eslint/no-unused-vars": [ | |
"warn", | |
{ | |
argsIgnorePattern: "^_", | |
varsIgnorePattern: "^\\$\\$(Props|Events|Slots|Generic)$" | |
} | |
] | |
} | |
}, | |
{ | |
files: ["*.ts"], | |
parser: "@typescript-eslint/parser", | |
rules: { | |
"@typescript-eslint/ban-types": [ | |
"error", | |
{ | |
extendDefaults: true, | |
types: { | |
"{}": false | |
} | |
} | |
] | |
} | |
} | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment