This commit is contained in:
nakrovati 2025-05-21 15:31:47 +05:00 committed by GitHub
commit 0dd2d9c81e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 1673 additions and 1127 deletions

View File

@ -1,22 +0,0 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"prettier"
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parserOptions: { ecmaVersion: "latest", sourceType: "module" },
settings: { react: { version: "18.2" } },
plugins: ["react-refresh"],
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"react/prop-types": 0,
},
};

39
eslint.config.js Normal file
View File

@ -0,0 +1,39 @@
import js from "@eslint/js";
import { defineConfig, globalIgnores } from "eslint/config";
import react from "eslint-plugin-react";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import prettier from "eslint-config-prettier/flat";
export default defineConfig([
globalIgnores(["dist/"]),
reactHooks.configs["recommended-latest"],
reactRefresh.configs.vite,
{
plugins: { js, react },
files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
extends: [js.configs.recommended],
rules: {
...react.configs.recommended.rules,
...react.configs["jsx-runtime"].rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"react/prop-types": 0,
},
settings: { react: { version: "18.2" } },
languageOptions: {
parserOptions: { ecmaFeatures: { jsx: true } },
globals: { ...globals.browser, ...globals.es2020 },
},
},
{
files: ["**/context/**/*.jsx", "**/context/**/*.tsx"],
rules: {
"react-refresh/only-export-components": "off",
},
},
prettier,
]);

2704
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -45,17 +45,17 @@
"usehooks-ts": "^3.1.0"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.0.14",
"@tailwindcss/vite": "^4.1.4",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^8.55.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"postcss": "^8.4.32",
"prettier": "3.2.5",
"eslint": "^9.25.1",
"eslint-config-prettier": "^10.1.2",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.0.0",
"prettier": "^3.5.3",
"tailwindcss": "^4.0.14",
"vite": "^6.3.4"
},

View File

@ -1,5 +0,0 @@
export default {
plugins: {
'@tailwindcss/postcss': {},
},
}

View File

@ -661,7 +661,7 @@ export default function ControlPanel({
let obj = null;
try {
obj = JSON.parse(text);
} catch (error) {
} catch {
return;
}
const v = new Validator();

View File

@ -42,7 +42,7 @@ export default function ImportDiagram({
let jsonObject = null;
try {
jsonObject = JSON.parse(e.target.result);
} catch (error) {
} catch {
setError({
type: STATUS.ERROR,
message: "The file contains an error.",

View File

@ -26,6 +26,7 @@ import { isRtl } from "../i18n/utils/rtl";
import { useSearchParams } from "react-router-dom";
import { get } from "../api/gists";
// eslint-disable-next-line react-refresh/only-export-components
export const IdContext = createContext({ gistId: "", setGistId: () => {} });
const SIDEPANEL_MIN_WIDTH = 384;

View File

@ -1,7 +1,8 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
plugins: [tailwindcss(), react()],
});