Skip to content

Commit 65cacf4

Browse files
committed
fix(many): update eslint-disable comments for oxlint's rule IDs
Fix eslint-disable comments in 2 files whose referenced rule names don't match oxlint's actual rule IDs and had silently stopped suppressing anything: - packages/__docs__/globals.ts: @instructure/no-relative-imports -> instructure/no-relative-imports - packages/ui-i18n/src/textDirectionContextConsumer.tsx: react/forbid-foreign-prop-types -> react-js/forbid-foreign-prop-types Confirmed both were real gaps, not cosmetic: restoring the original names and re-running oxlint reproduces the real underlying violation on the line below each comment, plus an "unused eslint-disable directive" error on the comment line itself. Delete 6 jsx_a11y/role-has-required-aria-props disable comments in TreeBrowser's TreeCollection (v1 and v2) that are genuinely dead. Verified with a synthetic role="treeitem" element carrying zero aria props: oxlint's rule doesn't list aria-selected as a required prop for the treeitem role at all (unlike e.g. role="checkbox", which it correctly flags without aria-checked), so there was never anything for these comments to suppress under oxlint, regardless of spelling or the aria-selected prop-spread pattern in the component itself. Note: oxlint's jsx-a11y plugin accepts both jsx-a11y/* and jsx_a11y/* as equivalent for disable comments, so the jsx-a11y/* comments in Checkbox, FileDrop, Img, NumberInput, and RadioInput were never broken and are left untouched. Also includes oxlint's own --fix output trimming a trailing space in one ColorPreset test title (vitest/valid-title).
1 parent 1607b8a commit 65cacf4

5 files changed

Lines changed: 4 additions & 10 deletions

File tree

packages/__docs__/globals.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ import { dark, light } from '@instructure/ui-themes'
4242
import { debounce } from '@instructure/debounce'
4343

4444
// @ts-expect-error no type declarations for CSS side-effect import
45-
// eslint-disable-next-line @instructure/no-relative-imports
45+
// eslint-disable-next-line instructure/no-relative-imports
4646
import '../ui-icons/src/generated/icon-font/Solid/InstructureIcons-Solid.css'
4747

4848
// @ts-expect-error no type declarations for CSS side-effect import
49-
// eslint-disable-next-line @instructure/no-relative-imports
49+
// eslint-disable-next-line instructure/no-relative-imports
5050
import '../ui-icons/src/generated/icon-font/Line/InstructureIcons-Line.css'
5151

5252
import { DateTime } from '@instructure/ui-i18n'

packages/ui-color-picker/src/ColorPreset/__tests__/ColorPreset.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe('<ColorPreset />', () => {
8989
})
9090
})
9191

92-
it('should default to using the hex code as aria-label when colorScreenReaderLabel is not provided ', async () => {
92+
it('should default to using the hex code as aria-label when colorScreenReaderLabel is not provided', async () => {
9393
render(<ColorPreset {...testValue} />)
9494
const buttons = screen.getAllByRole('button')
9595

packages/ui-i18n/src/textDirectionContextConsumer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ const textDirectionContextConsumer: TextDirectionContextConsumerType =
171171
TextDirectionContextConsumerForwardingRef.defaultProps =
172172
ComposedComponent.defaultProps
173173
TextDirectionContextConsumerForwardingRef.propTypes =
174-
// eslint-disable-next-line react/forbid-foreign-prop-types
174+
// eslint-disable-next-line react-js/forbid-foreign-prop-types
175175
ComposedComponent.propTypes
176176
TextDirectionContextConsumerForwardingRef.allowedProps =
177177
ComposedComponent.allowedProps

packages/ui-tree-browser/src/TreeBrowser/v1/TreeCollection/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ class TreeCollection extends Component<
233233
return (
234234
<li
235235
id={key}
236-
/* eslint-disable-next-line jsx-a11y/role-has-required-aria-props */
237236
role="treeitem"
238237
css={styles?.item}
239238
tabIndex={-1}
@@ -314,7 +313,6 @@ class TreeCollection extends Component<
314313
<li
315314
key={`i${position}`}
316315
tabIndex={-1}
317-
/* eslint-disable-next-line jsx-a11y/role-has-required-aria-props */
318316
role="treeitem"
319317
aria-label={item.name}
320318
css={styles?.item}
@@ -385,7 +383,6 @@ class TreeCollection extends Component<
385383
}}
386384
css={styles?.treeCollection}
387385
tabIndex={-1}
388-
/* eslint-disable-next-line jsx-a11y/role-has-required-aria-props */
389386
role="treeitem"
390387
aria-label={`${this.props.name}${
391388
this.props.descriptor ? ` ${this.props.descriptor}` : ''

packages/ui-tree-browser/src/TreeBrowser/v2/TreeCollection/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ class TreeCollection extends Component<
235235
return (
236236
<li
237237
id={key}
238-
/* eslint-disable-next-line jsx-a11y/role-has-required-aria-props */
239238
role="treeitem"
240239
css={styles?.item}
241240
tabIndex={-1}
@@ -316,7 +315,6 @@ class TreeCollection extends Component<
316315
<li
317316
key={`i${position}`}
318317
tabIndex={-1}
319-
/* eslint-disable-next-line jsx-a11y/role-has-required-aria-props */
320318
role="treeitem"
321319
aria-label={item.name}
322320
css={styles?.item}
@@ -387,7 +385,6 @@ class TreeCollection extends Component<
387385
}}
388386
css={styles?.treeCollection}
389387
tabIndex={-1}
390-
/* eslint-disable-next-line jsx-a11y/role-has-required-aria-props */
391388
role="treeitem"
392389
aria-label={`${this.props.name}${
393390
this.props.descriptor ? ` ${this.props.descriptor}` : ''

0 commit comments

Comments
 (0)