chore: upgrade eslint-config-trendmicro and fix lint errors#1140
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle ReportChanges will decrease total bundle size by 17.04kB (-0.58%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: @tonic-ui/react-hooks-esmAssets Changed:
view changes for bundle: @tonic-ui/react-cjsAssets Changed:
view changes for bundle: @tonic-ui/react-hooks-cjsAssets Changed:
view changes for bundle: @tonic-ui/react-icons-cjsAssets Changed:
view changes for bundle: @tonic-ui/react-esmAssets Changed:
view changes for bundle: @tonic-ui/react-icons-esmAssets Changed:
view changes for bundle: @tonic-ui/utils-cjsAssets Changed:
view changes for bundle: @tonic-ui/utils-esmAssets Changed:
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v2 #1140 +/- ##
==========================================
+ Coverage 81.81% 81.96% +0.15%
==========================================
Files 447 448 +1
Lines 7572 7580 +8
Branches 48 48
==========================================
+ Hits 6195 6213 +18
+ Misses 1359 1349 -10
Partials 18 18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Tonic UI DemoOn 2026-05-09 08:00:57 +0000, PR #1140 (b4d10d9) was successfully deployed. You can view it at the following link: |
|
remove |
85730f5 to
8b1695a
Compare
0a41468 to
d645f7a
Compare
…lugin Extend the shared eslint-config-trendmicro base and strip the duplicate `import` plugin from next/core-web-vitals compat output to prevent "Cannot redefine plugin" errors.
- react-icons/build-icons.mjs: remove React import from generated icon component templates - react-docs/update-style-props.mjs: use isNullish from @tonic-ui/utils - react-docs/next.config.mjs: use single quotes for consistency
Update eslint-config-trendmicro across all packages from ^4.1.0 to ^4.1.1.
Update eslint-config-trendmicro across all packages from ^4.1.1 to ^4.1.2.
Update eslint-config-trendmicro across all packages from ^4.1.2 to ^4.1.3.
- Apply eslint --fix autofixes across demo pages and components - Fix consistent-return in TableOfContents useEffect early return - Return no-op cleanup in scrollable tabs and shadow-dom useEffects - Replace == with === in creating-tags keyCode check - Disable jsx-a11y/anchor-is-valid and no-alert in react-docs config for intentional demo patterns - Disable tabindex-no-positive for ButtonBox positive tabIndex test
…^4.1.5 - css-baseline/base-css.js: use dot notation for font theme keys - drawer/styles.js, modal/styles.js: suppress dot-notation on theme token keys - highlight/utils.js: suppress no-useless-escape on regex special chars - toast/ToastManager.js: remove stale eslint-disable-line no-useless-assignment - toast/__tests__/ToastManager.test.js: extract UpdatedToastContent component outside TestComponent to avoid react/no-unstable-nested-components warning - utils/__tests__/isValidComponent.test.js: suppress react/prefer-stateless-function on intentional class component used for test coverage - utils/descendant/useDescendant.js: replace useState with useReducer for force-update - eslint.config.mjs: remove redundant rule overrides now covered by eslint-config-trendmicro - Bump eslint-config-trendmicro to ^4.1.5 across all packages
…t, Menu, TonicProvider, and isValidComponent
…-trendmicro to ^4.2.0 Strip `React` from imports in ~500 docs files now that the new JSX transform no longer requires it. Bump eslint-config-trendmicro to ^4.2.0 across packages to pick up the rule change that surfaces these as errors.
Disable rules that conflict with documentation demo patterns (placeholder links, alerts, console usage, inline handlers) and add a max-len warning with generous limits for doc code samples.
Remove the @stylistic/max-len override in react-docs eslint config now that the upstream preset provides an appropriate default.
…ing warnings - Bump eslint-config-trendmicro across all packages from ^4.3.0 to ^4.4.1. - prefer-const: change let to const where never reassigned; remove shadowing declaration in InputControl so cleanup disconnects the MutationObserver as intended. - Remove unused // eslint-disable-line no-unused-vars directives on catch clauses. - react/hook-use-state: rename setters to match set<Value> pattern; replace force-rerender useState with useReducer; drop useState for values that never change. - react/no-unstable-nested-components: hoist NavList/NavItem and InnerComponent out of parent components; suppress inline where the wrapper is memoized and passed as a slot prop. - react/no-danger: suppress inline in _document with context comments for the analytics loader and pre-paint color-mode script. - jsx-a11y/control-has-associated-label: add aria-label to bare range inputs and the gomoku canvas; add text children to datalist options.
Flip patch check to informational so cleanup PRs with tiny diffs (e.g., 2/4 lines = 50%) no longer block merges against the auto target. Tighten project threshold from 2% to 1% and add removed_code_behavior: adjust_base to neutralize deletion noise, keeping project as the real regression gate. Also add if_ci_failed and if_not_found guardrails.
…node collisions Errors may be passed as React nodes (e.g., JSX elements), which collide as `[object Object]` keys and trigger duplicate-key warnings. Switch back to index-based keys with an inline eslint-disable for `react/no-array-index-key`.
Convert the closure factory into an IIFE so the memoization state is captured once at module load instead of per call. Also add a TODO to abstract the global `window` reference behind an environment provider.
…olation - Replace `react-highlight-words` with the built-in `Highlight` component from `@tonic-ui/react` in InstantSearchRefinementList and SearchDropdownFilterTag, dropping the now-unused custom highlight styles and `useColorStyle` hook. - Switch the resize-handle utils test to `jest.isolateModulesAsync` with dynamic `import()` so module isolation works with ESM.
…ownBase Move the menu list sizing logic out of DropdownBase into a dedicated `getMenuListStyle` helper in `experiments/dropdown/styles.js`, supporting `portalled`, `fit-toggle`, and default sizing modes with a shared 40vh max height. In DropdownBase, drop the unused `useTheme` dependency, normalize `renderItemProp` via `ensureFunction`, and convert the recursive `renderItems` to a memoized `useCallback` with an inner helper to thread the key prefix.
d645f7a to
b4d10d9
Compare
Summary
Demo: https://trendmicro-frontend.github.io/tonic-ui-demo/react/pr-1140/
Dependencies
eslint-config-trendmicrofrom^4.0.0to^4.1.5across all packagesexamples/react-templateto match other packagesCI/CD
NPM_TOKEN, addid-token: write)Docs
@babel/preset-reactruntime: 'automatic'andimportSourceoptions in allbabel.config.jsfilesLint fixes —
packages/reactreact/jsx-max-props-per-line,react/jsx-no-bind,react/prop-types) now covered upstream byeslint-config-trendmicro@4.1.5useState()force-update pattern withuseReducer((x) => !x, false)to satisfyreact/hook-use-statereact/no-unstable-nested-components(e.g.,ToastManager.test.js)theme?.fonts?.base) instead of bracket access (theme?.fonts?.['base']) incss-baseline/base-css.js// eslint-disable-line dot-notationfor intentional bracket access on computed theme keys indrawer/styles.jsandmodal/styles.js// eslint-disable-next-line no-useless-escapefor the RegExp character class inhighlight/utils.js// eslint-disable-line no-useless-assignmentcomment inToastManager.js// eslint-disable-next-line react/prefer-stateless-functionfor intentional class component inisValidComponent.test.jsLint fixes —
packages/react-docseslint-config-trendmicroand deduplicate plugin configurationreact/jsx-max-props-per-line,jsx-a11y/anchor-is-valid, andno-alertglobally (intentional patterns in demo pages)consistent-returnerrors inuseEffecthooks (usereturn () => {}no-op cleanup for early returns)eqeqeqviolation (keyCode == 8→keyCode === 8)Lint fixes — other packages
import React from 'react'statements acrosspackages/react,packages/react-icons,packages/react-hooks, andpackages/react-base(safe withruntime: 'automatic')__fixtures__ESLint ignore pattern to match nested paths (**/__fixtures__/**)preserve-caught-errorlint errors by attaching caught errors as{ cause }eslint-disablecomments acrosspackages/utilsand other packagesreact/jsx-no-leaked-render,react/no-array-index-key,react/button-has-type,no-useless-assignment, and other lint warningsTest coverage improvements
TonicProvider.test.js— covers prop validation error logging forcolorModeandcolorStyleCSSBaseline.test.js— covers the<Global styles={...} />render pathDescendant.test.js— covers descendant registration, re-registration (already-registered branch), and index assignmentMenu.test.js— add test forgetFocusableElementswhenmenuContentRef.currentis nullisValidComponent.test.js— add Suspense render test to cover theLazyComponentfixture bodyTest plan
yarn lint— no errors across all packagesyarn teston affected packages (react,react-hooks,react-base,react-icons,utils)🤖 Generated with Claude Code