mirror of
https://github.com/jheddings/obsidian-stomp.git
synced 2026-07-22 06:44:59 +00:00
chore(deps): update dependency typescript to v6 (#210)
Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
85f817cc8b
commit
4554cfbe1b
6 changed files with 31 additions and 16 deletions
|
|
@ -3,11 +3,19 @@ import { defineConfig } from "eslint/config";
|
|||
import obsidianmd from "eslint-plugin-obsidianmd";
|
||||
import globals from "globals";
|
||||
|
||||
// Disable all obsidianmd rules for non-TS files. Several rules in the
|
||||
// plugin's recommended config call getParserServices() but are applied
|
||||
// globally (no files filter), which crashes on package.json and other
|
||||
// non-TypeScript files that lack type information.
|
||||
const obsidianmdOff = Object.fromEntries(
|
||||
Object.keys(obsidianmd.rules ?? {}).map((name) => [`obsidianmd/${name}`, "off"])
|
||||
);
|
||||
|
||||
export default defineConfig([
|
||||
...obsidianmd.configs.recommended,
|
||||
{
|
||||
ignores: ["main.js", "dist/**", "node_modules/**", "*.d.ts"],
|
||||
ignores: ["main.js", "dist/**", "node_modules/**", "*.d.ts", "*.mjs"],
|
||||
},
|
||||
...obsidianmd.configs.recommended,
|
||||
{
|
||||
files: ["**/*.ts", "**/*.tsx"],
|
||||
languageOptions: {
|
||||
|
|
@ -25,6 +33,7 @@ export default defineConfig([
|
|||
{
|
||||
files: ["package.json"],
|
||||
rules: {
|
||||
...obsidianmdOff,
|
||||
"depend/ban-dependencies": "off",
|
||||
},
|
||||
},
|
||||
|
|
|
|||
8
package-lock.json
generated
8
package-lock.json
generated
|
|
@ -26,7 +26,7 @@
|
|||
"obsidian": "latest",
|
||||
"prettier": "^3.8.3",
|
||||
"tslib": "2.8.1",
|
||||
"typescript": "5.9.3"
|
||||
"typescript": "6.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@codemirror/state": {
|
||||
|
|
@ -6451,9 +6451,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.9.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz",
|
||||
"integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
"obsidian": "latest",
|
||||
"prettier": "^3.8.3",
|
||||
"tslib": "2.8.1",
|
||||
"typescript": "5.9.3"
|
||||
"typescript": "6.0.3"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,jsx,ts,tsx,json,css,scss,md}": [
|
||||
|
|
|
|||
|
|
@ -94,8 +94,14 @@ export class ScrollEngine {
|
|||
pixelsPerFrame: number,
|
||||
totalFrames: number
|
||||
): Promise<void> {
|
||||
if (!this.activeElement) {
|
||||
throw new Error("No active element");
|
||||
}
|
||||
|
||||
const element = this.activeElement;
|
||||
|
||||
return new Promise((resolve) => {
|
||||
let currentPosition = this.activeElement.scrollTop;
|
||||
let currentPosition = element.scrollTop;
|
||||
let framesProcessed = 0;
|
||||
|
||||
const startTime = performance.now();
|
||||
|
|
@ -110,7 +116,7 @@ export class ScrollEngine {
|
|||
};
|
||||
|
||||
const animate = () => {
|
||||
const previousPosition = this.activeElement.scrollTop;
|
||||
const previousPosition = element.scrollTop;
|
||||
const nextPosition = currentPosition + pixelsPerFrame;
|
||||
|
||||
this.logger.debug(
|
||||
|
|
@ -121,7 +127,7 @@ export class ScrollEngine {
|
|||
this.directScroll(currentPosition);
|
||||
|
||||
// check if we've reached a document limit
|
||||
const actualPosition = this.activeElement.scrollTop;
|
||||
const actualPosition = element.scrollTop;
|
||||
if (actualPosition === previousPosition) {
|
||||
finalize(`Scroll stopped @ ${actualPosition}`);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ const config = new PluginConfig<StompPluginSettings>({
|
|||
});
|
||||
|
||||
export default class StompPlugin extends Plugin {
|
||||
settings: StompPluginSettings;
|
||||
settings!: StompPluginSettings;
|
||||
|
||||
private controller: ScrollController;
|
||||
private controller!: ScrollController;
|
||||
|
||||
private logger: Logger = Logger.getLogger("main");
|
||||
|
||||
|
|
@ -124,6 +124,6 @@ export default class StompPlugin extends Plugin {
|
|||
|
||||
hasActiveView(): boolean {
|
||||
const activeView = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
return activeView && activeView.currentMode instanceof MarkdownPreviewView;
|
||||
return activeView !== null && activeView.currentMode instanceof MarkdownPreviewView;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"inlineSourceMap": true,
|
||||
"inlineSources": true,
|
||||
"module": "ESNext",
|
||||
"target": "ES6",
|
||||
"allowJs": true,
|
||||
"noImplicitAny": true,
|
||||
"moduleResolution": "node",
|
||||
"moduleResolution": "bundler",
|
||||
"importHelpers": true,
|
||||
"declaration": true,
|
||||
"outDir": "./dist",
|
||||
"types": ["node"],
|
||||
"typeRoots": ["node_modules/@types"],
|
||||
"lib": ["DOM", "ES6"]
|
||||
"lib": ["DOM", "ES2017"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue