Skip to content

chore(lint): flag deprecated props in examples, stories and source - #3311

Merged
interactivellama merged 19 commits into
fix/deprecated-dom-apisfrom
feat/v11-llm-4-deprecated-lint
Nov 24, 2026
Merged

interactivellama merged 19 commits into
fix/deprecated-dom-apisfrom
feat/v11-llm-4-deprecated-lint

Conversation

@interactivellama

@interactivellama interactivellama commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Part of the v11 merge train, stack 1 "clean CI": ci-warnings → react-hooks-refs → deprecated-dom-apis → deprecated-prop lint → private exports.

Additional description

Turns on @typescript-eslint/no-deprecated so deprecated props don't spread through copied code, and documents the same rule for consumers.

  • Examples and stories: error. Agents copy __examples__ and stories verbatim, so they must be clean. The .js/.jsx examples and stories are now linted with type information.
  • Library source (components/, utilities/, types/): error. local/no-deprecated (eslint-rules/no-deprecated.mjs) wraps the upstream rule and skips one kind of use: a symbol declared under the same components/<name>/ or utilities/<name>/ directory as the file using it. That is a component reading its own deprecated props to honor them during the 11.x RC. Another component's deprecated prop, or a deprecated React or DOM API, fails. This replaces a per-file suppression count, which would let a new deprecated use hide behind a removed one. The match is by directory, so a deprecated prop of a sibling component in the same directory is also allowed; nothing does that today. .js/.jsx source is checked too, with type information re-enabled for it; one false positive (the createElement feature check in execution-environment.js) carries an inline disable. eslint-rules/__tests__ covers own and cross-component uses, as property reads and as JSX attributes, plus a deprecated DOM API.
  • Four components (Button, ButtonStateful, Input, Textarea) forward their own deprecated onKeyPress to React's deprecated onKeyPress; those lines carry an inline disable until 11.0.
  • Tests are not covered.
  • Lint wall time: about 8.9s before, 10.7s now.

Example and story fixes, one docs(<component>) commit each:

  • accordion base-open: the handler read the global window.event. It now gets the panel's event. This was a real bug.
  • builder-header base-with-page-type-editable: ariaLabelledby="Edit Name" wasn't an element id, so the dialog had no accessible name. Each of the two edit dialogs now points at its own assistive h2, and their ids (dialog, input, tooltip) no longer collide.
  • radio-group and radio-button-group: dropped errorId, which is derived now. One snapshot changed: the RadioButtonGroup Error story's help id is a generated id instead of error-id.
  • setup-assistant: steps use status: 'completed' instead of completedSteps. hub-expandable-steps copies its state array instead of mutating it.

Cross-component source fixes:

  • keyboardNavigableDialog (used by Popover) read the deprecated global window.event and findDOMNode. It now gets the keydown event passed in and compares the trigger to the event target. The old path was unreachable, since Popover attaches the handler only to the open dialog, so this is a refactor; keyboard-navigable-dialog.test.js covers it.

  • ColorPicker passed the deprecated checked to its swatch Radios. The group's value already sets it and RadioGroup only warns without a value, so no warning fired and nothing changes at runtime; this is a cleanup so the source passes the rule.

  • File styled its loading spinner with Spinner's deprecated containerStyle, which warned in development. It now uses style, which lands on the same container. Regression test in files.test.jsx.

Consumer docs: docs/lint-deprecated-props.md and a README section, with the defineConfig(tseslint.configs.base, …) setup (defineConfig from eslint/config; tseslint.config is deprecated). I checked it in a scratch consumer against the built types, in .tsx and (with allowJs) .jsx.

Deprecated DOM/React APIs (keyCode, substr, onKeyPress, MutableRefObject, …) were removed from source in the base PR, so lint stays at 0 errors and 0 warnings.


CONTRIBUTOR checklist (do not remove)

Please complete for every pull request.

