just eslint things
Some checks failed
Actions / Lint Plugins (push) Failing after 28s
Actions / Build Plugins (push) Successful in 31s

This commit is contained in:
cswimr 2024-12-22 16:46:54 -05:00
parent ecaefc115c
commit e53a289ea1
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
6 changed files with 113 additions and 654 deletions

View file

@ -1,3 +1,3 @@
{
"recommendations": ["rvest.vs-code-prettier-eslint", "dbaeumer.vscode-eslint"]
"recommendations": ["dbaeumer.vscode-eslint"]
}

13
.vscode/settings.json vendored
View file

@ -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"
}
}

View file

@ -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,
];

View file

@ -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"
}

View file

@ -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,44 +13,44 @@ 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 {
const text = props.text.trim();
export default function EmojiPicker(props: {
text: string;
}): ReactNode | undefined {
const text = props.text.trim();
if (text.length < 3) {
return undefined
};
if (text.length < 3) {
return undefined;
}
const emoji = UnicodeEmoji.getEmojis().find(emoji => emoji.keywords.includes(text));
if (!emoji) {
return undefined
};
const emoji = UnicodeEmoji.getEmojis().find((emoji) =>
emoji.keywords.includes(text),
);
if (!emoji) {
return undefined;
}
return (
<Inline
actions={
<ActionPanel>
<Action
label={`Copy ${emoji.emoji} to clipboard`}
onAction={async () => {
console.log(emoji.emoji)
await Clipboard.writeText(emoji.emoji);
showHud(`${emoji.emoji} copied to clipboard`);
}}
/>
</ActionPanel>
}
>
<Inline.Left>
<Content.H3>
{text}
</Content.H3>
</Inline.Left>
<Inline.Separator icon={Icons.ArrowRight}/>
<Inline.Right>
<Content.H3>
{emoji.emoji}
</Content.H3>
</Inline.Right>
</Inline>
);
};
return (
<Inline
actions={
<ActionPanel>
<Action
label={`Copy ${emoji.emoji} to clipboard`}
onAction={async () => {
console.log(emoji.emoji);
await Clipboard.writeText(emoji.emoji);
showHud(`${emoji.emoji} copied to clipboard`);
}}
/>
</ActionPanel>
}
>
<Inline.Left>
<Content.H3>{text}</Content.H3>
</Inline.Left>
<Inline.Separator icon={Icons.ArrowRight} />
<Inline.Right>
<Content.Paragraph>{emoji.emoji}</Content.Paragraph>
</Inline.Right>
</Inline>
);
}

654
yarn.lock

File diff suppressed because it is too large Load diff