Skip to content

Commit ba6f546

Browse files
alan-agius4filipesilva
authored andcommitted
fix(@schematics/angular): add additionalProperties to all schemas
1 parent a09000c commit ba6f546

File tree

23 files changed

+30
-6
lines changed

23 files changed

+30
-6
lines changed

packages/schematics/angular/app-shell/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"title": "Angular AppShell Options Schema",
55
"type": "object",
66
"description": "Generates an app shell for running a server-side version of an app.",
7+
"additionalProperties": false,
78
"long-description": "./app-shell-long.md",
89
"properties": {
910
"clientProject": {

packages/schematics/angular/application/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"title": "Angular Application Options Schema",
55
"type": "object",
66
"description": "Generates a new basic app definition in the \"projects\" subfolder of the workspace.",
7+
"additionalProperties": false,
78
"properties": {
89
"projectRoot": {
910
"description": "The root directory of the new app.",

packages/schematics/angular/class/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"title": "Angular Class Options Schema",
55
"type": "object",
66
"description": "Creates a new generic class definition in the given or default project.",
7+
"additionalProperties": false,
78
"properties": {
89
"name": {
910
"type": "string",

packages/schematics/angular/component/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"title": "Angular Component Options Schema",
55
"type": "object",
66
"description": "Creates a new generic component definition in the given or default project.",
7+
"additionalProperties": false,
78
"properties": {
89
"path": {
910
"type": "string",

packages/schematics/angular/directive/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"title": "Angular Directive Options Schema",
55
"type": "object",
66
"description": "Creates a new generic directive definition in the given or default project.",
7+
"additionalProperties": false,
78
"properties": {
89
"name": {
910
"type": "string",

packages/schematics/angular/e2e/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "SchematicsAngularE2eApp",
44
"title": "Angular e2e Application Options Schema",
55
"type": "object",
6+
"additionalProperties": false,
67
"description": "Generates a new, generic end-to-end test definition for the given or default project.",
78
"long-description": "e2e-long.md",
89
"properties": {

packages/schematics/angular/enum/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"title": "Angular Enum Options Schema",
55
"type": "object",
66
"description": "Generates a new, generic enum definition for the given or default project.",
7+
"additionalProperties": false,
78
"properties": {
89
"name": {
910
"type": "string",

packages/schematics/angular/guard/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"title": "Angular Guard Options Schema",
55
"type": "object",
66
"description": "Generates a new, generic route guard definition in the given or default project.",
7+
"additionalProperties": false,
78
"properties": {
89
"name": {
910
"type": "string",

packages/schematics/angular/interceptor/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "SchematicsAngularInterceptor",
44
"title": "Angular Interceptor Options Schema",
55
"type": "object",
6+
"additionalProperties": false,
67
"description": "Creates a new, generic interceptor definition in the given or default project.",
78
"properties": {
89
"name": {

packages/schematics/angular/interface/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "SchematicsAngularInterface",
44
"title": "Angular Interface Options Schema",
55
"type": "object",
6+
"additionalProperties": false,
67
"description": "Creates a new generic interface definition in the given or default project.",
78
"properties": {
89
"name": {

packages/schematics/angular/library/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"type": "object",
66
"description": "Creates a new generic library project in the current workspace.",
77
"long-description": "./library-long.md",
8+
"additionalProperties": false,
89
"properties": {
910
"name": {
1011
"type": "string",

packages/schematics/angular/migrations/update-9/ivy-libraries_spec.ts

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ describe('Migration to version 9', () => {
4444
{
4545
name: 'migration-test',
4646
version: '1.2.3',
47-
directory: '.',
4847
},
4948
tree,
5049
)

packages/schematics/angular/migrations/update-9/remove-tsickle_spec.ts

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ describe('Migration to version 9', () => {
2929
{
3030
name: 'migration-test',
3131
version: '1.2.3',
32-
directory: '.',
3332
},
3433
tree,
3534
)

packages/schematics/angular/module/index.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
schematic,
2121
url,
2222
} from '@angular-devkit/schematics';
23+
import { Schema as ComponentOptions } from '../component/schema';
2324
import * as ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript';
2425
import { addImportToModule, addRouteDeclarationToModule } from '../utility/ast-utils';
2526
import { InsertChange } from '../utility/change';
@@ -167,15 +168,20 @@ export default function (options: ModuleOptions): Rule {
167168
const modulePath =
168169
`${!options.flat ? moduleDasherized + '/' : ''}${moduleDasherized}.module.ts`;
169170

171+
const componentOptions: ComponentOptions = {
172+
module: modulePath,
173+
flat: options.flat,
174+
name: options.name,
175+
path: options.path,
176+
project: options.project,
177+
};
178+
170179
return chain([
171180
!isLazyLoadedModuleGen ? addDeclarationToNgModule(options) : noop(),
172181
addRouteDeclarationToNgModule(options, routingModulePath),
173182
mergeWith(templateSource),
174183
isLazyLoadedModuleGen
175-
? schematic('component', {
176-
...options,
177-
module: modulePath,
178-
})
184+
? schematic('component', componentOptions)
179185
: noop(),
180186
options.lintFix ? applyLintFix(options.path) : noop(),
181187
]);

packages/schematics/angular/module/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "SchematicsAngularModule",
44
"title": "Angular Module Options Schema",
55
"type": "object",
6+
"additionalProperties": false,
67
"description": "Creates a new generic NgModule definition in the given or default project.",
78
"properties": {
89
"name": {

packages/schematics/angular/ng-new/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "SchematicsAngularNgNew",
44
"title": "Angular Ng New Options Schema",
55
"type": "object",
6+
"additionalProperties": false,
67
"properties": {
78
"directory": {
89
"type": "string",

packages/schematics/angular/pipe/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "SchematicsAngularPipe",
44
"title": "Angular Pipe Options Schema",
55
"type": "object",
6+
"additionalProperties": false,
67
"description": "Creates a new generic pipe definition in the given or default project.",
78
"properties": {
89
"name": {

packages/schematics/angular/resolver/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "SchematicsAngularResolver",
44
"title": "Angular resolver Options Schema",
55
"type": "object",
6+
"additionalProperties": false,
67
"description": "Generates a new, generic resolver definition in the given or default project.",
78
"properties": {
89
"name": {

packages/schematics/angular/service-worker/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "SchematicsAngularServiceWorker",
44
"title": "Angular Service Worker Options Schema",
55
"type": "object",
6+
"additionalProperties": false,
67
"description": "Pass this schematic to the \"run\" command to create a service worker",
78
"properties": {
89
"project": {

packages/schematics/angular/service/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "SchematicsAngularService",
44
"title": "Angular Service Options Schema",
55
"type": "object",
6+
"additionalProperties": false,
67
"description": "Creates a new, generic service definition in the given or default project.",
78
"properties": {
89
"name": {

packages/schematics/angular/universal/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "SchematicsAngularUniversalApp",
44
"title": "Angular Universal App Options Schema",
55
"type": "object",
6+
"additionalProperties": false,
67
"description": "Pass this schematic to the \"run\" command to set up server-side rendering for an app.",
78
"properties": {
89
"clientProject": {

packages/schematics/angular/web-worker/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "SchematicsAngularWebWorker",
44
"title": "Angular Web Worker Options Schema",
55
"type": "object",
6+
"additionalProperties": false,
67
"description": "Creates a new generic web worker definition in the given or default project.",
78
"properties": {
89
"path": {

packages/schematics/angular/workspace/schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "SchematicsAngularWorkspace",
44
"title": "Angular Workspace Options Schema",
55
"type": "object",
6+
"additionalProperties": false,
67
"properties": {
78
"name": {
89
"description": "The name of the workspace.",

0 commit comments

Comments
 (0)