update eslint config
This commit is contained in:
73
eslint.config.cjs
Normal file
73
eslint.config.cjs
Normal file
@ -0,0 +1,73 @@
|
||||
const {
|
||||
defineConfig,
|
||||
globalIgnores,
|
||||
} = require("eslint/config");
|
||||
|
||||
const tsParser = require("@typescript-eslint/parser");
|
||||
const typescriptEslint = require("@typescript-eslint/eslint-plugin");
|
||||
const parser = require("svelte-eslint-parser");
|
||||
const globals = require("globals");
|
||||
const js = require("@eslint/js");
|
||||
|
||||
const {
|
||||
FlatCompat,
|
||||
} = require("@eslint/eslintrc");
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all
|
||||
});
|
||||
|
||||
module.exports = defineConfig([{
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
sourceType: "module",
|
||||
ecmaVersion: 2020,
|
||||
|
||||
parserOptions: {
|
||||
extraFileExtensions: [".svelte"],
|
||||
},
|
||||
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
},
|
||||
},
|
||||
|
||||
extends: compat.extends(
|
||||
"plugin:svelte/recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier",
|
||||
),
|
||||
|
||||
plugins: {
|
||||
"@typescript-eslint": typescriptEslint,
|
||||
},
|
||||
|
||||
settings: {
|
||||
"svelte3/typescript": () => require("typescript"),
|
||||
},
|
||||
}, globalIgnores(["**/*.cjs"]), {
|
||||
files: ["**/*.svelte"],
|
||||
|
||||
languageOptions: {
|
||||
parser: parser,
|
||||
|
||||
parserOptions: {
|
||||
parser: "@typescript-eslint/parser",
|
||||
},
|
||||
},
|
||||
}, globalIgnores([
|
||||
"**/.DS_Store",
|
||||
"**/node_modules",
|
||||
"build",
|
||||
".svelte-kit",
|
||||
"package",
|
||||
"**/.env",
|
||||
"**/.env.*",
|
||||
"!**/.env.example",
|
||||
"**/pnpm-lock.yaml",
|
||||
"**/package-lock.json",
|
||||
"**/yarn.lock",
|
||||
])]);
|
Reference in New Issue
Block a user