Skip to content
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

fix(linter): detect vitest jest alias rules #7567

Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"plugins": ["jest"],
"categories": {
"correctness": "off"
},
"rules": {
"jest/no-identical-title": "error"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"plugins": ["vitest"],
"categories": {
"correctness": "off"
},
"rules": {
"vitest/no-identical-title": "error"
}
}
4 changes: 4 additions & 0 deletions apps/oxlint/fixtures/jest_and_vitest_alias_rules/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
describe("foo", () => {
it("works", () => {});
it("works", () => {});
});
23 changes: 23 additions & 0 deletions apps/oxlint/src/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,4 +777,27 @@ mod test {
]);
assert_eq!(result.number_of_files, 1);
}

#[test]
fn test_jest_and_vitest_alias_rules() {
let args = &[
"-c",
"fixtures/jest_and_vitest_alias_rules/oxlint-jest.json",
"fixtures/jest_and_vitest_alias_rules/test.js",
];
let result = test(args);
assert_eq!(result.number_of_files, 1);
assert_eq!(result.number_of_warnings, 0);
assert_eq!(result.number_of_errors, 1);

let args = &[
"-c",
"fixtures/jest_and_vitest_alias_rules/oxlint-vitest.json",
"fixtures/jest_and_vitest_alias_rules/test.js",
];
let result = test(args);
assert_eq!(result.number_of_files, 1);
assert_eq!(result.number_of_warnings, 0);
assert_eq!(result.number_of_errors, 1);
}
}
Binary file added npm/oxc-wasm/oxc_wasm_bg.wasm
camc314 marked this conversation as resolved.
Show resolved Hide resolved
Binary file not shown.
Loading