jsmorabito_obsidian-commander/eslint.config.mts
johnny1093 3bd5395f09 Migrate ESLint to flat config with eslint-plugin-obsidianmd
Replaces the legacy .eslintrc/.eslintignore (typescript-eslint 5.x) with a
flat eslint.config.mts on typescript-eslint 8.x, preserving the existing
return-type/accessibility rules and adding the obsidianmd recommended rules.
Also bumps the minimatch override, which was pinned to an old major that's
incompatible with the new ESLint 9 toolchain.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-10 12:09:46 -04:00

42 lines
1 KiB
TypeScript

import tseslint from 'typescript-eslint';
import obsidianmd from 'eslint-plugin-obsidianmd';
import globals from 'globals';
import { globalIgnores } from 'eslint/config';
export default tseslint.config(
globalIgnores([
'node_modules',
'build',
'scripts',
'main.js',
'main.css',
'styles.css',
'tailwind.config.js',
]),
{
languageOptions: {
globals: {
...globals.browser,
},
parserOptions: {
projectService: {
allowDefaultProject: ['eslint.config.mts', 'manifest.json'],
},
tsconfigRootDir: import.meta.dirname,
extraFileExtensions: ['.json'],
},
},
},
...tseslint.configs.recommended,
{
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'no-prototype-builtins': 'off',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/class-literal-property-style': ['error', 'fields'],
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-member-accessibility': 'error',
},
},
...obsidianmd.configs.recommended,
);