Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/calm-rules-warn.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Report nested ternaries, redundant `else` branches, array `reduce`, and lint exc

Check existing JSDoc for summaries and tag formatting. If a documented function has a parameter or destructured prop with a default, include an `@default` tag with its value. Keep JSDoc types in JavaScript and use TypeScript annotations in TypeScript.

Warn about function complexity, nesting depth, parameter count, and parameter mutation. Tests and stories omit those warnings and the errors for nested ternaries and redundant `else` branches.
Report function complexity, nesting depth, parameter count, and parameter mutation as errors. Tests and stories omit these checks and the checks for nested ternaries and redundant `else` branches.
2 changes: 1 addition & 1 deletion .changeset/shared-jsx-boolean.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
'@frontify/oxlint-config-react': minor
---

Share the JSX boolean shorthand rule between ESLint and Oxlint. Oxlint now reports explicit `={true}` on JSX props as an error. Use the prop name alone, such as `<Button disabled />`.
Share the JSX boolean shorthand rule between ESLint and Oxlint. Both linters report explicit `={true}` on JSX props as an error. Use the prop name alone, such as `<Button disabled />`.

Load the recommended JSX accessibility rules from the installed plugin's current configuration export.
8 changes: 8 additions & 0 deletions .changeset/use-related-type-parameters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@frontify/eslint-config-basic': minor
'@frontify/eslint-config-react': minor
'@frontify/oxlint-config-basic': minor
'@frontify/oxlint-config-react': minor
---

ESLint and Oxlint report unnecessary TypeScript type parameters as errors. Use a concrete type or `unknown` when the type parameter does not relate inputs or outputs.
1 change: 1 addition & 0 deletions packages/eslint-config-basic/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ export default defineConfig(
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unnecessary-type-parameters': 'error',
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/no-unsafe-call': 'error',
'@typescript-eslint/no-unsafe-return': 'error',
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-react/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default defineConfig(
'@eslint-react/dom-no-missing-iframe-sandbox': 'error',
'@eslint-react/naming-convention-context-name': 'error',
'@eslint-react/use-state': 'error',
'@eslint-react/kit/jsx-shorthand-boolean': 'warn',
'@eslint-react/kit/jsx-shorthand-boolean': 'error',
},
},
{
Expand Down
2 changes: 2 additions & 0 deletions packages/eslint-plugin/rules/no-unchecked-json-cast.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ function findBinding(sourceCode, identifier) {

scope = scope.upper;
}

return undefined;
}

/**
Expand Down
10 changes: 5 additions & 5 deletions packages/oxlint-config-basic/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,12 @@ export default defineConfig({
'typescript/restrict-template-expressions': 'error',
'typescript/triple-slash-reference': 'error',
'typescript/unbound-method': 'error',
// Size and mutation rules warn until consumers are clean; the rest are errors.
complexity: ['warn', { max: 10 }],
'max-depth': ['warn', { max: 3 }],
'max-params': ['warn', { max: 3 }],
complexity: ['error', { max: 10 }],
'max-depth': ['error', { max: 3 }],
'max-params': ['error', { max: 3 }],
'no-else-return': 'error',
'no-nested-ternary': 'error',
'no-param-reassign': ['warn', { props: true }],
'no-param-reassign': ['error', { props: true }],
// JSDoc rules check existing blocks only: no block is required, and a summary-only block needs no @param.
'jsdoc/check-tag-names': 'error',
'jsdoc/no-defaults': 'error',
Expand Down Expand Up @@ -591,6 +590,7 @@ export default defineConfig({
'typescript/await-thenable': 'error',
'typescript/no-for-in-array': 'error',
'typescript/no-unnecessary-type-assertion': 'error',
'typescript/no-unnecessary-type-parameters': 'error',
'typescript/no-unsafe-argument': 'error',
'typescript/no-unsafe-call': 'error',
'typescript/no-unsafe-return': 'error',
Expand Down