Skip to content

feat(lint): reject unnecessary type parameters - #170

Draft
jcosta33 wants to merge 1 commit into
codex/no-unchecked-json-castfrom
codex/no-unnecessary-type-parameters
Draft

jcosta33 wants to merge 1 commit into
codex/no-unchecked-json-castfrom
codex/no-unnecessary-type-parameters

Conversation

@jcosta33

@jcosta33 jcosta33 commented Dec 3, 2026 •

Copy link
Copy Markdown

Report unnecessary TypeScript type parameters as errors in both base configs. A generic parameter should connect types. When a function only checks its input, give that input the type the function needs.

Make five existing warnings errors. Oxlint enforces the limits on complexity, nesting, and parameter count, as well as the rule against mutating parameters. ESLint enforces JSX boolean shorthand.

Return undefined explicitly when the JSON rule finds no binding. This satisfies the React ESLint config’s noImplicitReturns check.

Example

Before

export function isMissing<Value>(value: Value | null | undefined): value is null | undefined {
    return value === null || value === undefined;
}

Corrected

export function isMissing(value: unknown): value is null | undefined {
    return value === null || value === undefined;
}

Parent #169

@jcosta33
jcosta33 added this pull request to stack #163 December 3, 2026 12:54
@changeset-bot

changeset-bot Bot commented Dec 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c4b5272

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

This PR includes changesets to release 5 packages
Name Type
@frontify/oxlint-config-basic Minor
@frontify/oxlint-config-react Minor
@frontify/eslint-config-react Minor
@frontify/eslint-plugin Patch
@frontify/eslint-config-basic 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

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