Skip to content

feat(oxlint): add code-quality and JSDoc rules - #161

Open
jcosta33 wants to merge 8 commits into
mainfrom
feat-oxlint-code-quality-rules
Open

jcosta33 wants to merge 8 commits into
mainfrom
feat-oxlint-code-quality-rules

Conversation

@jcosta33

@jcosta33 jcosta33 commented Nov 9, 2026 •

Copy link
Copy Markdown

Adds lint errors for code that is quick to fix. The base Oxlint config applies them to both shared Oxlint packages.

  • Report nested ternaries, redundant else branches, array reduce, and lint suppressions without a reason.
  • Require an explicit switch case for every member of a TypeScript union. Check empty blocks and redundant catches in TypeScript.
  • Check existing JSDoc for a summary and formatted parameter and return tags. Require an @default value when the documented function has a parameter or destructured prop with a default. Keep JSDoc type annotations in JavaScript. Load the JSDoc plugin from the shared package so consumers can use isolated installs.

Warn at 10 for complexity and 3 for nesting depth and parameter count. Also warn when code reassigns parameters or mutates their properties. Tests and stories have six exceptions so fixtures can stay inline.

Dependency Cruiser already checks for import cycles.

When upgrading, address the new errors or set the affected rules to warnings locally.

Child #162

Adds complexity (10), max-depth (3), max-params (3), no-else-return,
no-nested-ternary, no-param-reassign (props), import/no-cycle and
typescript/switch-exhaustiveness-check as warnings. The size and style
rules are off in tests and stories.
Adds native jsdoc rules (check-tag-names, no-defaults, require-param for
blocks that already list params, param and returns descriptions) and
eslint-plugin-jsdoc as the jsdoc-js JS plugin for no-types,
check-param-names and require-hyphen-before-param-description. No rule
requires a doc block.
@changeset-bot

changeset-bot Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e5bbc1a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@frontify/oxlint-config-basic Minor
@frontify/oxlint-config-react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@changeset-bot

changeset-bot Bot commented Nov 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9bcae32

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@frontify/oxlint-config-basic Minor
@frontify/oxlint-config-react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jcosta33 jcosta33 changed the title feat(oxlint): warn on code-quality rules feat(oxlint): warn on code-quality and JSDoc rules Nov 9, 2026
@jcosta33 jcosta33 changed the title feat(oxlint): warn on code-quality and JSDoc rules feat(oxlint): add code-quality and JSDoc rules Nov 9, 2026
@jcosta33
jcosta33 marked this pull request as ready for review November 9, 2026 14:30
Require unions to list every case, share one test glob list, apply no-empty and no-useless-catch to TypeScript, and add unicorn/no-array-reduce and eslint-comments/require-description.
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.

1 participant