Skip to content

Commit

Permalink
chore: use @eslint-react/eslint-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
tien committed Feb 16, 2025
1 parent 0fdf2d7 commit b69358d
Show file tree
Hide file tree
Showing 4 changed files with 375 additions and 1,835 deletions.
22 changes: 4 additions & 18 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
import eslintReact from "@eslint-react/eslint-plugin";
import { fixupPluginRules } from "@eslint/compat";
import eslint from "@eslint/js";
import reactCompiler from "eslint-plugin-react-compiler";
import reactHooks from "eslint-plugin-react-hooks/index.js";
import reactRefresh from "eslint-plugin-react-refresh";
import reactJsxRuntime from "eslint-plugin-react/configs/jsx-runtime.js";
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
import tseslint from "typescript-eslint";

export default tseslint.config(
{ ignores: ["src/components/ui/"] },
{ ignores: ["src/components/ui/", "src/lib/"] },
eslint.configs.recommended,
...tseslint.configs.recommended,
{
Expand All @@ -25,8 +24,7 @@ export default tseslint.config(
],
},
},
reactRecommended,
reactJsxRuntime,
eslintReact.configs["recommended-typescript"],
{
plugins: {
"react-hooks": fixupPluginRules(reactHooks),
Expand All @@ -42,16 +40,4 @@ export default tseslint.config(
"react-compiler/react-compiler": "error",
},
},
{
settings: {
react: {
version: "detect",
},
},
rules: {
"react/display-name": "off",
"react/no-unescaped-entities": "off",
"react/no-unknown-property": ["error", { ignore: ["css"] }],
},
},
);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"zod": "^3.24.2"
},
"devDependencies": {
"@eslint-react/eslint-plugin": "^1.26.2",
"@eslint/compat": "^1.2.6",
"@eslint/js": "^9.20.0",
"@pandacss/dev": "^0.53.0",
Expand All @@ -69,7 +70,6 @@
"@types/react-dom": "^19.0.3",
"babel-plugin-react-compiler": "19.0.0-beta-30d8a17-20250209",
"eslint": "^9.20.1",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-compiler": "19.0.0-beta-30d8a17-20250209",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.19",
Expand Down
4 changes: 2 additions & 2 deletions src/components/param/codec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { StructParam, type StructParamProps } from "./struct";
import { TupleParam, type TupleParamProps } from "./tuple";
import { VoidParam, type VoidParamProps } from "./void";
import type { Decoded, Shape } from "@polkadot-api/view-builder";
import { createContext, Suspense, useContext, useMemo } from "react";
import { createContext, Suspense, use, useMemo } from "react";
import { css } from "styled-system/css";
import { type CssProperties } from "styled-system/types";

Expand All @@ -26,7 +26,7 @@ export function CodecParam<T = unknown>({
shape,
...props
}: CodecParamProps<T>) {
const depth = useContext(StorageParamDepthContext);
const depth = use(StorageParamDepthContext);

return (
<div
Expand Down
Loading

0 comments on commit b69358d

Please sign in to comment.