Skip to content

Commit

Permalink
feat(react): update generator defaults in workspace.json for strict m…
Browse files Browse the repository at this point in the history
…ode (#5529)

ISSUES CLOSED: #5250
  • Loading branch information
puku0x committed May 14, 2021
1 parent cd3dd94 commit bcdbb02
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/react/src/generators/application/application.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,5 +713,28 @@ describe('app', () => {
},
]);
});

it('should default strict to true in workspace.json', async () => {
await applicationGenerator(appTree, {
...schema,
strict: true,
});
const workspaceJson = readWorkspaceConfiguration(appTree);

expect(workspaceJson.generators['@nrwl/react']).toMatchObject({
application: {
babel: true,
style: schema.style,
strict: true,
},
component: {
style: schema.style,
},
library: {
style: schema.style,
strict: true,
},
});
});
});
});
2 changes: 2 additions & 0 deletions packages/react/src/generators/application/lib/set-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export function setDefaults(host: Tree, options: NormalizedSchema) {
application: {
style: options.style,
linter: options.linter,
strict: options.strict,
...prev.application,
},
component: {
Expand All @@ -38,6 +39,7 @@ export function setDefaults(host: Tree, options: NormalizedSchema) {
library: {
style: options.style,
linter: options.linter,
strict: options.strict,
...prev.library,
},
},
Expand Down

0 comments on commit bcdbb02

Please sign in to comment.