From b3785f85a1ff530ac8175299862f4732baedcc4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Figueredo?= <63759223+jpfigueredo@users.noreply.github.com> Date: Sat, 21 Nov 2026 09:44:14 -0300 Subject: [PATCH] =?UTF-8?q?Tradu=C3=A7=C3=A3o=20de=20`lints/gating.md`=20p?= =?UTF-8?q?ara=20Portugu=C3=AAs=20(Brasil)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eslint-plugin-react-hooks/lints/gating.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/content/reference/eslint-plugin-react-hooks/lints/gating.md b/src/content/reference/eslint-plugin-react-hooks/lints/gating.md index 3bd662a86e..d99b95b2c3 100644 --- a/src/content/reference/eslint-plugin-react-hooks/lints/gating.md +++ b/src/content/reference/eslint-plugin-react-hooks/lints/gating.md @@ -4,53 +4,53 @@ title: gating -Validates configuration of [gating mode](/reference/react-compiler/gating). +Valida a configuração do [modo de gating](/reference/react-compiler/gating). -## Rule Details {/*rule-details*/} +## Detalhes da Regra {/*rule-details*/} -Gating mode lets you gradually adopt React Compiler by marking specific components for optimization. This rule ensures your gating configuration is valid so the compiler knows which components to process. +O modo de gating permite adotar o React Compiler gradualmente, marcando componentes específicos para otimização. Esta regra garante que sua configuração de gating seja válida para que o compilador saiba quais componentes processar. -### Invalid {/*invalid*/} +### Inválido {/*invalid*/} -Examples of incorrect code for this rule: +Exemplos de código incorreto para esta regra: ```js -// ❌ Missing required fields +// ❌ Campos obrigatórios ausentes module.exports = { plugins: [ ['babel-plugin-react-compiler', { gating: { importSpecifierName: '__experimental_useCompiler' - // Missing 'source' field + // Campo 'source' ausente } }] ] }; -// ❌ Invalid gating type +// ❌ Tipo de gating inválido module.exports = { plugins: [ ['babel-plugin-react-compiler', { - gating: '__experimental_useCompiler' // Should be object + gating: '__experimental_useCompiler' // Deveria ser um objeto }] ] }; ``` -### Valid {/*valid*/} +### Válido {/*valid*/} -Examples of correct code for this rule: +Exemplos de código correto para esta regra: ```js -// ✅ Complete gating configuration +// ✅ Configuração de gating completa module.exports = { plugins: [ ['babel-plugin-react-compiler', { gating: { - importSpecifierName: 'isCompilerEnabled', // exported function name - source: 'featureFlags' // module name + importSpecifierName: 'isCompilerEnabled', // nome da função exportada + source: 'featureFlags' // nome do módulo } }] ] @@ -61,11 +61,11 @@ export function isCompilerEnabled() { // ... } -// ✅ No gating (compile everything) +// ✅ Sem gating (compila tudo) module.exports = { plugins: [ ['babel-plugin-react-compiler', { - // No gating field - compiles all components + // Sem o campo gating - compila todos os componentes }] ] };