-
-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update eslint to ^7.26.0, @typescript-eslint to 4.23.0
- Loading branch information
1 parent
33b7f7e
commit 9e31c38
Showing
9 changed files
with
254 additions
and
135 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
70 changes: 70 additions & 0 deletions
70
packages/schematics/tests/migrations/update-12-0-0/update-12-0-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,70 @@ | ||
import { | ||
SchematicTestRunner, | ||
UnitTestTree, | ||
} from '@angular-devkit/schematics/testing'; | ||
import * as path from 'path'; | ||
import { Tree } from '@angular-devkit/schematics'; | ||
|
||
const migrationSchematicRunner = new SchematicTestRunner( | ||
'@angular-eslint/schematics', | ||
path.join(__dirname, '../../../src/migrations.json'), | ||
); | ||
|
||
describe('update-12-0-0', () => { | ||
let appTree: UnitTestTree; | ||
beforeEach(() => { | ||
appTree = new UnitTestTree(Tree.empty()); | ||
appTree.create( | ||
'package.json', | ||
JSON.stringify({ | ||
devDependencies: { | ||
'@angular-eslint/builder': '4.3.0', | ||
'@angular-eslint/eslint-plugin': '4.3.0', | ||
'@angular-eslint/eslint-plugin-template': '4.3.0', | ||
'@angular-eslint/template-parser': '4.3.0', | ||
'@typescript-eslint/eslint-plugin': '4.16.1', | ||
'@typescript-eslint/experimental-utils': '4.16.1', | ||
'@typescript-eslint/parser': '4.16.1', | ||
eslint: '^7.6.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 @angular-eslint, @typescript-eslint and eslint dependencies', async () => { | ||
const tree = await migrationSchematicRunner | ||
.runSchematicAsync('update-12-0-0', {}, appTree) | ||
.toPromise(); | ||
const packageJSON = JSON.parse(tree.readContent('/package.json')); | ||
expect(packageJSON).toMatchInlineSnapshot(` | ||
Object { | ||
"devDependencies": Object { | ||
"@angular-eslint/builder": "^12.0.0", | ||
"@angular-eslint/eslint-plugin": "^12.0.0", | ||
"@angular-eslint/eslint-plugin-template": "^12.0.0", | ||
"@angular-eslint/template-parser": "^12.0.0", | ||
"@typescript-eslint/eslint-plugin": "4.23.0", | ||
"@typescript-eslint/experimental-utils": "4.23.0", | ||
"@typescript-eslint/parser": "4.23.0", | ||
"eslint": "^7.26.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
Oops, something went wrong.