Green gate — all of these must pass locally (CI runs the same):

  • npm run lint passes with 0 errors (npm run lint:fix to auto-fix). Warnings are the tracked gradual-migration backlog; do not add new errors.
  • npm run typecheck is clean (tsc --noEmit).
  • npm test -- --run passes — this runs both Vitest projects (jsdom unit + real-browser browser) and the story HTML snapshots. If you changed rendered markup on purpose, update snapshots with npm test -- --run -u and review the diff.
  • npm run build succeeds (type-check + Vite library build + .d.ts + entry shims).

Behavior & docs:

  • First-time contributors: sign the CLA (a bot will comment with instructions).
  • Added/updated Vitest + React Testing Library tests for the change (template: components/button/__tests__). New props and bug fixes should get a regression test. Tests that genuinely need a real browser (focus traversal, layout/measurement, canvas) go in a *.browser.test.jsx file (the browser project); everything else is jsdom.
  • Reviewed the component's Storybook stories: npm run storybook → http://localhost:6007/. Confirm the story actually renders and behaves (deprecated Storyshots/Karma are gone; there is no separate browser-tests server).
  • Story/example code uses the component's real prop API (e.g. slots like content / visualPickerFigure, render props like renderItem, icon props, events), not assumptions — a common source of "component looks broken" reports has been stories authored against the wrong API. Cross-check against components/<name>/__examples__.
  • Storybook Accessibility (a11y) panel shows no new violations for the affected stories.
  • If you added or changed a type, remember runtime PropTypes were removed in the TS migration — types are the contract. Ship accurate .d.ts (they're generated by the build); JS consumers rely on them via editor type-acquisition.

REVIEWER checklist (do not remove)

  • CI is green (GitHub Actions CI workflow: lint, typecheck, test, build). Chromatic visual review, if configured, has been checked.
  • Change has adequate test coverage; bug fixes include a regression test.
  • Reviewed the affected Storybook stories and their a11y panels.
  • Rendered markup still conforms to SLDS — check the story HTML snapshot diff (components/__tests__/__snapshots__/story-snapshots.test.jsx.snap).
  • Public API / package surface: if exports changed, the deep-import contract still holds (@salesforce/design-system-react/components/<name> and nested paths resolve for ESM, CJS, and types). Removing/renaming a public component or export is a breaking change → feat!:/BREAKING CHANGE: and a major version bump.

@interactivellama interactivellama changed the title feat/v11 llm 4 deprecated lint chore(lint): flag deprecated props in examples, stories and source Nov 13, 2026
@interactivellama
interactivellama force-pushed the feat/v11-llm-4-deprecated-lint branch from 04e7262 to 6685abb Compare November 15, 2026 21:48
Base automatically changed from feat/v11-llm-3-prop-jsdoc to master November 15, 2026 21:48
@interactivellama
interactivellama removed this pull request from stack #3312 November 15, 2026 21:48
@interactivellama
interactivellama changed the base branch from master to feat/v11-llm-2-migration-guide November 15, 2026 21:50
@interactivellama
interactivellama removed this pull request from stack #3315 November 16, 2026 05:53
@interactivellama
interactivellama force-pushed the feat/v11-llm-4-deprecated-lint branch from 6685abb to d141e7a Compare November 16, 2026 08:07
@interactivellama
interactivellama changed the base branch from feat/v11-llm-2-migration-guide to fix/deprecated-dom-apis November 16, 2026 08:07
@interactivellama
interactivellama force-pushed the feat/v11-llm-4-deprecated-lint branch from d141e7a to b0bf46f Compare November 17, 2026 02:10
@interactivellama
interactivellama force-pushed the feat/v11-llm-4-deprecated-lint branch 2 times, most recently from 43ba51b to b0ab35e Compare November 17, 2026 08:39
@interactivellama
interactivellama force-pushed the feat/v11-llm-4-deprecated-lint branch from b0ab35e to 44fd7f2 Compare November 17, 2026 17:47
@interactivellama
interactivellama removed this pull request from stack #3324 November 17, 2026 17:47
@interactivellama
interactivellama force-pushed the feat/v11-llm-4-deprecated-lint branch from 44fd7f2 to 56db94e Compare November 17, 2026 21:54
@interactivellama
interactivellama force-pushed the feat/v11-llm-4-deprecated-lint branch from 56db94e to 1b9f716 Compare November 17, 2026 22:45
ariaLabelledby was the text "Edit Name", not the id of an element, so
the dialog had no accessible name.
…ch Radios

The swatch toggle passed checked to each Radio inside a RadioGroup. The
group's value already sets checked, and RadioGroup only warns about
checked when it has no value, so nothing changes at runtime; this
removes the deprecated use so the source passes no-deprecated.
…ntainerStyle

style lands on the same container, so the markup is unchanged and the
development warning is gone.
local/no-deprecated (eslint-rules/no-deprecated.mjs) wraps
@typescript-eslint/no-deprecated and skips only symbols declared under
the same components/<name>/ or utilities/<name>/ directory as the file
using them: a component honoring its own deprecated prop during the
11.x RC. Another component's deprecated prop, or a deprecated React or
DOM API, is an error. It covers components/, utilities/ and types/;
tests, examples and stories are configured separately.

This exempts a kind of use rather than a per-file count, which ESLint's
bulk suppressions would have done, letting a new deprecated use hide
behind a removed one. The four components that forward their own
deprecated onKeyPress to React's deprecated onKeyPress carry an inline
disable until 11.0 removes the prop.
On CI, linting the fixtures crashed inside TypeScript
(getLocalModuleSpecifier -> normalizeSlashes(undefined)): with bundler
resolution and neither paths nor baseUrl, TypeScript 6 has no base
directory when it computes a module specifier. The repo tsconfig sets
paths, so only the fixture project hit it.
CI sets CI=true, which makes typescript-eslint infer a single CLI run.
That mode isn't meant for several ESLint instances in one process: on
the second lint, TypeScript crashed resolving the fixture's import
(getLocalModuleSpecifier -> normalizeSlashes(undefined)). Opt out with
disallowAutomaticSingleRunInference, and drop the fixture paths entry
from the previous commit, which didn't help. Reproduces locally with
CI=true.
…alog

internalHandleClick called handleClick(event) with no event in scope,
so it read the deprecated global window.event, and it compared the
trigger through ReactDOM.findDOMNode, which React 19 removed. Popover
attaches the handler only to the open dialog and this branch runs only
when closed, so it was unreachable and nothing changes at runtime; it
now takes the event and compares the trigger element directly.
The JavaScript block turns off type information, so local/no-deprecated
saw nothing in .js/.jsx source. Give it the project back. The one false
positive, the createElement feature check in execution-environment,
carries an inline disable.
Skip computed object keys, which name a value rather than a property, and
get parser services through ESLintUtils so a file outside the project fails
with the upstream message.
tseslint.config is deprecated in favor of ESLint's own defineConfig.
@interactivellama
interactivellama force-pushed the feat/v11-llm-4-deprecated-lint branch from 3ff043d to 0c9c78d Compare November 21, 2026 00:04
@interactivellama
interactivellama marked this pull request as ready for review November 21, 2026 00:44
interactivellama added a commit that referenced this pull request Nov 23, 2026
The example passed the deprecated productTheme, which the no-deprecated
lint from #3311 rejects in examples. Set the same backgroundColor values
through style, which is the migration the deprecation recommends.
interactivellama added a commit that referenced this pull request Nov 23, 2026
The example passed the deprecated productTheme, which the no-deprecated
lint from #3311 rejects in examples. Set the same backgroundColor values
through style, which is the migration the deprecation recommends.
interactivellama added a commit that referenced this pull request Nov 23, 2026
The example passed the deprecated productTheme, which the no-deprecated
lint from #3311 rejects in examples. Set the same backgroundColor values
through style, which is the migration the deprecation recommends.
@interactivellama
interactivellama removed this pull request from stack #3359 November 23, 2026 07:57
@interactivellama
interactivellama removed this pull request from stack #3360 November 23, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants