@@ -10,7 +10,7 @@ test('defines a valid Oxlint config', () => {
1010
1111 expect ( config ) . toHaveProperty ( 'rules' , expect . any ( Object ) ) ;
1212 expect ( config . rules ) . toHaveProperty ( 'unicorn/no-null' , 'off' ) ;
13- expect ( config . rules ) . not . toHaveProperty ( 'react/jsx-filename-extension ' ) ;
13+ expect ( config . rules ) . not . toHaveProperty ( 'react/jsx-key ' ) ;
1414
1515 config = defineConfig ( {
1616 ignorePatterns : [ 'fixtures/**' ] ,
@@ -24,7 +24,33 @@ test('defines a valid Oxlint config', () => {
2424 expect ( config . ignorePatterns ) . toContain ( 'fixtures/**' ) ;
2525 expect ( config ) . toHaveProperty ( 'rules' , expect . any ( Object ) ) ;
2626 expect ( config . rules ) . toHaveProperty ( 'unicorn/no-null' , 'error' ) ;
27- expect ( config . rules ) . not . toHaveProperty ( 'react/jsx-filename-extension' ) ;
27+ expect ( config . rules ) . not . toHaveProperty ( 'react/jsx-key' ) ;
28+
29+ config = defineConfig (
30+ {
31+ rules : {
32+ 'unicorn/no-null' : 'warn' ,
33+ 'unicorn/no-useless-undefined' : 'error' ,
34+ } ,
35+ } ,
36+ {
37+ ignorePatterns : [ 'fixtures/**' ] ,
38+ rules : {
39+ 'unicorn/no-null' : 'error' ,
40+ } ,
41+ }
42+ ) ;
43+
44+ expectTypeOf ( config ) . toEqualTypeOf < OxlintConfig > ( ) ;
45+ expect ( config ) . toHaveProperty ( 'ignorePatterns' , expect . any ( Array ) ) ;
46+ expect ( config . ignorePatterns ) . toContain ( 'fixtures/**' ) ;
47+ expect ( config ) . toHaveProperty ( 'rules' , expect . any ( Object ) ) ;
48+ expect ( config . rules ) . toHaveProperty ( 'unicorn/no-null' , 'error' ) ;
49+ expect ( config . rules ) . toHaveProperty (
50+ 'unicorn/no-useless-undefined' ,
51+ 'error'
52+ ) ;
53+ expect ( config . rules ) . not . toHaveProperty ( 'react/jsx-key' ) ;
2854} ) ;
2955
3056test ( 'supports the `react` option' , ( ) => {
@@ -36,5 +62,10 @@ test('supports the `react` option', () => {
3662 expect ( config ) . not . toStrictEqual ( defineConfig ( ) ) ;
3763 expect ( config ) . not . toHaveProperty ( 'react' ) ;
3864 expect ( config . rules ) . toHaveProperty ( 'unicorn/no-null' , 'off' ) ;
39- expect ( config . rules ) . toHaveProperty ( 'react/jsx-filename-extension' ) ;
65+ expect ( config . rules ) . toHaveProperty ( 'react/jsx-key' ) ;
66+
67+ expect ( defineConfig ( { } , { react : true } , { } ) ) . toStrictEqual ( config ) ;
68+ expect ( defineConfig ( { } , { react : true } , { react : false } ) ) . toStrictEqual (
69+ defineConfig ( )
70+ ) ;
4071} ) ;
0 commit comments