Skip to content

Commit 1429aaf

Browse files
committed
fix(many): update eslint-disable comments for oxlint's rule IDs
Two disable comments reference rule names that do not match oxlint's actual rule IDs, so they silently stopped suppressing anything: - packages/__docs__/globals.ts: @instructure/no-relative-imports -> instructure/no-relative-imports. oxlint's custom rule has no @ scope prefix. - packages/ui-i18n/src/textDirectionContextConsumer.tsx: react/forbid-foreign-prop-types -> react-js/forbid-foreign-prop-types. The bridged eslint-plugin-react is aliased react-js. Delete 6 jsx_a11y/role-has-required-aria-props disable comments in TreeBrowser's TreeCollection (v1 and v2): - oxlint's rule does not require aria-selected for the treeitem role at all, unlike e.g. checkbox, which requires aria-checked, so there was nothing for these comments to suppress. oxlint accepts both jsx-a11y/* and jsx_a11y/* spellings for disable comments, so the unrelated jsx-a11y/* comments in Checkbox, FileDrop, Img, NumberInput, and RadioInput needed no change. Also trims a trailing space in one ColorPreset test title, an unrelated vitest/valid-title auto-fix.
1 parent 94b4037 commit 1429aaf

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)