Skip to content

Commit

Permalink
Resolve lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mkobayashime committed Sep 30, 2024
1 parent 5414e60 commit a813043
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 16 deletions.
4 changes: 2 additions & 2 deletions bin/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import chalk from "chalk";
import { copyToClipboardPlugin } from "../copyToClipboardRollupPlugin.js";
import { userscriptMetaPlugin } from "../src/userscripts/meta/rollupPlugin.js";

(async () => {
(() => {
const watchedFiles: Set<string> = new Set([]);

const chokidarWatcher = chokidar
Expand Down Expand Up @@ -47,7 +47,7 @@ import { userscriptMetaPlugin } from "../src/userscripts/meta/rollupPlugin.js";
console.error(event.error);
}

if (event && "result" in event && event.result) {
if ("result" in event && event.result) {
event.result.close();
}
});
Expand Down
8 changes: 4 additions & 4 deletions bin/docgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ type FileProperties = {

type FileKind = "script" | "style";

const getFiles = async (): Promise<{
const getFiles = (): {
scripts: string[];
styles: string[];
}> => {
} => {
try {
return {
scripts: pipe(
Expand Down Expand Up @@ -111,7 +111,7 @@ const getFilesProperties = async ({
return pipe(
await Promise.all(
files.map(async (file) => {
return await parseFileComment({ filepath: file, kind });
return parseFileComment({ filepath: file, kind });
}),
),
A.compact,
Expand Down Expand Up @@ -152,7 +152,7 @@ const updateReadme = async (scriptsMarkdown: string): Promise<void> => {

//
(async () => {
const { scripts, styles } = await getFiles();
const { scripts, styles } = getFiles();

const scriptFileProperties = await getFilesProperties({
files: scripts,
Expand Down
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const config = [
"@typescript-eslint/naming-convention": "off",
"consistent-return": "off",
"id-length": "off",
"import/extensions": "off",
"no-alert": "off",
"no-console": "off",
"no-nested-ternary": "off",
Expand Down
3 changes: 2 additions & 1 deletion src/userscripts/copy-lyrics.user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ const lineMusic = () => {
};

//
(async () => {
(() => {
const url = window.location.href;

// eslint-disable-next-line @typescript-eslint/no-misused-promises
document.addEventListener("keydown", async (e) => {
if (e.ctrlKey && e.key === "Enter") {
if (url.startsWith("https://www.google.com/search")) {
Expand Down
2 changes: 1 addition & 1 deletion src/userscripts/slack-no-autofocus.user.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
void (async () => {
void (() => {
let curTitle = "";

new MutationObserver(() => {
Expand Down
12 changes: 8 additions & 4 deletions src/userscripts/tweetdeck-shortcuts.user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ const config = {};
}

if (
e.key === "l" || // default Like
e.key === "u" || // default Mute
e.key === "x" // default Block
// default Like
e.key === "l" ||
// default Mute
e.key === "u" ||
// default Block
e.key === "x"
) {
e.stopImmediatePropagation();
}
Expand All @@ -42,7 +45,8 @@ const config = {};
if (e.key === "f") {
document.dispatchEvent(
new KeyboardEvent("keypress", {
keyCode: 76, // `l`
// `l`
keyCode: 76,
}),
);
}
Expand Down
6 changes: 4 additions & 2 deletions src/userscripts/twitter-shortcuts.user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ const findTweetInCenter = () => {
if (isTyping()) return;

if (
e.key === "u" || // default Mute
e.key === "x" // default Block
// default Mute
e.key === "u" ||
// default Block
e.key === "x"
) {
e.stopImmediatePropagation();
}
Expand Down
3 changes: 2 additions & 1 deletion src/userscripts/utils/enableSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const enableSelection = () => {
const a = document.body;
const b = a.parentNode;
if (b) {
b.removeChild(a), b.appendChild(a.cloneNode(!0));
b.removeChild(a);
b.appendChild(a.cloneNode(!0));
}
};
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
"module": "es2020",
"moduleResolution": "node",
"noEmit": true,
"strict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noUncheckedIndexedAccess": true,
"skipLibCheck": true,
"types": ["vitest/globals"]
}
Expand Down

0 comments on commit a813043

Please sign in to comment.