/
githubmirror
/
eslint-plugin
Обзор
Документация
Войти
/
githubmirror
/
eslint-plugin
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
0.1.0
lib/rules/hardcodedConfigPath.ts
33 строки
752 B
Emile Bangma
Format files
04 июн 2025, 13:30
Не верифицирован
04 июн 2025, 13:30
cedc267
Код
Авторство
О чём код?
import { TSESTree, TSESLint } from "@typescript-eslint/utils"; export default { name: "hardcoded-config-path", meta: { docs: { description: "test", url: "https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Commands", }, type: "problem" as const, messages: { configPath: "Obsidian's configuration folder is not necessarily `.obsidian`, it can be configured by the user.", }, schema: [], }, defaultOptions: [], create: (context: TSESLint.RuleContext<"configPath", []>) => { return { Literal(node: TSESTree.Literal) { if ( typeof node.value === "string" && node.value.includes(".obsidian") ) { context.report({ node, messageId: "configPath", }); } }, }; }, };