Re-enable `strictPropertyInitialization` in tsconfig

- Use declare for existing Stimulus controllers
- First enabled in #9761 & then disabled in #9818
pull/9968/head
Thibaud Colas 2023-01-25 12:50:59 +00:00 zatwierdzone przez LB (Ben Johnston)
rodzic 5db3cda90b
commit d4544ec9ee
4 zmienionych plików z 10 dodań i 9 usunięć

Wyświetl plik

@ -5,6 +5,7 @@ Changelog
~~~~~~~~~~~~~~~~
* Maintenance: Update djhtml (html formatting) library to v 1.5.2 (Loveth Omokaro)
* Maintenance: Re-enable `strictPropertyInitialization` in tsconfig (Thibaud Colas)
4.2 (xx.xx.xxxx) - IN DEVELOPMENT

Wyświetl plik

@ -20,8 +20,8 @@ export class ActionController extends Controller {
url: String,
};
continueValue: boolean;
urlValue: string;
declare continueValue: boolean;
declare urlValue: string;
post(event: Event) {
event.preventDefault();

Wyświetl plik

@ -28,12 +28,12 @@ export class UpgradeController extends Controller<HTMLElement> {
url: { default: 'https://releases.wagtail.org/latest.txt', type: String },
};
currentVersionValue: string;
hiddenClass: string;
latestVersionTarget: HTMLElement;
linkTarget: HTMLElement;
ltsOnlyValue: any;
urlValue: string;
declare currentVersionValue: string;
declare hiddenClass: string;
declare latestVersionTarget: HTMLElement;
declare linkTarget: HTMLElement;
declare ltsOnlyValue: any;
declare urlValue: string;
connect() {
this.checkVersion();

Wyświetl plik

@ -11,7 +11,7 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictNullChecks": true,
"strictPropertyInitialization": false,
"strictPropertyInitialization": true,
"target": "ES2021" // Since lowest browser support is for Safari 14
},
"files": [