@@ -32,13 +32,6 @@ pub use self::{
3232 react_perf:: * , regex:: * , typescript:: * , unicorn:: * , url:: * , vitest:: * , vue:: * ,
3333} ;
3434
35- /// List of Jest rules that have Vitest equivalents.
36- // When adding a new rule to this list, please ensure that
37- // the crates/oxc_linter/data/vitest_compatible_jest_rules.json
38- // file is also updated. The JSON file is used by the oxlint-migrate
39- // and eslint-plugin-oxlint repos to keep everything synced.
40- const VITEST_COMPATIBLE_JEST_RULES : [ & str ; 0 ] = [ ] ;
41-
4235/// List of Eslint rules that have TypeScript equivalents.
4336// When adding a new rule to this list, please ensure oxlint-migrate is also updated.
4437// See https://github.com/oxc-project/oxlint-migrate/blob/659b461eaf5b2f8a7283822ae84a5e619c86fca3/src/constants.ts#L24
@@ -84,13 +77,6 @@ const TYPESCRIPT_COMPATIBLE_ESLINT_RULES: [&str; 18] = [
8477 // "space-infix-ops"
8578] ;
8679
87- /// Check if the Jest rule is adapted to Vitest.
88- /// Many Vitest rule are essentially ports of Jest plugin rules with minor modifications.
89- /// For these rules, we use the corresponding jest rules with some adjustments for compatibility.
90- pub fn is_jest_rule_adapted_to_vitest ( rule_name : & str ) -> bool {
91- VITEST_COMPATIBLE_JEST_RULES . binary_search ( & rule_name) . is_ok ( )
92- }
93-
9480/// Check if the Eslint rule is adapted to Typescript.
9581/// Many Typescript rule are essentially ports of Eslint plugin rules with minor modifications.
9682/// For these rules, we use the corresponding eslint rules with some adjustments for compatibility.
@@ -259,38 +245,10 @@ fn read_to_arena_bytes_unknown_size(mut file: File, allocator: &Allocator) -> io
259245
260246#[ cfg( test) ]
261247mod test {
262- use crate :: utils:: {
263- TYPESCRIPT_COMPATIBLE_ESLINT_RULES , VITEST_COMPATIBLE_JEST_RULES , read_to_string,
264- } ;
265- use serde_json:: from_str;
266- use std:: path:: Path ;
248+ use crate :: utils:: TYPESCRIPT_COMPATIBLE_ESLINT_RULES ;
267249
268250 #[ test]
269251 fn test_typescript_rules_list_is_alphabetized ( ) {
270252 assert ! ( TYPESCRIPT_COMPATIBLE_ESLINT_RULES . is_sorted( ) ) ;
271253 }
272-
273- #[ test]
274- fn test_vitest_rules_list_is_alphabetized ( ) {
275- assert ! ( VITEST_COMPATIBLE_JEST_RULES . is_sorted( ) ) ;
276- }
277-
278- #[ test]
279- fn test_vitest_rules_list_matches_json ( ) {
280- let json_path =
281- Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "data/vitest_compatible_jest_rules.json" ) ;
282- let json = read_to_string ( & json_path) . expect ( "Failed to read vitest rules JSON file" ) ;
283- let json_rules: Vec < String > =
284- from_str ( & json) . expect ( "Failed to parse vitest rules JSON file" ) ;
285- assert ! ( json_rules. is_sorted( ) , "vitest JSON list must be alphabetized" ) ;
286- let rust_rules: Vec < & str > = VITEST_COMPATIBLE_JEST_RULES . to_vec ( ) ;
287- assert_eq ! (
288- json_rules. len( ) ,
289- rust_rules. len( ) ,
290- "Rule counts differ between Rust constant and JSON, please ensure both are updated"
291- ) ;
292- for ( json_rule, rust_rule) in json_rules. iter ( ) . zip ( rust_rules. iter ( ) ) {
293- assert_eq ! ( json_rule, rust_rule, "Mismatch for rule: {json_rule}" ) ;
294- }
295- }
296254}
0 commit comments