From b2597b41c1205f43b64b3207bee6b3c153cadebe Mon Sep 17 00:00:00 2001 From: yue Date: Fri, 25 Oct 2024 17:21:11 +0900 Subject: [PATCH] feat(@pixiv/eslint-config): update rules --- .../eslint-config/src/__snapshots__/next.rules.json | 12 ++++++++++-- .../src/__snapshots__/recommended.rules.json | 12 ++++++++++-- packages/eslint-config/src/config.ts | 10 ++++++++-- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/packages/eslint-config/src/__snapshots__/next.rules.json b/packages/eslint-config/src/__snapshots__/next.rules.json index 8f5c891..147e214 100644 --- a/packages/eslint-config/src/__snapshots__/next.rules.json +++ b/packages/eslint-config/src/__snapshots__/next.rules.json @@ -4,7 +4,12 @@ "no-fallthrough": "error", "no-constant-condition": "error", "object-shorthand": "error", - "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_" + } + ], "@typescript-eslint/consistent-type-imports": [ "error", { @@ -38,9 +43,12 @@ ] } ], - "react/prop-types": "warn", "react/require-render-return": 2, "react/self-closing-comp": "error", + "react/jsx-boolean-value": [ + "error", + "never" + ], "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "error", "react-compiler/react-compiler": "warn", diff --git a/packages/eslint-config/src/__snapshots__/recommended.rules.json b/packages/eslint-config/src/__snapshots__/recommended.rules.json index 880d60e..4ab41bc 100644 --- a/packages/eslint-config/src/__snapshots__/recommended.rules.json +++ b/packages/eslint-config/src/__snapshots__/recommended.rules.json @@ -4,7 +4,12 @@ "no-fallthrough": "error", "no-constant-condition": "error", "object-shorthand": "error", - "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_" + } + ], "@typescript-eslint/consistent-type-imports": [ "error", { @@ -38,9 +43,12 @@ ] } ], - "react/prop-types": "warn", "react/require-render-return": 2, "react/self-closing-comp": "error", + "react/jsx-boolean-value": [ + "error", + "never" + ], "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "error", "react-compiler/react-compiler": "warn", diff --git a/packages/eslint-config/src/config.ts b/packages/eslint-config/src/config.ts index d69a564..5cbd88a 100644 --- a/packages/eslint-config/src/config.ts +++ b/packages/eslint-config/src/config.ts @@ -85,7 +85,12 @@ export const typescript = () => [ rules: { 'no-unused-vars': 'off', - '@typescript-eslint/no-unused-vars': 'error', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + }, + ], "@typescript-eslint/consistent-type-imports": [ "error", { @@ -122,7 +127,8 @@ export const react = () => [ "react/self-closing-comp": "error", "react/react-in-jsx-scope": "off", "react/jsx-no-target-blank": "off", - "react/prop-types": "warn", + 'react/prop-types': 'off', + "react/jsx-boolean-value": ["error", "never"], "react/display-name": "warn", "react/no-unknown-property": [ "error",