-
Notifications
You must be signed in to change notification settings - Fork 6
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preview/Oxlint #84
Conversation
WalkthroughAdds 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Comment |
@coderabbitai
coderabbitai
bot
left a comment
There was a problem hiding this 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 declares
duplicateVar
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.
📒 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.
Uh oh!
There was an error while loading. Please reload this page.
Summary by CodeRabbit
Chores
Tests