or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.mdmigration-system.mdproject-configuration.mdproject-generation.mdutility-functions.mdworkspace-setup.md
tile.json

migration-system.mddocs/

Migration System

Automated migration system for updating @angular-eslint across major versions, handling breaking changes and dependency updates automatically.

Capabilities

Version Migration Schematics

The migration system provides automated schematics for major version updates, ensuring smooth transitions between @angular-eslint releases.

/**
 * Migration schematic for updating @angular-eslint to a specific version
 * @param options - Migration configuration options
 * @returns Schematic rule that performs the migration
 */
export default function migration(options: MigrationOptions): Rule;

interface MigrationOptions {
  /** Target version for the migration */
  version: string;
  /** Whether to skip dependency installation */
  skipInstall?: boolean;
}

Available Migrations:

  • update-2-0-0: Updates from v1.9.0+ to v2.x
  • update-3-0-0: Updates from v2.9.0+ to v3.x
  • update-4-0-0: Updates from v3.9.0+ to v4.x
  • update-12-0-0: Updates from v4.9.0+ to v12.x
  • update-13-0-0: Updates from v13.0.0-alpha.0+ to v13.x
  • update-14-0-0: Updates from v14.0.0-alpha.0+ to v14.x
  • update-15-0-0: Updates from v15.0.0-alpha.1+ to v15.x
  • update-16-0-0: Updates from v16.0.0-alpha.0+ to v16.x
  • update-17-0-0: Updates from v17.0.0-alpha.0+ to v17.x
  • update-17-3-0: Updates from v17.2.2-alpha.0+ to v17.3.x
  • update-18-2-0: Updates from v18.1.1-alpha.0+ to v18.2.x
  • update-20-0-0: Updates from v20.0.0-alpha.0+ to v20.x

Migration Process

Each migration schematic handles:

  1. Dependency Updates: Updates package.json with correct versions
  2. Configuration Migration: Transforms ESLint configurations for breaking changes
  3. Rule Updates: Updates deprecated or renamed ESLint rules
  4. Schema Changes: Handles changes to schematic interfaces and options
  5. Breaking Change Mitigation: Provides compatibility layers where possible

Migration Schema

interface MigrationSchema {
  /** Version identifier for the migration */
  version: string;
  /** Human-readable description of the migration */
  description: string;
  /** Path to the migration factory function */
  factory: string;
}

Dependency Management

The migration system includes utilities for updating package dependencies:

/**
 * Update package.json dependencies during migrations
 * @param dependencies - Array of package and version updates
 * @returns Schematic rule that updates dependencies
 */
function updateDependencies(
  dependencies: Array<{
    packageName: string;
    version: string;
    type?: 'dependencies' | 'devDependencies' | 'peerDependencies';
  }>
): Rule;

Usage Examples:

import { updateDependencies } from "@angular-eslint/schematics";

// Update ESLint-related packages
const migrationRule = updateDependencies([
  { packageName: '@angular-eslint/eslint-plugin', version: '^20.0.0' },
  { packageName: '@angular-eslint/builder', version: '^20.0.0' },
  { packageName: 'eslint', version: '^9.0.0' }
]);

Configuration Format Migration

The migration system handles transitions between ESLint configuration formats:

Legacy to Modern Config Migration

Migrations can convert between eslintrc format and flat config format:

/**
 * Migrate ESLint configuration from legacy to modern format
 * @param tree - The file tree
 * @param projectPath - Path to the project to migrate
 * @returns Updated configuration in modern format
 */
function migrateLegacyToFlatConfig(tree: Tree, projectPath: string): Rule;

/**
 * Migrate ESLint configuration from modern to legacy format
 * @param tree - The file tree  
 * @param projectPath - Path to the project to migrate
 * @returns Updated configuration in legacy format
 */
function migrateFlatConfigToLegacy(tree: Tree, projectPath: string): Rule;

Rule Migration

The migration system handles ESLint rule changes:

/**
 * Migration utilities for ESLint rule changes
 */
interface RuleMigration {
  /** Original rule name */
  from: string;
  /** New rule name */
  to: string;
  /** Optional rule configuration transformation */
  configTransform?: (config: any) => any;
}

/**
 * Apply rule migrations to ESLint configuration
 * @param ruleMigrations - Array of rule migration definitions
 * @returns Schematic rule that applies the migrations
 */
function migrateRules(ruleMigrations: RuleMigration[]): Rule;

Version-Specific Migration Details

Major Version Migrations

v2.0.0 Migration:

  • Introduces new ESLint rule configurations
  • Updates TypeScript ESLint parser integration
  • Migrates workspace configuration format

v13.0.0 Migration:

  • Aligns with Angular 13 breaking changes
  • Updates ESLint configuration patterns
  • Handles new TypeScript strict mode requirements

v15.0.0 Migration:

  • Introduces performance optimizations
  • Updates default rule configurations
  • Migrates to new ESLint rule format

v17.0.0+ Migrations:

  • Support for Angular 17+ features
  • New template parsing capabilities
  • Enhanced type-aware linting rules

v20.0.0 Migration:

  • Support for ESLint v9 flat config
  • Updates for Angular 20 compatibility
  • New migration utilities

Migration Execution

Migrations are automatically executed by Angular CLI during updates:

# Automatic migration during ng update
ng update @angular-eslint/schematics

# Manual migration execution
ng generate @angular-eslint/schematics:update-20-0-0

Types

interface MigrationOptions {
  version: string;
  skipInstall?: boolean;
}

interface MigrationSchema {
  version: string;
  description: string;
  factory: string;
}

interface RuleMigration {
  from: string;
  to: string;
  configTransform?: (config: any) => any;
}

type DependencyUpdate = {
  packageName: string;
  version: string;
  type?: 'dependencies' | 'devDependencies' | 'peerDependencies';
};