angular-docs-cn/packages/core/schematics/migrations/relative-link-resolution
Paul Gschwendtner 2d0ff0a5d3 ci: add lint error for files with missing trailing new-line (#42478)
For quite a while it is an unspoken convention to add a trailing
new-line files within the Angular repository. This was never enforced
automatically, but has been frequently raised in pull requests through
manual review. This commit sets up a lint rule so that this is
"officially" enforced and doesn't require manual review.

PR Close #42478
2021-06-04 13:31:03 -07:00
..
google3 feat(router): Add `relativeLinkResolution` migration to update default value (#38698) 2020-09-23 15:45:37 -04:00
BUILD.bazel feat(router): Add `relativeLinkResolution` migration to update default value (#38698) 2020-09-23 15:45:37 -04:00
README.md feat(router): Add `relativeLinkResolution` migration to update default value (#38698) 2020-09-23 15:45:37 -04:00
collector.ts feat(core): support TypeScript 4.3 (#42022) 2021-06-04 11:17:09 -07:00
index.ts fix(core): migration error if program contains files outside of the project (#39790) 2020-11-20 12:51:19 -08:00
transform.ts fix(core): migrate relative link resolution with single quotes (#39102) 2020-10-08 10:10:07 -07:00
update_recorder.ts ci: add lint error for files with missing trailing new-line (#42478) 2021-06-04 13:31:03 -07:00
util.ts feat(router): Add `relativeLinkResolution` migration to update default value (#38698) 2020-09-23 15:45:37 -04:00

README.md

relativeLinkResolution migration

The default value for relativeLinkResolution is changing from 'legacy' to 'corrected'. This migration updates RouterModule configurations that use the default value to now specifically use 'legacy' to prevent breakages when updating.

Before

import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';

@NgModule({
  imports: [
    RouterModule.forRoot(ROUTES),
  ]
})
export class AppModule {
}

After

import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';

@NgModule({
  imports: [
    RouterModule.forRoot(ROUTES, {relativeLinkResolution: 'legacy'}),
  ]
})
export class AppModule {
}