Skip to content

Commit

Permalink
chore: add linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoung19 committed Dec 2, 2024
1 parent 5ef10f5 commit 5002e02
Show file tree
Hide file tree
Showing 6 changed files with 842 additions and 65 deletions.
3 changes: 2 additions & 1 deletion background/messages/createEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export interface CreateEntryRequestBody {
timestamp: number;
}

export interface CreateEntryResponseBody {}
// https://www.totaltypescript.com/the-empty-object-type-in-typescript#representing-an-empty-object
export type CreateEntryResponseBody = Record<PropertyKey, never>;

export const handleCreateEntryRequest = async (body: CreateEntryRequestBody) => {
if (await getClipboardMonitorIsEnabled()) {
Expand Down
17 changes: 17 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-check

import path from "node:path";
import { fileURLToPath } from "node:url";
import { includeIgnoreFile } from "@eslint/compat";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, ".gitignore");

export default tseslint.config(
includeIgnoreFile(gitignorePath),
eslint.configs.recommended,
tseslint.configs.recommended,
);
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"build": "plasmo build",
"build:firefox": "ts-node scripts/build-firefox-setup.ts && prettier package.json --write && plasmo build --target=firefox-mv2 && ts-node scripts/build-firefox-teardown.ts",
"package": "plasmo package",
"lint": "eslint .",
"format": "prettier . --write"
},
"dependencies": {
Expand Down Expand Up @@ -38,15 +39,19 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@eslint/compat": "^1.2.3",
"@eslint/js": "^9.16.0",
"@ianvs/prettier-plugin-sort-imports": "4.1.1",
"@types/chrome": "0.0.258",
"@types/node": "20.11.5",
"@types/react": "18.2.48",
"@types/react-dom": "18.2.18",
"@types/react-window": "^1.8.8",
"eslint": "^9.16.0",
"prettier": "3.2.4",
"ts-node": "^10.9.2",
"typescript": "5.3.3"
"typescript": "5.3.3",
"typescript-eslint": "^8.16.0"
},
"manifest": {
"permissions": [
Expand Down
Loading

0 comments on commit 5002e02

Please sign in to comment.