diff --git a/web/eslint.config.js b/web/eslint.config.js index 5e6b472f583e..aba2670175ec 100644 --- a/web/eslint.config.js +++ b/web/eslint.config.js @@ -19,5 +19,18 @@ export default defineConfig([ ecmaVersion: 2020, globals: globals.browser, }, + rules: { + // Context providers and hook files commonly export both a component + // (the Provider) and a hook (useContext). Allow constant exports so + // these don't need to be split into separate files. + 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], + // TODO: upgrade these react-hooks v7 rules from 'warn' to 'error' after + // refactoring set-state-in-effect, ref-as-instance-var, and manual + // memoization patterns in the web codebase. + 'react-hooks/set-state-in-effect': 'warn', + 'react-hooks/refs': 'warn', + 'react-hooks/preserve-manual-memoization': 'warn', + 'react-hooks/static-components': 'warn', + }, }, ]) diff --git a/web/src/i18n/ko.ts b/web/src/i18n/ko.ts index e4dc604c4cfb..adac224948c4 100644 --- a/web/src/i18n/ko.ts +++ b/web/src/i18n/ko.ts @@ -385,7 +385,7 @@ export const ko: Translations = { rawYaml: "원본 YAML 설정", searchResults: "검색 결과", fields: "개 필드", - noFieldsMatch: '\"{query}\"와(과) 일치하는 필드가 없습니다', + noFieldsMatch: '"{query}"와(과) 일치하는 필드가 없습니다', configSaved: "설정이 저장되었습니다", yamlConfigSaved: "YAML 설정이 저장되었습니다", failedToSave: "저장에 실패했습니다", diff --git a/web/src/i18n/uk.ts b/web/src/i18n/uk.ts index c8c5c28787ca..7cf91b024803 100644 --- a/web/src/i18n/uk.ts +++ b/web/src/i18n/uk.ts @@ -387,7 +387,7 @@ export const uk: Translations = { rawYaml: "Сирий YAML-конфіг", searchResults: "Результати пошуку", fields: "поле(ів)", - noFieldsMatch: 'Немає полів, що відповідають \"{query}\"', + noFieldsMatch: 'Немає полів, що відповідають "{query}"', configSaved: "Конфігурацію збережено", yamlConfigSaved: "YAML-конфігурацію збережено", failedToSave: "Не вдалося зберегти", diff --git a/web/src/lib/pty-mobile-input.ts b/web/src/lib/pty-mobile-input.ts index d6eb024101a7..6c3b29d6aae6 100644 --- a/web/src/lib/pty-mobile-input.ts +++ b/web/src/lib/pty-mobile-input.ts @@ -15,7 +15,9 @@ function removeLastChar(text: string): string { return c.join(""); } + function isPlainText(data: string): boolean { + // eslint-disable-next-line no-control-regex -- terminal data may contain control chars return !/[\x00-\x1f\x7f]/.test(data); }