Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/nxPublic

Commitd782a69

Browse files
authored
feat(core): support ts 4.8 (#11845)
1 parent3a78d3b commitd782a69

File tree

20 files changed

+1596
-1446
lines changed

20 files changed

+1596
-1446
lines changed

‎e2e/angular-core/src/angular-linting.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import{
2-
newProject,
32
cleanupProject,
3+
newProject,
44
runCLI,
55
uniq,
66
updateFile,
@@ -61,10 +61,13 @@ describe('Angular Package', () => {
6161
expect(appLintStdOut).toContain(
6262
path.normalize(`apps/${myapp}/src/app/inline-template.component.ts`)
6363
);
64+
65+
expect(appLintStdOut).toContain(`5:21`);
6466
expect(appLintStdOut).toContain(
6567
`The selector should start with one of these prefixes`
6668
);
6769
expect(appLintStdOut).toContain(`7:18`);
70+
expect(appLintStdOut).toContain(`Invalid binding syntax`);
6871
});
6972
});
7073
});

‎e2e/linter/src/linter.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ import {
1111
}from'@nrwl/e2e/utils';
1212
import*astsfrom'typescript';
1313

14+
/**
15+
* Importing this helper from @typescript-eslint/type-utils to ensure
16+
* compatibility with TS < 4.8 due to the API change in TS4.8.
17+
* This helper allows for support of TS <= 4.8.
18+
*/
19+
import{getDecorators,getModifiers}from'@typescript-eslint/type-utils';
20+
1421
describe('Linter',()=>{
1522
it('should handle linting errors',()=>{
1623
constmyapp=uniq('myapp');
@@ -509,8 +516,8 @@ function updateGeneratedRuleImplementation(
509516
){
510517
returnts.factory.updateMethodDeclaration(
511518
node,
512-
node.decorators,
513-
node.modifiers,
519+
getDecorators(node),
520+
getModifiers(node),
514521
node.asteriskToken,
515522
node.name,
516523
node.questionToken,

‎package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
"@angular-devkit/build-angular":"~14.2.0",
3131
"@angular-devkit/core":"~14.2.0",
3232
"@angular-devkit/schematics":"~14.2.0",
33-
"@angular-eslint/eslint-plugin":"~14.0.0",
34-
"@angular-eslint/eslint-plugin-template":"~14.0.0",
35-
"@angular-eslint/template-parser":"~14.0.0",
33+
"@angular-eslint/eslint-plugin":"~14.0.4",
34+
"@angular-eslint/eslint-plugin-template":"~14.0.4",
35+
"@angular-eslint/template-parser":"~14.0.4",
3636
"@angular/cli":"~14.2.0",
3737
"@angular/common":"~14.2.0",
3838
"@angular/compiler":"~14.2.0",
@@ -113,9 +113,10 @@
113113
"@types/tar-stream":"^2.2.2",
114114
"@types/tmp":"^0.2.0",
115115
"@types/yargs":"^17.0.10",
116-
"@typescript-eslint/eslint-plugin":"~5.33.1",
117-
"@typescript-eslint/parser":"~5.33.1",
118-
"@typescript-eslint/utils":"~5.33.1",
116+
"@typescript-eslint/eslint-plugin":"^5.36.1",
117+
"@typescript-eslint/parser":"^5.36.1",
118+
"@typescript-eslint/utils":"^5.36.1",
119+
"@typescript-eslint/type-utils":"^5.36.1",
119120
"@xstate/immer":"^0.2.0",
120121
"@xstate/inspect":"^0.5.1",
121122
"@xstate/react":"^1.6.3",
@@ -172,7 +173,7 @@
172173
"jest":"28.1.3",
173174
"jest-circus":"27.2.3",
174175
"jest-environment-jsdom":"28.1.1",
175-
"jest-preset-angular":"~11.1.2",
176+
"jest-preset-angular":"~12.2.2",
176177
"js-yaml":"4.1.0",
177178
"jsonc-eslint-parser":"^2.1.0",
178179
"jsonc-parser":"3.0.0",
@@ -248,7 +249,7 @@
248249
"tslint-to-eslint-config":"^2.13.0",
249250
"typedoc":"0.22.9",
250251
"typedoc-plugin-markdown":"3.11.6",
251-
"typescript":"~4.7.2",
252+
"typescript":"~4.8.2",
252253
"unzipper":"^0.10.11",
253254
"url-loader":"^4.1.1",
254255
"verdaccio":"^5.0.4",

‎packages/angular/migrations.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,31 @@
15141514
"alwaysAddToPackageJson":false
15151515
}
15161516
}
1517+
},
1518+
"14.8.0": {
1519+
"version":"14.8.0-beta.0",
1520+
"packages": {
1521+
"jest-preset-angular": {
1522+
"version":"~12.2.2",
1523+
"alwaysAddToPackageJson":false
1524+
},
1525+
"typescript": {
1526+
"version":"~4.8.2",
1527+
"alwaysAddToPackageJson":false
1528+
},
1529+
"@angular-eslint/eslint-plugin": {
1530+
"version":"~14.0.4",
1531+
"alwaysAddToPackageJson":false
1532+
},
1533+
"@angular-eslint/eslint-plugin-template": {
1534+
"version":"~14.0.4",
1535+
"alwaysAddToPackageJson":false
1536+
},
1537+
"@angular-eslint/template-parser": {
1538+
"version":"~14.0.4",
1539+
"alwaysAddToPackageJson":false
1540+
}
1541+
}
15171542
}
15181543
}
15191544
}

‎packages/angular/ng-package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"@angular-eslint/",
1010
"@schematics",
1111
"@phenomnomnominal/tsquery",
12+
"@typescript-eslint/",
1213
"chalk",
1314
"chokidar",
1415
"ignore",

‎packages/angular/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"@nrwl/workspace":"file:../workspace",
4949
"@phenomnomnominal/tsquery":"4.1.1",
5050
"@schematics/angular":"~14.2.0",
51+
"@typescript-eslint/type-utils":"^5.36.1",
5152
"chalk":"4.1.0",
5253
"chokidar":"^3.5.1",
5354
"http-server":"^14.1.0",

‎packages/angular/src/generators/convert-tslint-to-eslint/__snapshots__/convert-tslint-to-eslint.spec.ts.snap

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -573,13 +573,13 @@ exports[`convert-tslint-to-eslint should work for Angular applications 1`] = `
573573
Object{
574574
"dependencies":Object {},
575575
"devDependencies":Object {
576-
"@angular-eslint/eslint-plugin":"~14.0.0",
577-
"@angular-eslint/eslint-plugin-template":"~14.0.0",
578-
"@angular-eslint/template-parser":"~14.0.0",
576+
"@angular-eslint/eslint-plugin":"~14.0.4",
577+
"@angular-eslint/eslint-plugin-template":"~14.0.4",
578+
"@angular-eslint/template-parser":"~14.0.4",
579579
"@nrwl/eslint-plugin-nx":"0.0.1",
580580
"@nrwl/linter":"0.0.1",
581-
"@typescript-eslint/eslint-plugin":"~5.33.1",
582-
"@typescript-eslint/parser":"~5.33.1",
581+
"@typescript-eslint/eslint-plugin":"^5.36.1",
582+
"@typescript-eslint/parser":"^5.36.1",
583583
"eslint":"~8.15.0",
584584
"eslint-config-prettier":"8.1.0",
585585
"eslint-plugin-import":"latest",
@@ -931,13 +931,13 @@ exports[`convert-tslint-to-eslint should work for Angular libraries 1`] = `
931931
Object{
932932
"dependencies":Object {},
933933
"devDependencies":Object {
934-
"@angular-eslint/eslint-plugin":"~14.0.0",
935-
"@angular-eslint/eslint-plugin-template":"~14.0.0",
936-
"@angular-eslint/template-parser":"~14.0.0",
934+
"@angular-eslint/eslint-plugin":"~14.0.4",
935+
"@angular-eslint/eslint-plugin-template":"~14.0.4",
936+
"@angular-eslint/template-parser":"~14.0.4",
937937
"@nrwl/eslint-plugin-nx":"0.0.1",
938938
"@nrwl/linter":"0.0.1",
939-
"@typescript-eslint/eslint-plugin":"~5.33.1",
940-
"@typescript-eslint/parser":"~5.33.1",
939+
"@typescript-eslint/eslint-plugin":"^5.36.1",
940+
"@typescript-eslint/parser":"^5.36.1",
941941
"eslint":"~8.15.0",
942942
"eslint-config-prettier":"8.1.0",
943943
"eslint-plugin-import":"latest",

‎packages/angular/src/generators/utils/insert-ngmodule-import.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ import {
1818
SourceFile,
1919
}from'typescript';
2020

21+
/**
22+
* Importing this helper from @typescript-eslint/type-utils to ensure
23+
* compatibility with TS < 4.8 due to the API change in TS4.8.
24+
* This helper allows for support of TS <= 4.8.
25+
*/
26+
import{getDecorators}from'@typescript-eslint/type-utils';
27+
2128
typengModuleDecoratorProperty=
2229
|'imports'
2330
|'providers'
@@ -52,7 +59,7 @@ export function insertNgModuleProperty(
5259

5360
constngModuleClassDeclaration=findDecoratedClass(sourceFile,ngModuleName);
5461

55-
constngModuleDecorator=ngModuleClassDeclaration.decorators.find(
62+
constngModuleDecorator=getDecorators(ngModuleClassDeclaration).find(
5663
(decorator)=>
5764
isCallExpression(decorator.expression)&&
5865
isIdentifier(decorator.expression.expression)&&
@@ -160,16 +167,18 @@ function getNamedImport(coreImport: ImportDeclaration, importName: string) {
160167

161168
functionfindDecoratedClass(sourceFile:SourceFile,ngModuleName:__String){
162169
constclassDeclarations=sourceFile.statements.filter(isClassDeclaration);
163-
returnclassDeclarations.find(
164-
(declaration)=>
165-
declaration.decorators&&
166-
declaration.decorators.some(
170+
returnclassDeclarations.find((declaration)=>{
171+
constdecorators=getDecorators(declaration);
172+
if(decorators){
173+
returndecorators.some(
167174
(decorator)=>
168175
isCallExpression(decorator.expression)&&
169176
isIdentifier(decorator.expression.expression)&&
170177
decorator.expression.expression.escapedText===ngModuleName
171-
)
172-
);
178+
);
179+
}
180+
returnundefined;
181+
});
173182
}
174183

175184
functionfindPropertyAssignment(

‎packages/angular/src/utils/versions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const zoneJsVersion = '~0.11.4';
99
exportconstangularJsVersion='1.7.9';
1010
exportconsttsLibVersion='^2.3.0';
1111

12-
exportconstangularEslintVersion='~14.0.0';
12+
exportconstangularEslintVersion='~14.0.4';
1313
exportconsttailwindVersion='^3.0.2';
1414
exportconstpostcssVersion='^8.4.5';
1515
exportconstpostcssImportVersion='~14.1.0';
@@ -18,7 +18,7 @@ export const postcssUrlVersion = '~10.1.3';
1818
exportconstautoprefixerVersion='^10.4.0';
1919
exportconsttsNodeVersion='10.9.1';
2020

21-
exportconstjestPresetAngularVersion='~12.2.0';
21+
exportconstjestPresetAngularVersion='~12.2.2';
2222
exportconstprotractorVersion='~7.0.0';
2323
exportconstkarmaVersion='~6.4.0';
2424
exportconstkarmaChromeLauncherVersion='~3.1.0';

‎packages/cypress/src/generators/convert-tslint-to-eslint/__snapshots__/convert-tslint-to-eslint.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Object {
66
"devDependencies":Object {
77
"@nrwl/eslint-plugin-nx":"0.0.1",
88
"@nrwl/linter":"0.0.1",
9-
"@typescript-eslint/eslint-plugin":"~5.33.1",
10-
"@typescript-eslint/parser":"~5.33.1",
9+
"@typescript-eslint/eslint-plugin":"^5.36.1",
10+
"@typescript-eslint/parser":"^5.36.1",
1111
"eslint":"~8.15.0",
1212
"eslint-config-prettier":"8.1.0",
1313
"eslint-plugin-cypress":"^2.10.3",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp