2026-05-15 13:40:29 +00:00
import obsidianmd from "eslint-plugin-obsidianmd" ;
2026-06-01 14:21:03 +00:00
import tseslint from "typescript-eslint" ;
2025-07-27 09:33:21 +00:00
export default [
{
files : [ "**/*.ts" ] ,
languageOptions : {
parser : tseslint . parser ,
parserOptions : {
2026-06-01 14:21:03 +00:00
sourceType : "module"
2025-07-27 09:33:21 +00:00
}
} ,
ignores : [
"**/node_modules/**" ,
2026-06-01 14:21:03 +00:00
"**/dist/**" ,
2025-07-27 09:33:21 +00:00
] ,
plugins : {
2026-06-01 14:21:03 +00:00
"@typescript-eslint" : tseslint . plugin ,
obsidianmd
2025-07-27 09:33:21 +00:00
} ,
rules : {
2026-06-01 14:21:03 +00:00
"obsidianmd/no-tfile-tfolder-cast" : "error" ,
"obsidianmd/rule-custom-message" : [
"error" ,
{
"no-console" : {
messages : {
"Unexpected console statement. Only these console methods are allowed: warn, error, debug." : "Avoid unnecessary logging to console. See https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Avoid+unnecessary+logging+to+console" ,
} ,
options : [ { allow : [ "warn" , "error" , "debug" ] } ] ,
}
}
] ,
2025-07-27 09:33:21 +00:00
"no-unused-vars" : "off" ,
"quotes" : [
"error" ,
"single" ,
{
"avoidEscape" : true
}
] ,
"no-mixed-spaces-and-tabs" : "error" ,
"indent" : [
"error" ,
"tab" ,
{
"SwitchCase" : 1
}
] ,
"arrow-parens" : [
"error" ,
"always"
] ,
"eol-last" : [
"error" ,
"always"
] ,
"func-call-spacing" : [
"error" ,
"never"
] ,
"comma-dangle" : [
"error" ,
"always-multiline"
] ,
"no-multi-spaces" : "error" ,
"no-trailing-spaces" : "error" ,
"no-whitespace-before-property" : "off" ,
"semi" : [
"error" ,
"always"
] ,
"semi-style" : [
"error" ,
"last"
] ,
"space-in-parens" : [
"error" ,
"never"
] ,
"block-spacing" : [
"error" ,
"always"
] ,
"object-curly-spacing" : [
"error" ,
"always"
] ,
"eqeqeq" : [
"error" ,
"always" ,
{
"null" : "ignore"
}
] ,
"spaced-comment" : [
"error" ,
"always" ,
{
"markers" : [
"!"
]
}
] ,
"yoda" : "error" ,
"prefer-destructuring" : [
"error" ,
{
"object" : true ,
"array" : false
}
] ,
"operator-assignment" : [
"error" ,
"always"
] ,
"no-useless-computed-key" : "error" ,
"no-unneeded-ternary" : [
"error" ,
{
"defaultAssignment" : false
}
] ,
"no-invalid-regexp" : "error" ,
"no-constant-condition" : [
"error" ,
{
"checkLoops" : false
}
] ,
"no-duplicate-imports" : "error" ,
"no-extra-semi" : "error" ,
"dot-notation" : "error" ,
"no-useless-escape" : "error" ,
'@typescript-eslint/no-unused-vars' : [ 'warn' , { argsIgnorePattern : '^_' } ] ,
'@typescript-eslint/no-explicit-any' : 'warn' ,
'@typescript-eslint/consistent-type-imports' : 'error' ,
'@typescript-eslint/consistent-type-definitions' : [
'error' ,
'interface' ] ,
'@typescript-eslint/explicit-function-return-type' : 'warn' ,
'@typescript-eslint/ban-ts-comment' : 'warn' ,
'array-bracket-spacing' : [
'error' , 'never' ] ,
'linebreak-style' : [
'error' ,
'unix'
] ,
'no-nested-ternary' : 'error' ,
'no-shadow' : 'error' ,
'no-return-await' : 'error' ,
'no-else-return' : 'error' ,
'no-empty-function' : 'warn' ,
'complexity' : [
'warn' ,
2025-08-08 07:37:35 +00:00
15
2025-07-27 09:33:21 +00:00
] ,
'max-len' : [
'warn' , {
2026-05-15 13:40:29 +00:00
code : 110 ,
2025-08-08 07:37:35 +00:00
ignoreComments : true ,
2025-07-27 09:33:21 +00:00
}
] ,
'no-inline-comments' : 'warn' ,
'no-magic-numbers' : [
'warn' , {
ignore : [ 0 , 1 ] ,
2025-08-08 07:37:35 +00:00
enforceConst : true ,
ignoreTypeIndexes : true ,
ignoreEnums : true ,
ignoreNumericLiteralTypes : true ,
ignoreClassFieldInitialValues : true ,
2025-07-27 09:33:21 +00:00
}
] ,
}
}
2026-06-01 14:21:03 +00:00
] ;