feat(angular): update @angular-eslint to v1

This commit is contained in:
James Henry 2021-01-02 14:39:48 +04:00 committed by Victor Savkin
parent 8cfda00009
commit 42b61d0e90
10 changed files with 100 additions and 28 deletions

View File

@ -31,9 +31,9 @@
"@angular-devkit/build-webpack": "~0.1100.1", "@angular-devkit/build-webpack": "~0.1100.1",
"@angular-devkit/core": "~11.0.1", "@angular-devkit/core": "~11.0.1",
"@angular-devkit/schematics": "~11.0.1", "@angular-devkit/schematics": "~11.0.1",
"@angular-eslint/eslint-plugin": "0.8.0-beta.1", "@angular-eslint/eslint-plugin": "~1.0.0",
"@angular-eslint/eslint-plugin-template": "0.8.0-beta.1", "@angular-eslint/eslint-plugin-template": "~1.0.0",
"@angular-eslint/template-parser": "0.8.0-beta.1", "@angular-eslint/template-parser": "~1.0.0",
"@angular/cli": "~11.0.1", "@angular/cli": "~11.0.1",
"@angular/common": "~11.0.0", "@angular/common": "~11.0.0",
"@angular/compiler": "~11.0.0", "@angular/compiler": "~11.0.0",

View File

@ -55,6 +55,11 @@
"version": "11.0.0-beta.13", "version": "11.0.0-beta.13",
"description": "Update builder configurations and dependencies", "description": "Update builder configurations and dependencies",
"factory": "./src/migrations/update-11-0-0/update-builders-config" "factory": "./src/migrations/update-11-0-0/update-builders-config"
},
"update-11-1-0": {
"version": "11.1.0-beta.0",
"description": "Update @angular-eslint dependencies to v1",
"factory": "./src/migrations/update-11-1-0/update-11-1-0"
} }
}, },
"packageJsonUpdates": { "packageJsonUpdates": {
@ -262,6 +267,23 @@
"alwaysAddToPackageJson": false "alwaysAddToPackageJson": false
} }
} }
},
"11.1.0": {
"version": "11.1.0-beta.0",
"packages": {
"@angular-eslint/eslint-plugin": {
"version": "~1.0.0",
"alwaysAddToPackageJson": false
},
"@angular-eslint/eslint-plugin-template": {
"version": "~1.0.0",
"alwaysAddToPackageJson": false
},
"@angular-eslint/template-parser": {
"version": "~1.0.0",
"alwaysAddToPackageJson": false
}
}
} }
} }
} }

View File

@ -236,9 +236,9 @@ describe('add-template-support-and-presets-to-eslint', () => {
"@angular/core": "11.0.0", "@angular/core": "11.0.0",
}, },
"devDependencies": Object { "devDependencies": Object {
"@angular-eslint/eslint-plugin": "0.8.0-beta.1", "@angular-eslint/eslint-plugin": "~1.0.0",
"@angular-eslint/eslint-plugin-template": "0.8.0-beta.1", "@angular-eslint/eslint-plugin-template": "~1.0.0",
"@angular-eslint/template-parser": "0.8.0-beta.1", "@angular-eslint/template-parser": "~1.0.0",
}, },
"name": "test-name", "name": "test-name",
} }

View File

@ -86,9 +86,9 @@ function updateProjectESLintConfigsAndBuilders(host: Tree): Rule {
addDepsToPackageJson( addDepsToPackageJson(
{}, {},
{ {
'@angular-eslint/eslint-plugin': '0.8.0-beta.1', '@angular-eslint/eslint-plugin': '~1.0.0',
'@angular-eslint/eslint-plugin-template': '0.8.0-beta.1', '@angular-eslint/eslint-plugin-template': '~1.0.0',
'@angular-eslint/template-parser': '0.8.0-beta.1', '@angular-eslint/template-parser': '~1.0.0',
}, },
false false
) )

View File

@ -0,0 +1,35 @@
import { Tree } from '@angular-devkit/schematics';
import { readJsonInTree, updateJsonInTree } from '@nrwl/workspace';
import { callRule, runMigration } from '../../utils/testing';
describe('update-11-1-0', () => {
let tree: Tree;
beforeEach(async () => {
tree = Tree.empty();
tree = await callRule(
updateJsonInTree('package.json', () => ({
devDependencies: {
'@angular-eslint/eslint-plugin': '~1.0.0',
'@angular-eslint/eslint-plugin-template': '~1.0.0',
'@angular-eslint/template-parser': '~1.0.0',
},
})),
tree
);
});
it('should update @angular-eslint dependencies to v1', async () => {
const result = await runMigration('update-11-1-0', {}, tree);
const packageJson = readJsonInTree(result, 'package.json');
expect(packageJson).toMatchInlineSnapshot(`
Object {
"devDependencies": Object {
"@angular-eslint/eslint-plugin": "~1.0.0",
"@angular-eslint/eslint-plugin-template": "~1.0.0",
"@angular-eslint/template-parser": "~1.0.0",
},
}
`);
});
});

View File

@ -0,0 +1,13 @@
import { chain } from '@angular-devkit/schematics';
import { formatFiles, updatePackagesInPackageJson } from '@nrwl/workspace';
import { join } from 'path';
export default function () {
return chain([
updatePackagesInPackageJson(
join(__dirname, '../../../migrations.json'),
'11.1.0'
),
formatFiles(),
]);
}

View File

@ -5,4 +5,4 @@ export const angularJsVersion = '1.7.9';
export const ngrxVersion = '10.0.0'; export const ngrxVersion = '10.0.0';
export const rxjsVersion = '~6.5.5'; export const rxjsVersion = '~6.5.5';
export const jestPresetAngularVersion = '8.3.1'; export const jestPresetAngularVersion = '8.3.1';
export const angularEslintVersion = '0.8.0-beta.1'; export const angularEslintVersion = '~1.0.0';

View File

@ -66,7 +66,7 @@ async function runBuilder(options: Schema) {
registry.addPostTransform(schema.transforms.addUndefinedDefaults); registry.addPostTransform(schema.transforms.addUndefinedDefaults);
const testArchitectHost = new TestingArchitectHost('/root', '/root'); const testArchitectHost = new TestingArchitectHost('/root', '/root');
const builderName = '@angular-eslint/builder:lint'; const builderName = '@nrwl/linter:eslint';
/** /**
* Require in the implementation from src so that we don't need * Require in the implementation from src so that we don't need

View File

@ -13,7 +13,7 @@ import { createDirectory } from '@nrwl/workspace';
async function run(options: Schema, context: BuilderContext): Promise<any> { async function run(options: Schema, context: BuilderContext): Promise<any> {
if (options.linter === 'tslint') { if (options.linter === 'tslint') {
throw new Error( throw new Error(
`'tslint' option is no longer supported. Update your angular.json to use "@angular-eslint/builder:lint" builder directly.` `'tslint' option is no longer supported. Update your angular.json to use "@nrwl/linter:eslint" builder.`
); );
} }

View File

@ -207,24 +207,26 @@
ora "4.0.3" ora "4.0.3"
rxjs "6.5.4" rxjs "6.5.4"
"@angular-eslint/eslint-plugin-template@0.8.0-beta.1": "@angular-eslint/eslint-plugin-template@~1.0.0":
version "0.8.0-beta.1" version "1.0.0"
resolved "https://registry.yarnpkg.com/@angular-eslint/eslint-plugin-template/-/eslint-plugin-template-0.8.0-beta.1.tgz#750675884e161d162afb4e314fc5621275e383a7" resolved "https://registry.yarnpkg.com/@angular-eslint/eslint-plugin-template/-/eslint-plugin-template-1.0.0.tgz#a969070b4df0628aed8e30164fb86a8002c0385c"
integrity sha512-nyy93m+2WBe5Fpc2IKzWPH1bGqNZYd+BU6nYhNssiYXPRcDWBqIsIhEM74dRK/0AN37tUguJ2weZ6xF6fVN8hw== integrity sha512-+LrAypsGUaW98aoDb/ITWWDKYHYp6UcJraJU7/bih7AQOJyDs6AnpbMPLscTcxkcCP2ylmJ31pEzYz4ItNKRTQ==
dependencies:
"@typescript-eslint/experimental-utils" "4.3.0"
aria-query "^4.2.2"
axobject-query "^2.2.0"
"@angular-eslint/eslint-plugin@~1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@angular-eslint/eslint-plugin/-/eslint-plugin-1.0.0.tgz#741a98c351ee02edb7d7f70473da699ee2eafa09"
integrity sha512-oar+5WhqFMVrK8ywTAJAnnisIQyG6I2STHHwVURx4rPyzjk3pZN10c3KgJuOF5FExfO2bewwr8FBy1CEZsh90w==
dependencies: dependencies:
"@typescript-eslint/experimental-utils" "4.3.0" "@typescript-eslint/experimental-utils" "4.3.0"
"@angular-eslint/eslint-plugin@0.8.0-beta.1": "@angular-eslint/template-parser@~1.0.0":
version "0.8.0-beta.1" version "1.0.0"
resolved "https://registry.yarnpkg.com/@angular-eslint/eslint-plugin/-/eslint-plugin-0.8.0-beta.1.tgz#154824ba3fe8589605c71762c793a42936b27f74" resolved "https://registry.yarnpkg.com/@angular-eslint/template-parser/-/template-parser-1.0.0.tgz#e4d431db36e64bf14cca90e19f40eb48c3c20402"
integrity sha512-+vCkUpM81qjb0UwxlUUwGML0lLzmnhqf5HHsRzzfwhd0s5g3DPw8w4Z/CDNBagJmTzSUSnH1GF9uEdtyJCEprA== integrity sha512-M7rj907yOoEzq10FO5BDX7Ylw24V+YfdsYfyEi/TzzQtNGxCwQhbEwXc1PAZgsQ+P1wbGFbg9mb3yFkps7/LEA==
dependencies:
"@typescript-eslint/experimental-utils" "4.3.0"
"@angular-eslint/template-parser@0.8.0-beta.1":
version "0.8.0-beta.1"
resolved "https://registry.yarnpkg.com/@angular-eslint/template-parser/-/template-parser-0.8.0-beta.1.tgz#a9a9eaccc4536b5edd6c3483b7ff81fc906874e3"
integrity sha512-fiLfwlWWwYz657SxcNfPKsl4HiItqj7mNZuMPlxsiKSyT/+pwTNzMttCafy2v0144SNmHEslZS1nQfc1Nq715g==
dependencies: dependencies:
eslint-scope "^5.1.0" eslint-scope "^5.1.0"
@ -6259,7 +6261,7 @@ axios@0.19.2, axios@^0.19.0:
dependencies: dependencies:
follow-redirects "1.5.10" follow-redirects "1.5.10"
axobject-query@^2.0.2, axobject-query@^2.1.2: axobject-query@^2.0.2, axobject-query@^2.1.2, axobject-query@^2.2.0:
version "2.2.0" version "2.2.0"
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be"
integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA== integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==