mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-24 16:04:06 +01:00
⬆️ eslint
This commit is contained in:
parent
1087fe8d52
commit
ad10151684
8 changed files with 435 additions and 333 deletions
59
app/eslint.config.mjs
Normal file
59
app/eslint.config.mjs
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
||||
import globals from "globals";
|
||||
import tsParser from "@typescript-eslint/parser";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import js from "@eslint/js";
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all
|
||||
});
|
||||
|
||||
export default [{
|
||||
ignores: [
|
||||
"build",
|
||||
"node_modules",
|
||||
"src/asset/pdf",
|
||||
"src/types/dist",
|
||||
"stage",
|
||||
"appearance",
|
||||
],
|
||||
}, ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), {
|
||||
plugins: {
|
||||
"@typescript-eslint": typescriptEslint,
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.browser,
|
||||
},
|
||||
|
||||
parser: tsParser,
|
||||
},
|
||||
|
||||
rules: {
|
||||
semi: [2, "always"],
|
||||
|
||||
quotes: [2, "double", {
|
||||
avoidEscape: true,
|
||||
}],
|
||||
|
||||
"no-async-promise-executor": "off",
|
||||
"no-prototype-builtins": "off",
|
||||
"no-useless-escape": "off",
|
||||
"no-irregular-whitespace": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-require-imports": "off",
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
},
|
||||
}];
|
||||
Loading…
Add table
Add a link
Reference in a new issue