Skip to content

Commit fff704e

Browse files
committed
feat: warn if addon includes ember-cli-typescript as dev dependency
Closes #497
1 parent 8b1b285 commit fff704e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ts/addon.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default addon({
2121
// typecheck worker so we don't wait until the end of the build to check
2222
if (this.parent === this.project) {
2323
this._getTypecheckWorker();
24+
this._checkInstallationLocation();
2425
}
2526
},
2627

@@ -120,6 +121,18 @@ export default addon({
120121
}
121122
},
122123

124+
_checkInstallationLocation() {
125+
if (
126+
this.project.isEmberCLIAddon() &&
127+
this.project.pkg.devDependencies &&
128+
this.project.pkg.devDependencies[this.name]
129+
) {
130+
this.ui.writeWarnLine(
131+
'`ember-cli-typescript` should be included in your `dependencies`, not `devDependencies`'
132+
);
133+
}
134+
},
135+
123136
_addPluginIfMissing(name: string, config?: unknown, constraints?: AddPluginOptions) {
124137
let target = this._getConfigurationTarget();
125138

0 commit comments

Comments
 (0)