mirror of
https://github.com/emklasson/obsidian-save-modified-times.git
synced 2026-07-22 06:40:27 +00:00
57 lines
No EOL
1.7 KiB
JavaScript
57 lines
No EOL
1.7 KiB
JavaScript
import { defineConfig, globalIgnores } from "eslint/config";
|
|
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 defineConfig([globalIgnores(["**/node_modules/", "**/main.js"]), {
|
|
extends: compat.extends(
|
|
"eslint:recommended",
|
|
"plugin:@typescript-eslint/eslint-recommended",
|
|
"plugin:@typescript-eslint/recommended-type-checked",
|
|
),
|
|
|
|
plugins: {
|
|
"@typescript-eslint": typescriptEslint,
|
|
},
|
|
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node,
|
|
},
|
|
|
|
parser: tsParser,
|
|
ecmaVersion: 5,
|
|
sourceType: "module",
|
|
parserOptions: {
|
|
projectService: true,
|
|
},
|
|
},
|
|
|
|
rules: {
|
|
"no-unused-vars": "off",
|
|
|
|
"@typescript-eslint/no-unused-vars": ["error", {
|
|
args: "none",
|
|
}],
|
|
|
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
"@typescript-eslint/no-empty-function": "off",
|
|
"@typescript-eslint/no-unsafe-member-access": "warn",
|
|
"@typescript-eslint/no-unsafe-assignment": "warn",
|
|
"@typescript-eslint/no-unsafe-argument": "warn",
|
|
"@typescript-eslint/no-floating-promises": "error",
|
|
"no-prototype-builtins": "error",
|
|
},
|
|
}]); |