@@ -38,6 +38,26 @@ const MIGRATIONS = {
3838 }
3939 } ) ;
4040 return config ;
41+ } ,
42+ '1.2.1' : ( config ) => {
43+ // Add any new required fields or transformations for 1.2.1
44+ if ( ! config . rules ) {
45+ config . rules = [ ] ;
46+ }
47+ // Ensure all rules have proper structure
48+ config . rules . forEach ( rule => {
49+ if ( ! rule . severity ) {
50+ rule . severity = 'warning' ;
51+ }
52+ if ( ! rule . enabled ) {
53+ rule . enabled = true ;
54+ }
55+ // Add type field if missing
56+ if ( ! rule . type ) {
57+ rule . type = 'base' ;
58+ }
59+ } ) ;
60+ return config ;
4161 }
4262} ;
4363
@@ -46,12 +66,12 @@ function migrateConfig(configPath) {
4666 const config = fs . readJsonSync ( configPath ) ;
4767 const currentVersion = config . version || '0.0.0' ;
4868
49- if ( currentVersion === '1.2.0 ' ) {
69+ if ( currentVersion === '1.2.1 ' ) {
5070 debug ( `Config ${ path . relative ( process . cwd ( ) , configPath ) } is already at latest version` ) ;
5171 return true ;
5272 }
5373
54- info ( `Migrating config from version ${ currentVersion } to 1.2.0 ` ) ;
74+ info ( `Migrating config from version ${ currentVersion } to 1.2.1 ` ) ;
5575
5676 // Apply migrations in order
5777 let migratedConfig = { ...config } ;
@@ -63,7 +83,7 @@ function migrateConfig(configPath) {
6383 }
6484
6585 // Update version
66- migratedConfig . version = '1.2.0 ' ;
86+ migratedConfig . version = '1.2.1 ' ;
6787
6888 // Create backup
6989 const backupPath = `${ configPath } .pre-migration-${ Date . now ( ) } ` ;
@@ -72,7 +92,7 @@ function migrateConfig(configPath) {
7292
7393 // Write migrated config
7494 fs . writeJsonSync ( configPath , migratedConfig , { spaces : 2 } ) ;
75- success ( 'Successfully migrated config to version 1.2.0 ' ) ;
95+ success ( 'Successfully migrated config to version 1.2.1 ' ) ;
7696
7797 return true ;
7898 } catch ( err ) {
0 commit comments