angular / angular-update-guide

An interactive guide to updating the version of Angular in your apps

Home Page:https://update.angular.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing/incorrect lint migration for 12->13

hlovdal opened this issue · comments

The following might mainly be problems with tools outside of this repository, however the claims

  • "There aren't currently any changes needed before moving between these versions."
  • "There aren't currently any changes needed after moving between these versions."

most definitely are not true and needs to be corrected/expanded.

Steps to reproduce:

$ mkdir /tmp/test
$ cd /tmp/test
$ ng --version             # Angular CLI: 11.2.15
$ ng new --defaults --strict test-a11-a12-a13
$ cd test-a11-a12-a13/
$ npx @angular/cli@12 update @angular/core@12 @angular/cli@12
$ git add .
$ git commit -m "npx @angular/cli@12 update @angular/core@12 @angular/cli@12"
$ npm run lint             # Complains about tslint but runs successfully.
$ npx @angular/cli@13 update @angular/core@13 @angular/cli@13
$ git add .
$ git commit -m "npx @angular/cli@13 update @angular/core@13 @angular/cli@13"
$ npm run lint             # Fails:
...
Cannot find "lint" target for the specified project.

You should add a package that implements linting capabilities.

For example:
  ng add @angular-eslint/schematics
...
$

Trying to run the suggested schematic fails:

$ ng add @angular-eslint/schematics
...
An unhandled exception occurred: NOT SUPPORTED: keyword "id", use "$id" for schema ID
See "C:\Users\...\AppData\Local\Temp\ng-an9syi\angular-errors.log" for further details.
$ cat "C:\Users\...\AppData\Local\Temp\ng-an9syi\angular-errors.log"
[error] Error: NOT SUPPORTED: keyword "id", use "$id" for schema ID
    at Object.code (C:\Users\...\AppData\Local\Temp\test\test-a11-a12-a13\node_modules\@angular-devkit\core\node_modules\ajv\dist\vocabularies\core\id.js:6:15)
    at keywordCode (C:\Users\...\AppData\Local\Temp\test\test-a11-a12-a13\node_modules\@angular-devkit\core\node_modules\ajv\dist\compile\validate\index.js:454:13)
    at C:\Users\...\AppData\Local\Temp\test\test-a11-a12-a13\node_modules\@angular-devkit\core\node_modules\ajv\dist\compile\validate\index.js:222:17
    at CodeGen.code (C:\Users\...\AppData\Local\Temp\test\test-a11-a12-a13\node_modules\@angular-devkit\core\node_modules\ajv\dist\compile\codegen\index.js:439:13)
    at CodeGen.block (C:\Users\...\AppData\Local\Temp\test\test-a11-a12-a13\node_modules\@angular-devkit\core\node_modules\ajv\dist\compile\codegen\index.js:568:18)
    at iterateKeywords (C:\Users\...\AppData\Local\Temp\test\test-a11-a12-a13\node_modules\@angular-devkit\core\node_modules\ajv\dist\compile\validate\index.js:219:9)
    at groupKeywords (C:\Users\...\AppData\Local\Temp\test\test-a11-a12-a13\node_modules\@angular-devkit\core\node_modules\ajv\dist\compile\validate\index.js:208:13)
    at C:\Users\...\AppData\Local\Temp\test\test-a11-a12-a13\node_modules\@angular-devkit\core\node_modules\ajv\dist\compile\validate\index.js:192:13
    at CodeGen.code (C:\Users\...\AppData\Local\Temp\test\test-a11-a12-a13\node_modules\@angular-devkit\core\node_modules\ajv\dist\compile\codegen\index.js:439:13)
    at CodeGen.block (C:\Users\...\AppData\Local\Temp\test\test-a11-a12-a13\node_modules\@angular-devkit\core\node_modules\ajv\dist\compile\codegen\index.js:568:18)
$

If instead the schematics command is run before the 12->13 update it succeds, but then inhibits an update to version 13.

$ cd /tmp/test
$ ng new --defaults --strict test-a11-a12-lint-a13
$ cd test-a11-a12-lint-a13
$ npx @angular/cli@12 update @angular/core@12 @angular/cli@12
$ git add .
$ git commit -m "npx @angular/cli@12 update @angular/core@12 @angular/cli@12"
$ npm run lint          # ok
$ ng add @angular-eslint/schematics
$ npm run lint          # ok
$ git add .
$ git commit -m "ng add @angular-eslint/schematics"
$ npx @angular/cli@13 update @angular/core@13 @angular/cli@13     # Fails:
...
                  Package "@angular-eslint/schematics" has an incompatible peer dependency to "@angular/cli" (requires ">= 12.0.0 < 13.0.0", would install "13.0.1").
× Migration failed: Incompatible peer dependencies found.
...