Skip to content

Conversation

@connorshea
Copy link
Collaborator

@connorshea connorshea commented Nov 1, 2025

Part of #14743.

  • eslint/no-self-assign
  • jest/prefer-lowercase-title
  • jsx-a11y/label-has-associated-control
  • jsx-a11y/media-has-caption
  • jsx-a11y/no-noninteractive-tabindex
  • promise/spec-only
  • typescript/consistent-generic-constructors

For jsx-a11y/no-noninteractive-tabindex, this required changing the way this is implemented slightly so we properly derive the default value, otherwise the JsonSchema derivation complained.

Generated docs:

## Configuration

This rule accepts a configuration object with the following properties:

### props

type: `boolean`

default: `true`

The `props` option when set to `false`, disables the checking of properties.

With `props` set to `false` the following are examples of correct code:
\```javascript
obj.a = obj.a;
obj.a.b = obj.a.b;
obj["a"] = obj["a"];
obj[a] = obj[a];
\```
## Configuration

This rule accepts a configuration object with the following properties:

### option


default: `"constructor"`

Specifies where the generic type should be specified.

Possible values:
- `"constructor"` (default):Type arguments that only appear on the type annotation are disallowed.
- `"type-annotation"`: Type arguments that only appear on the constructor are disallowed.
## Configuration

This rule accepts a configuration object with the following properties:

### allowedPrefixes

type: `string[]`

default: `[]`

This array option allows specifying prefixes, which contain capitals that titles
can start with. This can be useful when writing tests for API endpoints, where
you'd like to prefix with the HTTP method.
By default, nothing is allowed (the equivalent of `{ "allowedPrefixes": [] }`).

Example of **correct** code for the `{ "allowedPrefixes": ["GET"] }` option:
\```js
/* eslint jest/prefer-lowercase-title: ["error", { "allowedPrefixes": ["GET"] }] */
describe('GET /live');
\```


### ignore

type: `string[]`

default: `[]`

This array option controls which Jest or Vitest functions are checked by this rule. There
are four possible values:
- `"describe"`
- `"test"`
- `"it"`
- `"bench"`

By default, none of these options are enabled (the equivalent of
`{ "ignore": [] }`).

Example of **correct** code for the `{ "ignore": ["describe"] }` option:
\```js
/* eslint jest/prefer-lowercase-title: ["error", { "ignore": ["describe"] }] */
describe('Uppercase description');
\```

Example of **correct** code for the `{ "ignore": ["test"] }` option:
\```js
/* eslint jest/prefer-lowercase-title: ["error", { "ignore": ["test"] }] */
test('Uppercase description');
\```

Example of **correct** code for the `{ "ignore": ["it"] }` option:
\```js
/* eslint jest/prefer-lowercase-title: ["error", { "ignore": ["it"] }] */
it('Uppercase description');
\```


### ignoreTopLevelDescribe

type: `boolean`

default: `false`

This option can be set to allow only the top-level `describe` blocks to have a
title starting with an upper-case letter.

Example of **correct** code for the `{ "ignoreTopLevelDescribe": true }` option:
\```js
/* eslint jest/prefer-lowercase-title: ["error", { "ignoreTopLevelDescribe": true }] */
describe('MyClass', () => {
describe('#myMethod', () => {
it('does things', () => {
//
});
});
});
\```


### lowercaseFirstCharacterOnly

type: `boolean`

default: `true`

This option can be set to only validate that the first character of a test name is lowercased.

Example of **correct** code for the `{ "lowercaseFirstCharacterOnly": true }` option:
\```js
/* eslint vitest/prefer-lowercase-title: ["error", { "lowercaseFirstCharacterOnly": true }] */
describe('myClass', () => {
describe('myMethod', () => {
it('does things', () => {
//
});
});
});
\```

Example of **incorrect** code for the `{ "lowercaseFirstCharacterOnly": true }` option:
\```js
/* eslint vitest/prefer-lowercase-title: ["error", { "lowercaseFirstCharacterOnly": true }] */
describe('MyClass', () => {
describe('MyMethod', () => {
it('does things', () => {
//
});
});
});
\```
## Configuration

This rule accepts a configuration object with the following properties:

### audio

type: `string[]`

default: `["audio"]`

Element names to treat as `<audio>` elements


### track

type: `string[]`

default: `["track"]`

Element names to treat as `<track>` elements


### video

type: `string[]`

default: `["video"]`

Element names to treat as `<video>` elements
## Configuration

This rule accepts a configuration object with the following properties:

### assert

type: `"html-for" | "nesting" | "both" | "either"`

default: `"either"`

The type of association required between the label and the control.


### controlComponents

type: `string[]`

default: `[]`

Custom JSX components to be treated as form controls.


### depth

type: `integer`

default: `2`

Maximum depth to search for a nested control.


### labelAttributes

type: `string[]`

default: `["alt", "aria-label", "aria-labelledby"]`

Attributes to check for accessible label text.


### labelComponents

type: `string[]`

default: `["label"]`

Custom JSX components to be treated as labels.
## Configuration

This rule accepts a configuration object with the following properties:

### allowExpressionValues

type: `boolean`

default: `true`

If `true`, allows tabIndex values to be expression values (e.g., variables, ternaries). If `false`, only string literal values are allowed.


### roles

type: `string[]`

default: `["tabpanel"]`

An array of ARIA roles that should be considered interactive.


### tags

type: `string[]`

default: `[]`

An array of custom HTML elements that should be considered interactive.
## Configuration

This rule accepts a configuration object with the following properties:

### allowedMethods

type: `string[]`

default: `null`

List of Promise static methods that are allowed to be used.

Copilot AI review requested due to automatic review settings November 1, 2025 16:57
@connorshea connorshea requested a review from camc314 as a code owner November 1, 2025 16:57
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 1, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added A-linter Area - Linter C-docs Category - Documentation. Related to user-facing or internal documentation labels Nov 1, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds schema configuration support to multiple linter rules by implementing JSON schema serialization/deserialization. The changes enable proper configuration documentation and validation for these rules.

  • Adds Serialize, Deserialize, and JsonSchema derives to configuration structs
  • Adds #[serde(rename_all = "...")] attributes for consistent JSON key naming
  • Moves configuration option documentation from rule-level doc comments to field-level doc comments
  • Adds config parameter to declare_oxc_lint! macro calls

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
consistent_generic_constructors.rs Adds schema support and field-level documentation for generic constructor preferences
spec_only.rs Adds schema support for Promise method allowlist configuration
no_noninteractive_tabindex.rs Adds schema support and refactors Default implementation to config struct
media_has_caption.rs Adds schema support for media element name configuration
label_has_associated_control.rs Adds schema support for label and control configuration
prefer_lowercase_title/mod.rs Reorganizes documentation by moving option descriptions to field-level comments
no_self_assign.rs Moves props option documentation from rule-level to field-level

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

connorshea and others added 2 commits November 1, 2025 10:58
…tructors.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Connor Shea <connor.james.shea@gmail.com>
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 1, 2025

CodSpeed Performance Report

Merging #15209 will not alter performance

Comparing connorshea:docs-bundle-7 (ed83ca0) with main (377e904)

Summary

✅ 4 untouched
⏩ 33 skipped1

Footnotes

  1. 33 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@camc314 camc314 merged commit d5c4ce8 into oxc-project:main Nov 2, 2025
21 checks passed
@Boshen Boshen mentioned this pull request Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-docs Category - Documentation. Related to user-facing or internal documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants