Skip to content

feat(oxlint-config): enhacne rules and plugins#172

Merged
dangreen merged 3 commits into
mainfrom
oxc-config-enhacne
Jun 5, 2026
Merged

feat(oxlint-config): enhacne rules and plugins#172
dangreen merged 3 commits into
mainfrom
oxc-config-enhacne

Conversation

@dangreen
Copy link
Copy Markdown
Member

@dangreen dangreen commented Jun 5, 2026

No description provided.

Copy link
Copy Markdown
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 updates the oxlint-config package to enable additional plugins in overrides, refine several rule configurations, and extend the custom @trigen/oxlint-config plugin with a new rule to enforce type-import style and merging behavior.

Changes:

  • Add/adjust override-level plugins declarations so rule namespaces (e.g., import/*, jsdoc/*, typescript/*, react/*) are consistently available where used.
  • Update TypeScript/React/basic rule settings (e.g., typescript/no-invalid-void-type options, react/jsx-curly-brace-presence options, naming convention allowances).
  • Add a new custom rule trigen/type-import-style and refine import-order / named-import-order plugin behavior.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/oxlint-config/src/test.js Adds TypeScript plugin + additional rule disables for test files.
packages/oxlint-config/src/subconfigs/typescript.js Enhances TS rules (type imports + void type options) and enables plugins for .d.ts overrides.
packages/oxlint-config/src/subconfigs/typescript-type-checked.js Removes consistent-type-imports from the type-checked layer.
packages/oxlint-config/src/subconfigs/react.stylistic.js Adjusts react/jsx-curly-brace-presence configuration to a more granular option object.
packages/oxlint-config/src/subconfigs/react.js Ensures jsdoc plugin is enabled for JSX override that configures jsdoc/* rules.
packages/oxlint-config/src/subconfigs/jsdoc.js Adds jsdoc plugin to the TS override so the override’s jsdoc/* rules are resolvable.
packages/oxlint-config/src/subconfigs/configs.js Enables import plugin for config-file overrides using import/* rules.
packages/oxlint-config/src/subconfigs/basic.js Tweaks eslint/no-void and naming-convention settings (e.g., trailing $ allowances).
packages/oxlint-config/src/storybook.js Enables import/react/typescript plugins for story overrides using those rule namespaces.
packages/oxlint-config/src/plugin/type-import-style.js Introduces new custom rule to prefer import type and merge type/value imports.
packages/oxlint-config/src/plugin/named-import-order.js Normalizes $-wrapped names when matching ordering patterns.
packages/oxlint-config/src/plugin/index.js Registers the new type-import-style rule in the plugin exports.
packages/oxlint-config/src/plugin/import-order.js Adjusts import ordering logic (notably newline checks and item selection/fixing behavior).

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

Comment on lines 163 to +166
function getImportItems(imports, options) {
return imports.map((node, index) => ({
index,
node,
rank: getRank(node, options)
}))
return imports
.filter(node => node.specifiers.length > 0)
.map((node, index) => ({
Comment on lines 234 to 236
function canFix(sourceCode, items) {
return !hasSideEffectImports(items)
&& !hasInnerComments(sourceCode, items)
return !hasInnerComments(sourceCode, items)
}
Comment on lines +1 to +6
function shouldConvert(node) {
return node.importKind !== 'type'
&& node.specifiers.length > 0
&& node.specifiers.every(specifier => specifier.type === 'ImportSpecifier'
&& specifier.importKind === 'type')
}
Comment on lines +31 to +40
function canMerge(sourceCode, typeNode, valueNode) {
return typeNode.source.value === valueNode.source.value
&& isTypeImport(typeNode)
&& isNamedImport(typeNode)
&& isNamedImport(valueNode)
&& !isTypeImport(valueNode)
&& !hasImportAttributes(typeNode)
&& !hasImportAttributes(valueNode)
&& !hasCommentsBetween(sourceCode, typeNode, valueNode)
}
Comment on lines +164 to +169
'eslint/no-void': [
'off',
{
allowAsStatement: true
}
],
Copy link
Copy Markdown
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Comment on lines +14 to 15
plugins: ['typescript'],
rules: {
Comment on lines 353 to +356
const unorderedPair = getFirstUnorderedPair(items)
const invalidNewlines = hasInvalidNewlines(items, options)
const invalidNewlinePair = getInvalidNewlinePair(sourceCode, items, options)

if (!unorderedPair && !invalidNewlines) {
if (!unorderedPair && !invalidNewlinePair) {
Copy link
Copy Markdown
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

@dangreen dangreen merged commit d040660 into main Jun 5, 2026
6 checks passed
@dangreen dangreen deleted the oxc-config-enhacne branch June 5, 2026 14:46
@github-actions github-actions Bot mentioned this pull request Jun 5, 2026
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.

2 participants