just eslint things
This commit is contained in:
parent
ecaefc115c
commit
e53a289ea1
6 changed files with 113 additions and 654 deletions
2
.vscode/extensions.json
vendored
2
.vscode/extensions.json
vendored
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"recommendations": ["rvest.vs-code-prettier-eslint", "dbaeumer.vscode-eslint"]
|
||||
"recommendations": ["dbaeumer.vscode-eslint"]
|
||||
}
|
||||
|
|
13
.vscode/settings.json
vendored
13
.vscode/settings.json
vendored
|
@ -1,9 +1,8 @@
|
|||
{
|
||||
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
|
||||
"editor.formatOnType": false,
|
||||
"editor.formatOnPaste": true,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.formatOnSaveMode": "file",
|
||||
"files.autoSave": "onFocusChange",
|
||||
"vs-code-prettier-eslint.prettierLast": false // set as "true" to run 'prettier' last not first
|
||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
||||
"eslint.format.enable": true,
|
||||
"eslint.codeActionsOnSave.mode": "problems",
|
||||
"eslint.options": {
|
||||
"overrideConfigFile": "eslint.config.mjs"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,13 +2,15 @@ import globals from "globals";
|
|||
import pluginJs from "@eslint/js";
|
||||
import tseslint from "typescript-eslint";
|
||||
import pluginReact from "eslint-plugin-react";
|
||||
|
||||
import pluginPrettierRecommended from "eslint-plugin-prettier/recommended";
|
||||
|
||||
/** @type {import('eslint').Linter.Config[]} */
|
||||
export default [
|
||||
{files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"]},
|
||||
{languageOptions: { globals: globals.browser }},
|
||||
{
|
||||
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
|
||||
},
|
||||
pluginJs.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
pluginReact.configs.flat.recommended,
|
||||
pluginPrettierRecommended,
|
||||
];
|
|
@ -20,11 +20,11 @@
|
|||
"@types/which": "^3.0.4",
|
||||
"@typescript-eslint/parser": "^8.18.1",
|
||||
"eslint": "^9.17.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"eslint-plugin-react": "^7.37.2",
|
||||
"globals": "^15.14.0",
|
||||
"prettier": "^3.4.2",
|
||||
"prettier-eslint": "^16.3.0",
|
||||
"prettier-eslint-cli": "^8.0.1",
|
||||
"typescript": "^5.7.2",
|
||||
"typescript-eslint": "^8.18.1"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
import { Action, ActionPanel, Content, Icons, Inline } from "@project-gauntlet/api/components";
|
||||
import {
|
||||
Action,
|
||||
ActionPanel,
|
||||
Content,
|
||||
Icons,
|
||||
Inline,
|
||||
} from "@project-gauntlet/api/components";
|
||||
import React, { ReactNode } from "react";
|
||||
import { Clipboard, showHud } from "@project-gauntlet/api/helpers";
|
||||
import * as UnicodeEmoji from "unicode-emoji";
|
||||
|
@ -7,17 +13,21 @@ import * as UnicodeEmoji from "unicode-emoji";
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const denoCore: DenoCore = Deno[Deno.internal].core;
|
||||
|
||||
export default function EmojiPicker(props: { text: string }): ReactNode | undefined {
|
||||
export default function EmojiPicker(props: {
|
||||
text: string;
|
||||
}): ReactNode | undefined {
|
||||
const text = props.text.trim();
|
||||
|
||||
if (text.length < 3) {
|
||||
return undefined
|
||||
};
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const emoji = UnicodeEmoji.getEmojis().find(emoji => emoji.keywords.includes(text));
|
||||
const emoji = UnicodeEmoji.getEmojis().find((emoji) =>
|
||||
emoji.keywords.includes(text),
|
||||
);
|
||||
if (!emoji) {
|
||||
return undefined
|
||||
};
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return (
|
||||
<Inline
|
||||
|
@ -26,7 +36,7 @@ export default function EmojiPicker(props: { text: string }): ReactNode | undefi
|
|||
<Action
|
||||
label={`Copy ${emoji.emoji} to clipboard`}
|
||||
onAction={async () => {
|
||||
console.log(emoji.emoji)
|
||||
console.log(emoji.emoji);
|
||||
await Clipboard.writeText(emoji.emoji);
|
||||
showHud(`${emoji.emoji} copied to clipboard`);
|
||||
}}
|
||||
|
@ -35,16 +45,12 @@ export default function EmojiPicker(props: { text: string }): ReactNode | undefi
|
|||
}
|
||||
>
|
||||
<Inline.Left>
|
||||
<Content.H3>
|
||||
{text}
|
||||
</Content.H3>
|
||||
<Content.H3>{text}</Content.H3>
|
||||
</Inline.Left>
|
||||
<Inline.Separator icon={Icons.ArrowRight} />
|
||||
<Inline.Right>
|
||||
<Content.H3>
|
||||
{emoji.emoji}
|
||||
</Content.H3>
|
||||
<Content.Paragraph>{emoji.emoji}</Content.Paragraph>
|
||||
</Inline.Right>
|
||||
</Inline>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue