Skip to content

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

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

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

Conversation

@jcosta33

@jcosta33 jcosta33 commented Nov 9, 2026 •

Copy link
Copy Markdown

Adds code-quality and JSDoc rules to @frontify/oxlint-config-basic (and so @frontify/oxlint-config-react).

Errors, cheap to fix:

  • no-nested-ternary, no-else-return: keep branches flat.
  • typescript/switch-exhaustiveness-check: TypeScript only catches a missing case when the switch must return a value; this covers the rest, so adding a union member flags every switch that misses it. A default does not count as covering a union.
  • unicorn/no-array-reduce: a loop reads clearer.
  • eslint-comments/require-description: every lint exception says why.
  • no-empty, no-useless-catch: no swallowed errors. They applied to JS files only; now TypeScript too.
  • JSDoc shape for existing doc blocks: a summary, @default, @param name - meaning, @returns meaning, no {Type} braces (TypeScript files only). No rule requires a doc block. The rules oxlint lacks natively come from eslint-plugin-jsdoc, loaded as jsdoc-js.

Warnings, to raise to errors once consumers clear them, since fixing them takes judgment:

  • complexity (10), max-depth (3), max-params (3): flag functions that do too much to read or test.
  • no-param-reassign (props: true): no hidden mutation of arguments.

complexity, max-depth, max-params, no-else-return, no-nested-ternary and no-param-reassign are off in tests and stories, which favour readable inline fixtures. import/no-cycle is left out: it is slow and repeats dependency-cruiser.

Oxlint lints whole files, so a repo bumping to this version must clear the errors in its bump PR (oxlint --fix does most) or set rules to warn locally.

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: 485ef68

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