Skip to content

Commit 8408b9b

Browse files
committed
introduce plugin:@typescript-eslint/stylistic-type-checked, fix lint issues
1 parent 8a0d95d commit 8408b9b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.eslintrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"eslint:recommended",
1717
"plugin:@typescript-eslint/eslint-recommended",
1818
"plugin:@typescript-eslint/strict-type-checked",
19+
"plugin:@typescript-eslint/stylistic-type-checked",
1920
"plugin:@stylistic/recommended-extends"
2021
],
2122
"rules": {
@@ -26,6 +27,12 @@
2627
"allowNumber": true
2728
}
2829
],
30+
"@typescript-eslint/prefer-nullish-coalescing": [
31+
"error",
32+
{
33+
"ignoreConditionalTests": true
34+
}
35+
],
2936
"@stylistic/indent": [
3037
"warn",
3138
4

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { CopyUrlInPreviewSettingTab, CopyUrlInPreviewSettings, DEFAULT_SETTINGS
1111
export default class CopyUrlInPreview extends Plugin {
1212
longTapTimeoutId?: number;
1313
openPdfMenu?: Menu;
14-
preventReopenPdfMenu: boolean = false;
14+
preventReopenPdfMenu = false;
1515
lastHoveredLinkTarget?: string;
1616
canvasCardMenu?: HTMLElement;
1717
settings!: CopyUrlInPreviewSettings;
@@ -35,7 +35,7 @@ export default class CopyUrlInPreview extends Plugin {
3535
// register the image menu for canvas
3636
this.registerEvent(this.app.workspace.on("file-menu", (menu, file, source) => {
3737
if (source === "canvas-menu" && file instanceof TFile
38-
&& (file.extension.match(imageFileRegex) || file.extension === "pdf")) {
38+
&& (file.extension.match(imageFileRegex) ?? file.extension === "pdf")) {
3939
menu.addItem(item => setMenuItem(item, "open-in-new-tab")
4040
.onClick(() => { openTfileInNewTab(this.app, file); })
4141
);

0 commit comments

Comments
 (0)