Skip to content

chore(lint): add node, jsdoc, import plugins to oxlint config - #199

Merged
ryoppippi merged 1 commit into
mainfrom
chore/oxlint-plugins
Dec 10, 2025
Merged

ryoppippi merged 1 commit into
mainfrom
chore/oxlint-plugins

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Dec 9, 2025 •

Copy link
Copy Markdown
Contributor

Summary

  • Add node, jsdoc, import plugins to oxlint configuration
  • Add environment settings (builtin, es2024, node)
  • Add Node.js rules (no-exports-assign, no-new-require)
  • Add JSDoc rules for documentation validation
  • Add Import rules for consistent imports
  • Add curly rule for consistent brace style

Test plan

  • pnpm oxlint passes with no errors

Summary by cubic

Expand oxlint config with Node, JSDoc, and Import plugins, plus env settings, to tighten linting and standardize style. This catches Node misuse, validates docs, and enforces consistent imports.

  • Refactors
    • Add plugins: node, jsdoc, import; enable builtin, es2024, node env.
    • Enforce Node safety: no-exports-assign, no-new-require.
    • Validate JSDoc: access, property names, empty tags, param/property/returns descriptions.
    • Standardize imports: top-level type specifiers, imports first, no duplicates, no mutable exports, no named default.
    • Enforce curly braces for all control statements.

Written for commit b36c8b5. Summary will update automatically on new commits.

- Add node, jsdoc, import plugins

- Add env settings (builtin, es2024, node)

- Add Node.js rules (no-exports-assign, no-new-require)

- Add JSDoc rules for documentation validation

- Add Import rules for consistent imports

- Add curly rule for consistent brace style
@ryoppippi
ryoppippi requested a review from a team as a code owner December 9, 2025 19:13
Copilot AI review requested due to automatic review settings December 9, 2025 19:13
@pkg-pr-new

pkg-pr-new Bot commented Dec 9, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/StackOneHQ/stackone-ai-node/@stackone/ai@199

commit: b36c8b5

@ryoppippi
ryoppippi enabled auto-merge (squash) December 9, 2025 19:15

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extends the oxlint configuration by adding three new linting plugins (node, jsdoc, import) along with their associated rules, environment settings, and a curly brace style rule. The changes align the configuration with common oxlint best practices for Node.js/TypeScript projects.

Key Changes:

  • Added node, jsdoc, and import plugins to enable additional linting capabilities
  • Configured environment settings (builtin, es2024, node) for proper global resolution
  • Added 17 new linting rules across Node.js, JSDoc, Import, and Style categories

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

Comment thread .oxlintrc.jsonc
// Import Rules
// ===================
// Enforce top-level type specifier style
"import/consistent-type-specifier-style": ["error", "top-level"],

Copilot AI Dec 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import/consistent-type-specifier-style rule is set to "top-level", which conflicts with the existing typescript/consistent-type-imports rule on line 77 that uses fixStyle: "inline-type-imports".

The TypeScript rule enforces inline type imports like import { type Foo, Bar } from './module', while this Import rule enforces top-level type imports like import type { Foo } from './module'.

Consider either:

  1. Changing this to ["error", "inline"] to match the TypeScript rule configuration, or
  2. Changing the TypeScript rule's fixStyle to "separate-type-imports" (if supported)

The recommended approach is option 1 to maintain consistency with the existing TypeScript rule.

Suggested change
"import/consistent-type-specifier-style": ["error", "top-level"],
"import/consistent-type-specifier-style": ["error", "inline"],

Copilot uses AI. Check for mistakes.
Comment thread .oxlintrc.jsonc
Comment on lines +112 to +114
"node/no-exports-assign": "error",
// Disallow new require calls
"node/no-new-require": "error",

Copilot AI Dec 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] These Node.js rules (node/no-exports-assign and node/no-new-require) are designed for CommonJS patterns, but this project uses ES modules exclusively ("type": "module" in package.json).

Since the codebase doesn't use require() or exports (confirmed by searching the source), these rules will likely never trigger and provide limited value.

Consider whether these rules are necessary for this project, or if they're being added preemptively for potential CommonJS code. If they're not needed, removing them would simplify the configuration.

Suggested change
"node/no-exports-assign": "error",
// Disallow new require calls
"node/no-new-require": "error",
// Disallow new require calls

Copilot uses AI. Check for mistakes.
@ryoppippi
ryoppippi merged commit 2cb4620 into main Dec 10, 2025
18 checks passed
@ryoppippi
ryoppippi deleted the chore/oxlint-plugins branch December 10, 2025 14:41
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.

3 participants