You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/reference/eslint-plugin-react-hooks/index.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,36 +5,36 @@ version: rc
5
5
6
6
<Intro>
7
7
8
-
`eslint-plugin-react-hooks`provides ESLint rules to enforce the [Rules of React](/reference/rules).
8
+
O `eslint-plugin-react-hooks`fornece regras do ESLint para impor as [Regras do React](/reference/rules).
9
9
10
10
</Intro>
11
11
12
-
This plugin helps you catch violations of React's rules at build time, ensuring your components and hooks follow React's rules for correctness and performance. The lints cover both fundamental React patterns (exhaustive-deps and rules-of-hooks) and issues flagged by React Compiler. React Compiler diagnostics are automatically surfaced by this ESLint plugin, and can be used even if your app hasn't adopted the compiler yet.
12
+
Este plugin ajuda você a detectar violações das regras do React em tempo de compilação, garantindo que seus componentes e hooks sigam as regras do React para correção e desempenho. Os lints cobrem tanto padrões fundamentais do React (exhaustive-deps e rules-of-hooks) quanto problemas sinalizados pelo React Compiler. Os diagnósticos do React Compiler são automaticamente exibidos por este plugin ESLint e podem ser usados mesmo que seu aplicativo ainda não tenha adotado o compilador.
13
13
14
14
<Note>
15
-
When the compiler reports a diagnostic, it means that the compiler was able to statically detect a pattern that is not supported or breaks the Rules of React. When it detects this, it**automatically**skips over those components and hooks, while keeping the rest of your app compiled. This ensures optimal coverage of safe optimizations that won't break your app.
15
+
Quando o compilador relata um diagnóstico, isso significa que o compilador foi capaz de detectar estaticamente um padrão que não é suportado ou quebra as Regras do React. Quando ele detecta isso, ele**automaticamente**ignora esses componentes e hooks, enquanto mantém o restante do seu aplicativo compilado. Isso garante uma cobertura ideal de otimizações seguras que não quebrarão seu aplicativo.
16
16
17
-
What this means for linting, is that you don’t need to fix all violations immediately. Address them at your own pace to gradually increase the number of optimized components.
17
+
O que isso significa para o linting é que você não precisa corrigir todas as violações imediatamente. Resolva-as no seu próprio ritmo para aumentar gradualmente o número de componentes otimizados.
18
18
</Note>
19
19
20
-
## Recommended Rules {/*recommended*/}
21
-
22
-
These rules are included in the`recommended`preset in`eslint-plugin-react-hooks`:
23
-
24
-
*[`exhaustive-deps`](/reference/eslint-plugin-react-hooks/lints/exhaustive-deps) - Validates that dependency arrays for React hooks contain all necessary dependencies
25
-
*[`rules-of-hooks`](/reference/eslint-plugin-react-hooks/lints/rules-of-hooks) - Validates that components and hooks follow the Rules of Hooks
26
-
*[`component-hook-factories`](/reference/eslint-plugin-react-hooks/lints/component-hook-factories) - Validates higher order functions defining nested components or hooks
27
-
*[`config`](/reference/eslint-plugin-react-hooks/lints/config) - Validates the compiler configuration options
28
-
*[`error-boundaries`](/reference/eslint-plugin-react-hooks/lints/error-boundaries) - Validates usage of Error Boundaries instead of try/catch for child errors
29
-
*[`gating`](/reference/eslint-plugin-react-hooks/lints/gating) - Validates configuration of gating mode
30
-
*[`globals`](/reference/eslint-plugin-react-hooks/lints/globals) - Validates against assignment/mutation of globals during render
31
-
*[`immutability`](/reference/eslint-plugin-react-hooks/lints/immutability) - Validates against mutating props, state, and other immutable values
32
-
*[`incompatible-library`](/reference/eslint-plugin-react-hooks/lints/incompatible-library) - Validates against usage of libraries which are incompatible with memoization
33
-
*[`preserve-manual-memoization`](/reference/eslint-plugin-react-hooks/lints/preserve-manual-memoization) - Validates that existing manual memoization is preserved by the compiler
34
-
*[`purity`](/reference/eslint-plugin-react-hooks/lints/purity) - Validates that components/hooks are pure by checking known-impure functions
35
-
*[`refs`](/reference/eslint-plugin-react-hooks/lints/refs) - Validates correct usage of refs, not reading/writing during render
36
-
*[`set-state-in-effect`](/reference/eslint-plugin-react-hooks/lints/set-state-in-effect) - Validates against calling setState synchronously in an effect
37
-
*[`set-state-in-render`](/reference/eslint-plugin-react-hooks/lints/set-state-in-render) - Validates against setting state during render
38
-
*[`static-components`](/reference/eslint-plugin-react-hooks/lints/static-components) - Validates that components are static, not recreated every render
39
-
*[`unsupported-syntax`](/reference/eslint-plugin-react-hooks/lints/unsupported-syntax) - Validates against syntax that React Compiler does not support
40
-
*[`use-memo`](/reference/eslint-plugin-react-hooks/lints/use-memo) - Validates usage of the `useMemo`hook without a return value
20
+
## Regras Recomendadas {/*recommended*/}
21
+
22
+
Estas regras estão incluídas no preset`recommended`em`eslint-plugin-react-hooks`:
23
+
24
+
*[`exhaustive-deps`](/reference/eslint-plugin-react-hooks/lints/exhaustive-deps) - Valida que os arrays de dependência para hooks do React contêm todas as dependências necessárias
25
+
*[`rules-of-hooks`](/reference/eslint-plugin-react-hooks/lints/rules-of-hooks) - Valida que componentes e hooks seguem as Regras dos Hooks
26
+
*[`component-hook-factories`](/reference/eslint-plugin-react-hooks/lints/component-hook-factories) - Valida funções de ordem superior que definem componentes ou hooks aninhados
27
+
*[`config`](/reference/eslint-plugin-react-hooks/lints/config) - Valida as opções de configuração do compilador
28
+
*[`error-boundaries`](/reference/eslint-plugin-react-hooks/lints/error-boundaries) - Valida o uso de Error Boundaries em vez de try/catch para erros de filhos
29
+
*[`gating`](/reference/eslint-plugin-react-hooks/lints/gating) - Valida a configuração do modo de gating
30
+
*[`globals`](/reference/eslint-plugin-react-hooks/lints/globals) - Valida contra atribuição/mutação de globais durante a renderização
31
+
*[`immutability`](/reference/eslint-plugin-react-hooks/lints/immutability) - Valida contra mutação de props, estado e outros valores imutáveis
32
+
*[`incompatible-library`](/reference/eslint-plugin-react-hooks/lints/incompatible-library) - Valida contra o uso de bibliotecas incompatíveis com memoização
33
+
*[`preserve-manual-memoization`](/reference/eslint-plugin-react-hooks/lints/preserve-manual-memoization) - Valida que a memoização manual existente é preservada pelo compilador
34
+
*[`purity`](/reference/eslint-plugin-react-hooks/lints/purity) - Valida que componentes/hooks são puros verificando funções conhecidas como impuras
35
+
*[`refs`](/reference/eslint-plugin-react-hooks/lints/refs) - Valida o uso correto de refs, não lendo/escrevendo durante a renderização
36
+
*[`set-state-in-effect`](/reference/eslint-plugin-react-hooks/lints/set-state-in-effect) - Valida contra a chamada de setState síncronamente em um effect
37
+
*[`set-state-in-render`](/reference/eslint-plugin-react-hooks/lints/set-state-in-render) - Valida contra a definição de estado durante a renderização
38
+
*[`static-components`](/reference/eslint-plugin-react-hooks/lints/static-components) - Valida que os componentes são estáticos, não recriados a cada renderização
39
+
*[`unsupported-syntax`](/reference/eslint-plugin-react-hooks/lints/unsupported-syntax) - Valida contra sintaxe que o React Compiler não suporta
40
+
*[`use-memo`](/reference/eslint-plugin-react-hooks/lints/use-memo) - Valida o uso do hook `useMemo`sem um valor de retorno
0 commit comments