mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
write our own little gulp-eslint which takes the eslint from our workspace root (#230115)
This commit is contained in:
committed by
GitHub
parent
ef44e67783
commit
841d51da29
@@ -5,15 +5,15 @@
|
||||
import { MessagePoster } from './messaging';
|
||||
|
||||
export class StyleLoadingMonitor {
|
||||
private unloadedStyles: string[] = [];
|
||||
private finishedLoading: boolean = false;
|
||||
private _unloadedStyles: string[] = [];
|
||||
private _finishedLoading: boolean = false;
|
||||
|
||||
private poster?: MessagePoster;
|
||||
private _poster?: MessagePoster;
|
||||
|
||||
constructor() {
|
||||
const onStyleLoadError = (event: any) => {
|
||||
const source = event.target.dataset.source;
|
||||
this.unloadedStyles.push(source);
|
||||
this._unloadedStyles.push(source);
|
||||
};
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
@@ -25,18 +25,18 @@ export class StyleLoadingMonitor {
|
||||
});
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
if (!this.unloadedStyles.length) {
|
||||
if (!this._unloadedStyles.length) {
|
||||
return;
|
||||
}
|
||||
this.finishedLoading = true;
|
||||
this.poster?.postMessage('previewStyleLoadError', { unloadedStyles: this.unloadedStyles });
|
||||
this._finishedLoading = true;
|
||||
this._poster?.postMessage('previewStyleLoadError', { unloadedStyles: this._unloadedStyles });
|
||||
});
|
||||
}
|
||||
|
||||
public setPoster(poster: MessagePoster): void {
|
||||
this.poster = poster;
|
||||
if (this.finishedLoading) {
|
||||
poster.postMessage('previewStyleLoadError', { unloadedStyles: this.unloadedStyles });
|
||||
this._poster = poster;
|
||||
if (this._finishedLoading) {
|
||||
poster.postMessage('previewStyleLoadError', { unloadedStyles: this._unloadedStyles });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user