@@ -35,7 +35,6 @@ const {
3535 injectCreateDefaultTemplate,
3636 injectFmtDefaults,
3737 injectLintTypeCheckDefaults,
38- mergeViteConfigFiles,
3938 rewriteEslintPackageJson,
4039 detectIncompatibleEslintIntegration,
4140 preflightGitHooksSetup,
@@ -4783,68 +4782,6 @@ export default defineConfig(({ mode }) => {
47834782 } ) ;
47844783} ) ;
47854784
4786- describe ( 'mergeViteConfigFiles - migrated Oxlint config sanitization' , ( ) => {
4787- let tmpDir : string ;
4788-
4789- beforeEach ( ( ) => {
4790- tmpDir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'vp-migrator-oxlint-sanitize-' ) ) ;
4791- fs . writeFileSync ( path . join ( tmpDir , 'package.json' ) , JSON . stringify ( { name : 'test' } , null , 2 ) ) ;
4792- } ) ;
4793-
4794- afterEach ( ( ) => {
4795- fs . rmSync ( tmpDir , { recursive : true , force : true } ) ;
4796- } ) ;
4797-
4798- it ( 'strips JSX a11y rule options unsupported by bundled Oxlint' , ( ) => {
4799- fs . writeFileSync (
4800- path . join ( tmpDir , '.oxlintrc.json' ) ,
4801- JSON . stringify (
4802- {
4803- plugins : [ 'jsx-a11y' ] ,
4804- rules : {
4805- 'jsx-a11y/control-has-associated-label' : [
4806- 'error' ,
4807- {
4808- includeRoles : [ 'button' ] ,
4809- ignoreRoles : [ 'menu' ] ,
4810- depth : 3 ,
4811- } ,
4812- ] ,
4813- 'jsx-a11y/no-noninteractive-element-to-interactive-role' : [
4814- 'error' ,
4815- {
4816- ul : [ 'listbox' ] ,
4817- } ,
4818- ] ,
4819- } ,
4820- } ,
4821- null ,
4822- 2 ,
4823- ) ,
4824- ) ;
4825-
4826- const report = createMigrationReport ( ) ;
4827- mergeViteConfigFiles ( tmpDir , true , report ) ;
4828-
4829- const viteConfig = fs . readFileSync ( path . join ( tmpDir , 'vite.config.ts' ) , 'utf8' ) ;
4830- expect ( viteConfig ) . toContain ( '"jsx-a11y/control-has-associated-label"' ) ;
4831- expect ( viteConfig ) . toContain ( '"ignoreRoles"' ) ;
4832- expect ( viteConfig ) . toContain ( '"depth": 3' ) ;
4833- expect ( viteConfig ) . not . toContain ( 'includeRoles' ) ;
4834- expect ( viteConfig ) . not . toContain ( '"ul"' ) ;
4835- expect ( viteConfig ) . toContain ( '"jsx-a11y/no-noninteractive-element-to-interactive-role"' ) ;
4836- expect ( viteConfig ) . toMatch (
4837- / " j s x - a 1 1 y \/ n o - n o n i n t e r a c t i v e - e l e m e n t - t o - i n t e r a c t i v e - r o l e " : \[ \s * " e r r o r " , \s * \{ \s * \} \s * \] / ,
4838- ) ;
4839- expect ( report . warnings . join ( '\n' ) ) . toContain (
4840- 'jsx-a11y/control-has-associated-label.includeRoles' ,
4841- ) ;
4842- expect ( report . warnings . join ( '\n' ) ) . toContain (
4843- 'jsx-a11y/no-noninteractive-element-to-interactive-role.ul' ,
4844- ) ;
4845- } ) ;
4846- } ) ;
4847-
48484785describe ( 'rewriteStandaloneProject — lazy plugin wrapping' , ( ) => {
48494786 let tmpDir : string ;
48504787
0 commit comments