Skip to content

Commit 698f0b7

Browse files
chore: update to Nx 20 (#4596)
1 parent 4e8d529 commit 698f0b7

File tree

61 files changed

+737
-766
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+737
-766
lines changed

Diff for: jest.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const { getJestProjects } = require('@nx/jest');
1+
const { getJestProjectsAsync } = require('@nx/jest');
22

3-
export default { projects: getJestProjects() };
3+
export default async () => ({ projects: await getJestProjectsAsync() });

Diff for: modules/component-store/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"outputs": ["{workspaceRoot}/dist/modules/component-store"]
3232
},
3333
"lint": {
34-
"executor": "@nx/linter:eslint",
34+
"executor": "@nx/eslint:lint",
3535
"options": {
3636
"lintFilePatterns": [
3737
"modules/component-store/*/**/*.ts",

Diff for: modules/component/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"outputs": ["{workspaceRoot}/dist/modules/component"]
3232
},
3333
"lint": {
34-
"executor": "@nx/linter:eslint",
34+
"executor": "@nx/eslint:lint",
3535
"options": {
3636
"lintFilePatterns": [
3737
"modules/component/*/**/*.ts",

Diff for: modules/data/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"outputs": ["{workspaceRoot}/dist/modules/data"]
3232
},
3333
"lint": {
34-
"executor": "@nx/linter:eslint",
34+
"executor": "@nx/eslint:lint",
3535
"options": {
3636
"lintFilePatterns": [
3737
"modules/data/*/**/*.ts",

Diff for: modules/effects/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
]
4444
},
4545
"lint": {
46-
"executor": "@nx/linter:eslint",
46+
"executor": "@nx/eslint:lint",
4747
"options": {
4848
"lintFilePatterns": [
4949
"modules/effects/*/**/*.ts",

Diff for: modules/entity/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
]
4444
},
4545
"lint": {
46-
"executor": "@nx/linter:eslint",
46+
"executor": "@nx/eslint:lint",
4747
"options": {
4848
"lintFilePatterns": [
4949
"modules/entity/*/**/*.ts",

Diff for: modules/eslint-plugin/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"generators": {},
77
"targets": {
88
"lint": {
9-
"executor": "@nx/linter:eslint",
9+
"executor": "@nx/eslint:lint",
1010
"options": {
1111
"lintFilePatterns": [
1212
"modules/eslint-plugin/*/**/*.ts",

Diff for: modules/eslint-plugin/spec/rules/component-store/avoid-combining-component-store-selectors.spec.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
1+
import type { ESLintUtils } from '@typescript-eslint/utils';
2+
import type {
3+
InvalidTestCase,
4+
ValidTestCase,
5+
} from '@typescript-eslint/rule-tester';
26
import * as path from 'path';
37
import rule, {
48
messageId,
@@ -7,9 +11,8 @@ import { ruleTester, fromFixture } from '../../utils';
711

812
type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
913
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
10-
type RunTests = TSESLint.RunTests<MessageIds, Options>;
1114

12-
const validConstructor: () => RunTests['valid'] = () => [
15+
const validConstructor: () => (string | ValidTestCase<Options>)[] = () => [
1316
`
1417
import { ComponentStore } from '@ngrx/component-store'
1518
class Ok extends ComponentStore<MoviesState> {
@@ -68,7 +71,7 @@ class Ok extends ComponentStore<MoviesState> {
6871
}`,
6972
];
7073

71-
const validInject: () => RunTests['valid'] = () => [
74+
const validInject: () => (string | ValidTestCase<Options>)[] = () => [
7275
`
7376
import { inject } from '@angular/core'
7477
import { ComponentStore } from '@ngrx/component-store'
@@ -91,7 +94,7 @@ class Ok {
9194
}`,
9295
];
9396

94-
const invalidConstructor: () => RunTests['invalid'] = () => [
97+
const invalidConstructor: () => InvalidTestCase<MessageIds, Options>[] = () => [
9598
fromFixture(`
9699
import { ComponentStore } from '@ngrx/component-store'
97100
@@ -178,7 +181,7 @@ class NotOk {
178181
`),
179182
];
180183

181-
const invalidInject: () => RunTests['invalid'] = () => [
184+
const invalidInject: () => InvalidTestCase<MessageIds, Options>[] = () => [
182185
fromFixture(`
183186
import { inject } from '@angular/core'
184187
import { ComponentStore } from '@ngrx/component-store'

Diff for: modules/eslint-plugin/spec/rules/component-store/avoid-mapping-component-store-selectors.spec.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
1+
import type { ESLintUtils } from '@typescript-eslint/utils';
2+
import type {
3+
InvalidTestCase,
4+
ValidTestCase,
5+
} from '@typescript-eslint/rule-tester';
26
import * as path from 'path';
37
import rule, {
48
messageId,
@@ -7,9 +11,8 @@ import { ruleTester, fromFixture } from '../../utils';
711

812
type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
913
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
10-
type RunTests = TSESLint.RunTests<MessageIds, Options>;
1114

12-
const validConstructor: () => RunTests['valid'] = () => [
15+
const validConstructor: () => (string | ValidTestCase<Options>)[] = () => [
1316
`
1417
import { ComponentStore } from '@ngrx/component-store'
1518
@@ -55,7 +58,7 @@ export class UserStore extends ComponentStore<UserState> {
5558
`,
5659
];
5760

58-
const validInject: () => RunTests['valid'] = () => [
61+
const validInject: () => (string | ValidTestCase<Options>)[] = () => [
5962
`
6063
import { inject } from '@angular/core'
6164
import { ComponentStore } from '@ngrx/component-store'
@@ -67,7 +70,7 @@ class Ok {
6770
}`,
6871
];
6972

70-
const invalidConstructor: () => RunTests['invalid'] = () => [
73+
const invalidConstructor: () => InvalidTestCase<MessageIds, Options>[] = () => [
7174
fromFixture(`
7275
import { ComponentStore } from '@ngrx/component-store'
7376
@@ -113,7 +116,7 @@ export class UserStore extends ComponentStore<UserState> {
113116
}`),
114117
];
115118

116-
const invalidInject: () => RunTests['invalid'] = () => [
119+
const invalidInject: () => InvalidTestCase<MessageIds, Options>[] = () => [
117120
fromFixture(`
118121
import { inject } from '@angular/core'
119122
import { ComponentStore } from '@ngrx/component-store'

Diff for: modules/eslint-plugin/spec/rules/component-store/updater-explicit-return-type.spec.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
1+
import type { ESLintUtils } from '@typescript-eslint/utils';
2+
import type {
3+
InvalidTestCase,
4+
ValidTestCase,
5+
} from '@typescript-eslint/rule-tester';
26
import * as path from 'path';
37
import rule, {
48
messageId,
@@ -7,9 +11,8 @@ import { ruleTester, fromFixture } from '../../utils';
711

812
type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
913
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
10-
type RunTests = TSESLint.RunTests<MessageIds, Options>;
1114

12-
const validConstructor: () => RunTests['valid'] = () => [
15+
const validConstructor: () => (string | ValidTestCase<Options>)[] = () => [
1316
`
1417
import { ComponentStore } from '@ngrx/component-store'
1518
@@ -62,7 +65,7 @@ class Ok3 {
6265
}`,
6366
];
6467

65-
const validInject: () => RunTests['valid'] = () => [
68+
const validInject: () => (string | ValidTestCase<Options>)[] = () => [
6669
`
6770
import { ComponentStore } from '@ngrx/component-store'
6871
import { inject } from '@angular/core'
@@ -93,7 +96,7 @@ class Ok5 {
9396
}`,
9497
];
9598

96-
const invalidConstructor: () => RunTests['invalid'] = () => [
99+
const invalidConstructor: () => InvalidTestCase<MessageIds, Options>[] = () => [
97100
fromFixture(`
98101
import { ComponentStore } from '@ngrx/component-store'
99102
@@ -162,7 +165,7 @@ export class CompetitorsStore2 extends CompetitorsStore1 {
162165
}`),
163166
];
164167

165-
const invalidInject: () => RunTests['invalid'] = () => [
168+
const invalidInject: () => InvalidTestCase<MessageIds, Options>[] = () => [
166169
fromFixture(`
167170
import { ComponentStore } from '@ngrx/component-store'
168171
import { inject } from '@angular/core'

Diff for: modules/eslint-plugin/spec/rules/effects/avoid-cyclic-effects.spec.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
1+
import type { ESLintUtils } from '@typescript-eslint/utils';
2+
import type {
3+
InvalidTestCase,
4+
ValidTestCase,
5+
} from '@typescript-eslint/rule-tester';
26
import * as path from 'path';
37
import rule, {
48
messageId,
@@ -7,7 +11,6 @@ import { ruleTester, fromFixture } from '../../utils';
711

812
type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
913
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
10-
type RunTests = TSESLint.RunTests<MessageIds, Options>;
1114

1215
const setup = `
1316
import type { OnRunEffects } from '@ngrx/effects'
@@ -29,7 +32,7 @@ const genericFoo = createAction(\`$\{subject} FOO\`)
2932
const genericBar = createAction(\`$\{subject} BAR\`)
3033
`;
3134

32-
const validConstructor: () => RunTests['valid'] = () => [
35+
const validConstructor: () => (string | ValidTestCase<Options>)[] = () => [
3336
`
3437
${setup}
3538
class Effect {
@@ -151,7 +154,7 @@ class Effect {
151154
}`,
152155
];
153156

154-
const validInject: () => RunTests['valid'] = () => [
157+
const validInject: () => (string | ValidTestCase<Options>)[] = () => [
155158
`
156159
${setup}
157160
class Effect {
@@ -268,7 +271,7 @@ class Effect {
268271
}`,
269272
];
270273

271-
const invalidConstructor: () => RunTests['invalid'] = () => [
274+
const invalidConstructor: () => InvalidTestCase<MessageIds, Options>[] = () => [
272275
fromFixture(`
273276
${setup}
274277
class Effect {
@@ -382,7 +385,7 @@ class Effect {
382385
}`),
383386
];
384387

385-
const invalidInject: () => RunTests['invalid'] = () => [
388+
const invalidInject: () => InvalidTestCase<MessageIds, Options>[] = () => [
386389
fromFixture(`
387390
${setup}
388391
class Effect {

Diff for: modules/eslint-plugin/spec/rules/effects/no-dispatch-in-effects.spec.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
1+
import type { ESLintUtils } from '@typescript-eslint/utils';
2+
import type {
3+
InvalidTestCase,
4+
ValidTestCase,
5+
} from '@typescript-eslint/rule-tester';
26
import * as path from 'path';
37
import rule, {
48
noDispatchInEffects,
@@ -8,9 +12,8 @@ import { ruleTester, fromFixture } from '../../utils';
812

913
type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
1014
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
11-
type RunTests = TSESLint.RunTests<MessageIds, Options>;
1215

13-
const validConstructor: () => RunTests['valid'] = () => [
16+
const validConstructor: () => (string | ValidTestCase<Options>)[] = () => [
1417
`
1518
import { Store } from '@ngrx/store'
1619
@@ -50,7 +53,7 @@ const validConstructor: () => RunTests['valid'] = () => [
5053
}`,
5154
];
5255

53-
const validInject: () => RunTests['valid'] = () => [
56+
const validInject: () => (string | ValidTestCase<Options>)[] = () => [
5457
`
5558
import { Store } from '@ngrx/store'
5659
import { inject } from '@angular/core'
@@ -102,7 +105,7 @@ class Ok5 {
102105
}`,
103106
];
104107

105-
const invalidConstructor: () => RunTests['invalid'] = () => [
108+
const invalidConstructor: () => InvalidTestCase<MessageIds, Options>[] = () => [
106109
fromFixture(
107110
`
108111
import { Store } from '@ngrx/store'
@@ -335,7 +338,7 @@ class NotOk3 {
335338
),
336339
];
337340

338-
const invalidInject: () => RunTests['invalid'] = () => [
341+
const invalidInject: () => InvalidTestCase<MessageIds, Options>[] = () => [
339342
fromFixture(
340343
`
341344
import { Store } from '@ngrx/store'

Diff for: modules/eslint-plugin/spec/rules/effects/no-effects-in-providers.spec.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
1+
import type { ESLintUtils } from '@typescript-eslint/utils';
2+
import type {
3+
InvalidTestCase,
4+
ValidTestCase,
5+
} from '@typescript-eslint/rule-tester';
26
import * as path from 'path';
37
import rule, {
48
messageId,
@@ -7,9 +11,8 @@ import { ruleTester, fromFixture } from '../../utils';
711

812
type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
913
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
10-
type RunTests = TSESLint.RunTests<MessageIds, Options>;
1114

12-
const valid: () => RunTests['valid'] = () => [
15+
const valid: () => (string | ValidTestCase<Options>)[] = () => [
1316
`
1417
@NgModule({
1518
imports: [
@@ -22,7 +25,7 @@ const valid: () => RunTests['valid'] = () => [
2225
export class AppModule {}`,
2326
];
2427

25-
const invalid: () => RunTests['invalid'] = () => [
28+
const invalid: () => InvalidTestCase<MessageIds, Options>[] = () => [
2629
fromFixture(
2730
`
2831
@NgModule({

Diff for: modules/eslint-plugin/spec/rules/effects/no-multiple-actions-in-effects.spec.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
1+
import type { ESLintUtils } from '@typescript-eslint/utils';
2+
import type {
3+
InvalidTestCase,
4+
ValidTestCase,
5+
} from '@typescript-eslint/rule-tester';
26
import * as path from 'path';
37
import rule, {
48
messageId,
@@ -7,9 +11,8 @@ import { ruleTester, fromFixture } from '../../utils';
711

812
type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
913
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
10-
type RunTests = TSESLint.RunTests<MessageIds, Options>;
1114

12-
const valid: () => RunTests['valid'] = () => [
15+
const valid: () => (string | ValidTestCase<Options>)[] = () => [
1316
`
1417
@Injectable()
1518
export class Effects {
@@ -114,7 +117,7 @@ export class Effects {
114117
}`,
115118
];
116119

117-
const invalid: () => RunTests['invalid'] = () => [
120+
const invalid: () => InvalidTestCase<MessageIds, Options>[] = () => [
118121
fromFixture(
119122
`
120123
@Injectable()

Diff for: modules/eslint-plugin/spec/rules/effects/prefer-effect-callback-in-block-statement.spec.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
1+
import type { ESLintUtils } from '@typescript-eslint/utils';
2+
import type {
3+
InvalidTestCase,
4+
ValidTestCase,
5+
} from '@typescript-eslint/rule-tester';
26
import * as path from 'path';
37
import rule, {
48
messageId,
@@ -7,9 +11,8 @@ import { ruleTester, fromFixture } from '../../utils';
711

812
type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
913
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
10-
type RunTests = TSESLint.RunTests<MessageIds, Options>;
1114

12-
const valid: () => RunTests['valid'] = () => [
15+
const valid: () => (string | ValidTestCase<Options>)[] = () => [
1316
`
1417
@Injectable()
1518
class Effect {
@@ -52,7 +55,7 @@ class Effect {
5255
}`,
5356
];
5457

55-
const invalid: () => RunTests['invalid'] = () => [
58+
const invalid: () => InvalidTestCase<MessageIds, Options>[] = () => [
5659
fromFixture(
5760
`
5861
@Injectable()

0 commit comments

Comments
 (0)