Skip to content

Commit

Permalink
fix: update typescript-eslint packages to v7 (major) (#1742)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] committed Mar 15, 2024
1 parent 9793bc6 commit dcc4876
Show file tree
Hide file tree
Showing 15 changed files with 189 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ exports[`new-workspace-create-application-false-ng-add-then-project it should pa
"@angular/cli": "^17.X.X",
"@angular/compiler-cli": "^17.X.X",
"@types/jasmine": "~5.1.0",
"@typescript-eslint/eslint-plugin": "6.19.0",
"@typescript-eslint/parser": "6.19.0",
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
"eslint": "^8.57.0",
"jasmine-core": "~5.1.0",
"karma": "~6.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ exports[`new-workspace-create-application-false-project-then-ng-add it should pa
"@angular/cli": "^17.X.X",
"@angular/compiler-cli": "^17.X.X",
"@types/jasmine": "~5.1.0",
"@typescript-eslint/eslint-plugin": "6.19.0",
"@typescript-eslint/parser": "6.19.0",
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
"eslint": "^8.57.0",
"jasmine-core": "~5.1.0",
"karma": "~6.4.0",
Expand Down
4 changes: 2 additions & 2 deletions e2e/src/__snapshots__/new-workspace.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ exports[`new-workspace it should pass linting after creating a new workspace fro
"@angular/cli": "^17.X.X",
"@angular/compiler-cli": "^17.X.X",
"@types/jasmine": "~5.1.0",
"@typescript-eslint/eslint-plugin": "6.19.0",
"@typescript-eslint/parser": "6.19.0",
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
"eslint": "^8.57.0",
"jasmine-core": "~5.1.0",
"karma": "~6.4.0",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"@types/jest": "29.4.4",
"@types/node": "20.11.28",
"@types/prettier": "2.7.3",
"@typescript-eslint/eslint-plugin": "6.19.0",
"@typescript-eslint/parser": "6.19.0",
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
"commitizen": "4.3.0",
"cz-conventional-changelog": "3.3.0",
"env-cmd": "10.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-eslint/builder",
"version": "0.0.0-e2e",
"version": "17.2.1",
"description": "Angular CLI builder for ESLint",
"license": "MIT",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/bundled-angular-compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-eslint/bundled-angular-compiler",
"version": "0.0.0-e2e",
"version": "17.2.1",
"description": "A CJS bundled version of @angular/compiler",
"license": "MIT",
"main": "dist/index.js",
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-plugin-template/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-eslint/eslint-plugin-template",
"version": "0.0.0-e2e",
"version": "17.2.1",
"description": "ESLint plugin for Angular Templates",
"license": "MIT",
"main": "dist/index.js",
Expand All @@ -17,10 +17,10 @@
"LICENSE"
],
"dependencies": {
"@angular-eslint/bundled-angular-compiler": "0.0.0-e2e",
"@angular-eslint/utils": "0.0.0-e2e",
"@typescript-eslint/type-utils": "6.19.0",
"@typescript-eslint/utils": "6.19.0",
"@angular-eslint/bundled-angular-compiler": "17.2.1",
"@angular-eslint/utils": "17.2.1",
"@typescript-eslint/type-utils": "7.2.0",
"@typescript-eslint/utils": "7.2.0",
"aria-query": "5.3.0",
"axobject-query": "4.0.0"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-eslint/eslint-plugin",
"version": "0.0.0-e2e",
"version": "17.2.1",
"description": "ESLint plugin for Angular applications, following angular.io/styleguide",
"license": "MIT",
"main": "dist/index.js",
Expand All @@ -17,8 +17,8 @@
"LICENSE"
],
"dependencies": {
"@angular-eslint/utils": "0.0.0-e2e",
"@typescript-eslint/utils": "6.19.0"
"@angular-eslint/utils": "17.2.1",
"@typescript-eslint/utils": "7.2.0"
},
"peerDependencies": {
"eslint": "^7.20.0 || ^8.0.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/schematics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-eslint/schematics",
"version": "0.0.0-e2e",
"version": "17.2.1",
"description": "Angular Schematics for angular-eslint",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -33,8 +33,8 @@
"save": "devDependencies"
},
"dependencies": {
"@angular-eslint/eslint-plugin": "0.0.0-e2e",
"@angular-eslint/eslint-plugin-template": "0.0.0-e2e",
"@angular-eslint/eslint-plugin": "17.2.1",
"@angular-eslint/eslint-plugin-template": "17.2.1",
"@nx/devkit": "^17.2.8 || ^18.0.0",
"ignore": "5.3.1",
"nx": "^17.2.8 || ^18.0.0",
Expand All @@ -43,7 +43,7 @@
},
"devDependencies": {
"@types/tmp": "0.2.6",
"@typescript-eslint/utils": "6.19.0",
"@typescript-eslint/utils": "7.2.0",
"eslint": "8.57.0"
},
"peerDependencies": {
Expand Down
5 changes: 5 additions & 0 deletions packages/schematics/src/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
"version": "17.0.0-alpha.0",
"description": "Updates @angular-eslint to v17",
"factory": "./migrations/update-17-0-0/update-17-0-0"
},
"update-17-3-0": {
"version": "17.2.2-alpha.0",
"description": "Updates @angular-eslint to v1.3",
"factory": "./migrations/update-17-3-0/update-17-3-0"
}
}
}
29 changes: 29 additions & 0 deletions packages/schematics/src/migrations/update-17-3-0/update-17-3-0.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { Rule } from '@angular-devkit/schematics';
import { chain } from '@angular-devkit/schematics';
import { updateDependencies } from '../utils/dependencies';

const updatedTypeScriptESLintVersion = '7.2.0';
const updatedESLintVersion = '8.57.0';

export default function migration(): Rule {
return chain([
updateDependencies([
{
packageName: '@typescript-eslint/eslint-plugin',
version: `^${updatedTypeScriptESLintVersion}`,
},
{
packageName: '@typescript-eslint/utils',
version: `^${updatedTypeScriptESLintVersion}`,
},
{
packageName: '@typescript-eslint/parser',
version: `^${updatedTypeScriptESLintVersion}`,
},
{
packageName: 'eslint',
version: `^${updatedESLintVersion}`,
},
]),
]);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { Tree } from '@angular-devkit/schematics';
import {
SchematicTestRunner,
UnitTestTree,
} from '@angular-devkit/schematics/testing';
import * as path from 'path';

const migrationSchematicRunner = new SchematicTestRunner(
'@angular-eslint/schematics',
path.join(__dirname, '../../../src/migrations.json'),
);

describe('update-17-3-0', () => {
let appTree: UnitTestTree;
beforeEach(() => {
appTree = new UnitTestTree(Tree.empty());
appTree.create(
'package.json',
JSON.stringify({
devDependencies: {
'@typescript-eslint/eslint-plugin': '^5.43.0',
'@typescript-eslint/utils': '5.3.0',
'@typescript-eslint/parser': '^5.43.0',
eslint: '^8.28.0',
},
}),
);
appTree.create(
'angular.json',
JSON.stringify({
$schema: './node_modules/@angular/cli/lib/config/schema.json',
version: 1,
newProjectRoot: 'projects',
projects: {
foo: {
root: 'projects/foo',
},
bar: {
root: 'projects/bar',
},
},
}),
);
});

it('should update relevant @typescript-eslint and eslint dependencies', async () => {
const tree = await migrationSchematicRunner.runSchematic(
'update-17-3-0',
{},
appTree,
);
const packageJSON = JSON.parse(tree.readContent('/package.json'));
expect(packageJSON).toMatchInlineSnapshot(`
Object {
"devDependencies": Object {
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@typescript-eslint/utils": "^7.2.0",
"eslint": "^8.57.0",
},
}
`);
});
});
4 changes: 2 additions & 2 deletions packages/template-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-eslint/template-parser",
"version": "0.0.0-e2e",
"version": "17.2.1",
"description": "Angular Template parser for ESLint",
"license": "MIT",
"main": "dist/index.js",
Expand All @@ -17,7 +17,7 @@
"LICENSE"
],
"dependencies": {
"@angular-eslint/bundled-angular-compiler": "0.0.0-e2e",
"@angular-eslint/bundled-angular-compiler": "17.2.1",
"eslint-scope": "^8.0.0"
},
"peerDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-eslint/utils",
"version": "0.0.0-e2e",
"version": "17.2.1",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -20,8 +20,8 @@
"typescript": "*"
},
"dependencies": {
"@angular-eslint/bundled-angular-compiler": "0.0.0-e2e",
"@typescript-eslint/utils": "6.19.0"
"@angular-eslint/bundled-angular-compiler": "17.2.1",
"@typescript-eslint/utils": "7.2.0"
},
"gitHead": "e2006e5e9c99e5a943d1a999e0efa5247d29ec24"
}

0 comments on commit dcc4876

Please sign in to comment.