-
-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update typescript-eslint packages to v7 (major) (#1742)
- Loading branch information
1 parent
9793bc6
commit dcc4876
Showing
15 changed files
with
189 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/schematics/src/migrations/update-17-3-0/update-17-3-0.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`, | ||
}, | ||
]), | ||
]); | ||
} |
64 changes: 64 additions & 0 deletions
64
packages/schematics/tests/migrations/update-17-3-0/update-17-3-0.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
}, | ||
} | ||
`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.