Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Preview/Oxlint#84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
alexcoderabbitai wants to merge2 commits intomain
base:main
Choose a base branch
Loading
frompreview/oxlint
Open

Preview/Oxlint#84

alexcoderabbitai wants to merge2 commits intomainfrompreview/oxlint

Conversation

@alexcoderabbitai
Copy link

@alexcoderabbitaialexcoderabbitai commentedOct 1, 2025
edited
Loading

image

Summary by CodeRabbit

  • Chores

    • Added configuration for automated code reviews across the entire codebase.
    • Enabled a new JavaScript/TypeScript linter and disabled a previous tool.
    • Enforced strict linting by treating all rule violations as errors.
  • Tests

    • Introduced negative test cases and demo snippets to validate linting and error detection.
    • Scenarios cover syntax errors, unreachable code, unused variables, shadowing, duplicate keys, loose equality, missing semicolons, and other common issues.

@coderabbitai
Copy link

coderabbitaibot commentedOct 1, 2025
edited
Loading

Walkthrough

Adds new linting/tooling configuration files and several JavaScript/TypeScript-like files containing intentionally invalid or lint-triggering code snippets for negative testing and rule enforcement demonstrations.

Changes

Cohort / File(s)Summary
Tooling configuration
\.coderabbit.yaml,\.oxlintrc.json
Introduces CodeRabbit review config with path filters and tool toggles (biome off, oxc on). Adds oxc lint config enforcing all rules as errors.
JS error catalog
oxc1.js,oxc5.js
Adds files with deliberately erroneous and code-smell JS snippets: redeclarations, invalid syntax/usages, debugger, deep nesting, console logs, unused functions/vars.
Lint/negative test cases
oxc1.test,oxc3.test
Adds collections of problematic JS/TS-like snippets for lint/type error scenarios: unreachable code, unused vars, shadowing, illegal control flow, duplicate keys/members, misuse of async, reserved identifiers, and formatting issues.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws at lint’s decree,
A warren of rules for code to see.
Bad bits burrow, errors squeak—
Oxc sniffs them out each week.
With tidy nests, our tests will sing,
Hop-hop—clean commits we bring! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check nameStatusExplanationResolution
Title Check❓ InconclusiveThe title “Preview/Oxlint” is a generic reference to the branch or feature area rather than a clear, concise summary of the primary changes in this pull request, which include adding OxLint configuration and related test files; it does not communicate the key purpose or scope of the update.Rename the pull request to a more descriptive title that highlights the main change, for example “Add OxLint configuration and sample lint error tests,” so that reviewers can immediately understand the purpose of the changes.
✅ Passed checks (2 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branchpreview/oxlint

Comment@coderabbitai help to get the list of available commands and usage tips.

@alexcoderabbitaialexcoderabbitai marked this pull request as ready for reviewOctober 1, 2025 17:46
Copy link

@coderabbitaicoderabbitaibot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
oxc1.test (1)

83-85:Complete the redeclared variable test case.

The test case for redeclared variables is incomplete - it only declaresduplicateVar once without demonstrating the actual redeclaration error.

Apply this diff to complete the test case:

 // redeclared variable-let duplicateVar+let duplicateVar = 1;+let duplicateVar = 2; // Redeclaration error
🧹 Nitpick comments (2)
.coderabbit.yaml (1)

2-2:Minor spacing issue after comma.

The YAML contains too few spaces after the comma in the path_filters array. While functional, adding a space improves readability and satisfies YAML style guidelines.

Apply this diff to improve formatting:

-  path_filters: ["**/*","*.*"]+  path_filters: ["**/*", "*.*"]
oxc1.test (1)

69-82:Remove duplicate test cases.

Lines 69-82 duplicate test cases already covered in lines 1-15. The duplicate cases add no additional value for negative testing.

Apply this diff to remove the duplicates:

--// unused variable-function unusedVarExample() {-    const unusedVariable = "unused";-}--// unreachable code-function unreachableExample() {-    return;-    console.log("unreachable");-}--// missing semicolon-console.log("semicolon missing")
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and betweenef04b8d andd5eecf0.

📒 Files selected for processing (6)
  • .coderabbit.yaml (1 hunks)
  • .oxlintrc.json (1 hunks)
  • oxc1.js (1 hunks)
  • oxc1.test (1 hunks)
  • oxc3.test (1 hunks)
  • oxc5.js (1 hunks)
🧰 Additional context used
🪛 Oxlint (1.16.0)
oxc1.js

[error] 16-16: Cannot assign to this expression

oxc5.js

[warning] 14-14:debugger statement is not allowed

Remove the debugger statement

(eslint(no-debugger))


[warning] 10-10: Function 'doSomethingBad' is declared but never used.

Consider removing this declaration.

(eslint(no-unused-vars))


[warning] 18-18: Function 'complexFunction' is declared but never used.

Consider removing this declaration.

(eslint(no-unused-vars))


[warning] 36-36: Function 'unusedFunction' is declared but never used.

Consider removing this declaration.

(eslint(no-unused-vars))


[warning] 41-41: Variable 'X' is declared but never used. Unused variables should start with a '_'.

Consider removing this declaration.

(eslint(no-unused-vars))

🪛 YAMLlint (1.37.1)
.coderabbit.yaml

[warning] 2-2: too few spaces after comma

(commas)

🔇 Additional comments (6)
.oxlintrc.json (1)

1-5:Aggressive rule configuration suitable for testing purposes.

The configuration sets all oxlint rules to error severity, which is appropriate for this PR's purpose of demonstrating linting capabilities with intentionally problematic code. However, be aware that this configuration would be too strict for typical production use, where you'd want to selectively enable rules or set some to "warn" level.

.coderabbit.yaml (1)

1-7:Configuration correctly enables oxc testing.

The configuration appropriately enables oxc linting while disabling biome, and the path_filters ensure all files are included for review. This aligns well with the PR's objective of testing oxlint capabilities.

oxc1.js (1)

1-36:Intentional error catalog for linting validation.

This file serves as a collection of deliberately invalid JavaScript patterns to test oxlint's error detection capabilities. Each snippet is properly labeled with its error type (redeclared variables, duplicate parameters, constant reassignment, etc.). This is appropriate for a testing/demonstration repository.

oxc5.js (1)

1-42:Intentional anti-patterns for code quality demonstration.

This file contains deliberately poor coding practices and code smells (unused variables, loose equality, debugger statements, deep nesting, etc.) to demonstrate oxlint's code quality checks. Each issue is properly commented. This is appropriate for testing and validation purposes.

oxc3.test (1)

1-107:Comprehensive TypeScript error catalog for validation.

This test file provides an extensive collection of intentionally invalid TypeScript constructs covering type errors, redeclarations, control flow issues, scope problems, enum/interface concerns, and async/sync misuse. The variety and coverage make it valuable for validating oxlint's TypeScript error detection capabilities.

oxc1.test (1)

1-68:Good comprehensive coverage of common linting violations.

The test file successfully demonstrates a wide range of linting issues including unused variables, unreachable code, missing semicolons, redeclarations, non-strict equality, empty blocks, console statements, variable shadowing, var usage, indentation issues, trailing spaces, mixed tabs/spaces, and undefined variables.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@coderabbitaicoderabbitai[bot]coderabbitai[bot] left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@alexcoderabbitai

[8]ページ先頭

©2009-2025 Movatter.jp