mirror of
https://github.com/artegoser/AnoPaper.git
synced 2024-12-22 17:03:46 +03:00
fix: linting
This commit is contained in:
parent
1542768e25
commit
687abb318e
8 changed files with 25 additions and 11 deletions
17
.eslintrc.cjs
Normal file
17
.eslintrc.cjs
Normal file
|
@ -0,0 +1,17 @@
|
|||
module.exports = {
|
||||
env: { browser: true, es2020: true },
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended",
|
||||
"plugin:react/jsx-runtime",
|
||||
"plugin:react-hooks/recommended",
|
||||
],
|
||||
parserOptions: { ecmaVersion: "latest", sourceType: "module" },
|
||||
settings: { react: { version: "18.2" } },
|
||||
plugins: ["react-refresh"],
|
||||
rules: {
|
||||
"react-refresh/only-export-components": "warn",
|
||||
"react/prop-types": 0,
|
||||
"no-undef": 0,
|
||||
},
|
||||
};
|
|
@ -48,14 +48,15 @@ function CodeBlock(props) {
|
|||
function RenderMarkdown(props) {
|
||||
return (
|
||||
<ReactMarkdown
|
||||
children={props.children}
|
||||
remarkPlugins={[remarkMath, remarkGfm]}
|
||||
rehypePlugins={[rehypeMathjax]}
|
||||
components={{
|
||||
code: CodeBlock,
|
||||
pre: Pre,
|
||||
}}
|
||||
/>
|
||||
>
|
||||
{props.children}
|
||||
</ReactMarkdown>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,6 @@ let en = {
|
|||
Search: "Search",
|
||||
NoNotesFound: "No notes found",
|
||||
LocalNote: "Local",
|
||||
PublicNote: "Public",
|
||||
Menu: "Menu",
|
||||
};
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ let eo = {
|
|||
Search: "Serĉo",
|
||||
NoNotesFound: "Neniuj notoj trovitaj",
|
||||
LocalNote: "Loka",
|
||||
PublicNote: "Publika",
|
||||
PublishNote: "Publika",
|
||||
Menu: "Menuo",
|
||||
};
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ let es = {
|
|||
Search: "Buscar",
|
||||
NoNotesFound: "No se encontraron notas",
|
||||
LocalNote: "Local",
|
||||
PublicNote: "Pública",
|
||||
PublishNote: "Pública",
|
||||
Menu: "Menú",
|
||||
};
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ let ja = {
|
|||
Search: "検索",
|
||||
NoNotesFound: "メモが見つかりません",
|
||||
LocalNote: "地元",
|
||||
PublicNote: "公共",
|
||||
PublishNote: "公共",
|
||||
Menu: "メニュー",
|
||||
};
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ let zh = {
|
|||
Search: "搜索",
|
||||
NoNotesFound: "找不到笔记",
|
||||
LocalNote: "当地的",
|
||||
PublicNote: "民众",
|
||||
PublishNote: "民众",
|
||||
Menu: "菜单",
|
||||
};
|
||||
|
||||
|
|
|
@ -65,8 +65,6 @@ function CreateNote() {
|
|||
const [text, setText] = useState(localStorage.getItem("NoteText"));
|
||||
const [name, setName] = useState(localStorage.getItem("NoteName"));
|
||||
|
||||
const [date, setDate] = useState(Date.now());
|
||||
|
||||
async function previewChange(val) {
|
||||
let md = await unified()
|
||||
.use(remarkGfm)
|
||||
|
@ -106,7 +104,7 @@ function CreateNote() {
|
|||
localStorage.setItem("NoteName", data.name);
|
||||
});
|
||||
|
||||
socket.on("roomJoined", (data) => {
|
||||
socket.on("roomJoined", () => {
|
||||
nameUpdate(localStorage.getItem("NoteName"), true);
|
||||
textUpdate(localStorage.getItem("NoteText"), true);
|
||||
});
|
||||
|
@ -124,7 +122,6 @@ function CreateNote() {
|
|||
id="preview"
|
||||
onClick={(val) => {
|
||||
setText(localStorage.getItem("NoteText"));
|
||||
setDate(Date.now());
|
||||
setPreview(val.target.checked);
|
||||
}}
|
||||
/>
|
||||
|
|
Loading…
Add table
Reference in a new issue