mirror of
https://github.com/hyungyunlim/obsidian-naver-blog-importer.git
synced 2026-07-22 06:45:11 +00:00
Adds type narrowing and minimal inline interfaces so the project
passes `eslint-plugin-obsidianmd` recommended config with zero
errors and zero warnings.
- catch blocks now use `error instanceof Error ? error.message :
String(error)` instead of accessing `.message` on `any`
- JSON.parse / requestUrl JSON results are typed via `unknown`
plus structural casts (e.g. `as { code?: number; data?: ... }`)
- Brunch/Naver Blog/Cafe/News fetchers gain small inline interfaces
for the API and embed-data shapes they parse
- AI provider clients (OpenAI / Anthropic / Google / Ollama) get
response-shape types so token usage, choices, candidates, etc.
are no longer accessed on `any`
- Video service: Kakao TV VOD response shape typed
- News fetcher: drop unused `domelementtype` dependency; compare
`node.type` against the cheerio string constants directly
- main.ts: cast `.bind(this)` results back to their typed signature
for service constructors, and type `loadData()` result as
`Partial<NaverBlogSettings> | null`
Also adds `eslint.config.mjs` so this lint matches what the
plugin-review bot runs.
27 lines
472 B
JavaScript
27 lines
472 B
JavaScript
import obsidianmd from 'eslint-plugin-obsidianmd';
|
|
|
|
export default [
|
|
{
|
|
ignores: [
|
|
'main.js',
|
|
'node_modules/**',
|
|
'dist/**',
|
|
'build/**',
|
|
'eslint.config.mjs',
|
|
'esbuild.config.mjs',
|
|
'version-bump.mjs',
|
|
'obsidian-developer-docs/**',
|
|
'**/*.js',
|
|
],
|
|
},
|
|
...obsidianmd.configs.recommended,
|
|
{
|
|
files: ['**/*.ts'],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
project: './tsconfig.json',
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
},
|
|
];
|