I am using the Aurelia Cli and it is working great for the most part but 1 thing is really niggling me.
I have created a new prototype extension like so:
interface Array<T> {
remove(itemToRemove: T): Array<T>;
}
Array.prototype.remove = function (itemToRemove) {
const index = this.indexOf(itemToRemove);
if (index !== -1) {
this.splice(index, 1);
}
return this;
}
This works fine except that when i save any file with au run --watch
running. I will get an error on build telling me that remove
is not a valid method on []
. This is random and happens about 1 in 4 times. If i change nothing and save again it will likely not complain again.
How may I get Aurelia to consistently be okay with this?
Link to full project: https://github.com/4imble/StackRpg/tree/master/Client/src