mirror of
https://github.com/jsmorabito/obsidian-commander.git
synced 2026-07-22 06:40:31 +00:00
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>
This commit is contained in:
parent
0bfd4624eb
commit
3bd5395f09
5 changed files with 7670 additions and 1489 deletions
|
|
@ -1,4 +0,0 @@
|
|||
npm node_modules
|
||||
build
|
||||
scripts/
|
||||
main.js
|
||||
25
.eslintrc
25
.eslintrc
|
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"env": { "node": true },
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"no-unused-vars": "error",
|
||||
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }],
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"no-prototype-builtins": "off",
|
||||
"@typescript-eslint/no-empty-function": ["error"],
|
||||
"semi": ["error", "always"],
|
||||
"@typescript-eslint/class-literal-property-style": ["error", "fields"],
|
||||
"@typescript-eslint/explicit-function-return-type": ["error"],
|
||||
"@typescript-eslint/explicit-member-accessibility": ["error"]
|
||||
}
|
||||
}
|
||||
42
eslint.config.mts
Normal file
42
eslint.config.mts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
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,
|
||||
);
|
||||
9067
package-lock.json
generated
9067
package-lock.json
generated
File diff suppressed because it is too large
Load diff
21
package.json
21
package.json
|
|
@ -11,7 +11,10 @@
|
|||
"build:css": "npx tailwindcss -i ./main.css -o ./styles.css --minify",
|
||||
"build": "npm run build:esbuild && npm run build:css",
|
||||
"dev:css": "npx tailwindcss -i ./main.css -o ./styles.css --watch",
|
||||
"dev": "npm-run-all --parallel dev:*"
|
||||
"dev": "npm-run-all --parallel dev:*",
|
||||
"lint": "eslint .",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "jsmorabito & phibr0",
|
||||
|
|
@ -25,24 +28,32 @@
|
|||
"@codemirror/search": "^6.2.3",
|
||||
"@codemirror/state": "^6.1.4",
|
||||
"@codemirror/view": "^6.6.0",
|
||||
"@eslint/js": "^9.39.4",
|
||||
"@eslint/json": "0.14.0",
|
||||
"@types/canvas-confetti": "^1.6.0",
|
||||
"@types/node": "^18.11.9",
|
||||
"@types/react": "^18.0.25",
|
||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||
"@typescript-eslint/parser": "^5.45.0",
|
||||
"@vitest/coverage-v8": "^4.1.9",
|
||||
"builtin-modules": "^3.3.0",
|
||||
"codemirror": "^6.0.1",
|
||||
"codemirror6-themes": "^0.1.2",
|
||||
"esbuild": "^0.28.1",
|
||||
"esbuild-plugin-alias": "^0.2.1",
|
||||
"esbuild-sass-plugin": "3.3.1",
|
||||
"eslint": "^9.39.4",
|
||||
"eslint-plugin-obsidianmd": "^0.4.1",
|
||||
"globals": "^17.6.0",
|
||||
"jiti": "^2.6.1",
|
||||
"jsdom": "^29.1.1",
|
||||
"node-fetch": "^3.3.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"obsidian": "latest",
|
||||
"sass-embedded": "^1.71.1",
|
||||
"tailwindcss": "^3.2.4",
|
||||
"tslib": "^2.4.1",
|
||||
"typescript": "^4.9.3"
|
||||
"typescript": "^4.9.3",
|
||||
"typescript-eslint": "^8.59.1",
|
||||
"vitest": "^4.1.9"
|
||||
},
|
||||
"dependencies": {
|
||||
"array-move": "^4.0.0",
|
||||
|
|
@ -58,7 +69,7 @@
|
|||
"immutable": "^4.3.8",
|
||||
"js-yaml": "^4.1.1",
|
||||
"micromatch": "^4.0.8",
|
||||
"minimatch": "^3.1.5",
|
||||
"minimatch": "^9.0.5",
|
||||
"nanoid": "^3.3.8",
|
||||
"picomatch": "^2.3.2",
|
||||
"postcss": "^8.5.10",
|
||||
|
|
|
|||
Loading…
Reference in a new issue