Skip to content

Commit

Permalink
feat(build): compile build with TSC strict mode enabled (#539)
Browse files Browse the repository at this point in the history
* feat(build): compile build with TSC strict mode enabled
  • Loading branch information
ghiscoding committed Mar 24, 2021
1 parent 2f16407 commit 483c4ba
Show file tree
Hide file tree
Showing 11 changed files with 171 additions and 171 deletions.
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
"serve:demo": "http-server ./docs -p 9000 -a localhost"
},
"dependencies": {
"@slickgrid-universal/common": "^0.11.2",
"@slickgrid-universal/empty-warning-component": "^0.11.2",
"@slickgrid-universal/common": "^0.12.0",
"@slickgrid-universal/empty-warning-component": "^0.12.0",
"aurelia-event-aggregator": "^1.0.3",
"aurelia-framework": "^1.3.1",
"aurelia-i18n": "^3.1.4",
Expand All @@ -74,20 +74,20 @@
"i18next": ">= 14.1.1"
},
"devDependencies": {
"@slickgrid-universal/composite-editor-component": "^0.11.2",
"@slickgrid-universal/excel-export": "^0.11.2",
"@slickgrid-universal/graphql": "^0.11.2",
"@slickgrid-universal/odata": "^0.11.2",
"@slickgrid-universal/text-export": "^0.11.2",
"@slickgrid-universal/composite-editor-component": "^0.12.0",
"@slickgrid-universal/excel-export": "^0.12.0",
"@slickgrid-universal/graphql": "^0.12.0",
"@slickgrid-universal/odata": "^0.12.0",
"@slickgrid-universal/text-export": "^0.12.0",
"@types/bluebird": "^3.5.33",
"@types/dompurify": "^2.2.1",
"@types/i18next-xhr-backend": "^1.4.2",
"@types/jest": "^26.0.20",
"@types/jest": "^26.0.21",
"@types/jquery": "^3.5.5",
"@types/node": "^14.14.35",
"@types/webpack": "^4.41.26",
"@typescript-eslint/eslint-plugin": "^4.18.0",
"@typescript-eslint/parser": "^4.18.0",
"@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/parser": "^4.19.0",
"app-settings-loader": "^1.0.6",
"aurelia-animator-css": "^1.0.4",
"aurelia-bootstrapper": "^2.3.3",
Expand All @@ -109,7 +109,7 @@
"copy-webpack-plugin": "^6.4.1",
"copyfiles": "^2.4.1",
"cross-env": "^7.0.3",
"css-loader": "5.1.3",
"css-loader": "5.2.0",
"del": "^6.0.0",
"duplicate-package-checker-webpack-plugin": "^3.0.0",
"eslint": "^7.22.0",
Expand All @@ -119,7 +119,7 @@
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "6.2.0",
"font-awesome": "^4.7.0",
"fork-ts-checker-webpack-plugin": "^6.1.0",
"fork-ts-checker-webpack-plugin": "^6.2.0",
"gulp": "^4.0.2",
"gulp-rename": "^2.0.0",
"gulp-util": "^3.0.8",
Expand Down Expand Up @@ -150,11 +150,11 @@
"standard-version": "^9.1.1",
"style-loader": "2.0.0",
"through2": "^4.0.2",
"ts-jest": "^26.5.3",
"ts-jest": "^26.5.4",
"ts-loader": "^8.0.18",
"ts-node": "^9.1.1",
"typedoc": "^0.20.32",
"uglify-js": "^3.13.1",
"typedoc": "^0.20.33",
"uglify-js": "^3.13.2",
"url-loader": "4.1.1",
"vinyl-fs": "^3.0.3",
"webpack": "^4.46.0",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/en/aurelia-slickgrid.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"LAST_UPDATE": "Last Update",
"LESS_THAN": "Less than",
"LESS_THAN_OR_EQUAL_TO": "Less than or equal to",
"NOT_CONTAINS": "Not contains",
"NOT_EQUAL_TO": "Not equal to",
"NOT_IN_COLLECTION_SEPERATED_BY_COMMA": "Search items not in a collection, must be separated by a comma (a,b)",
"OF": "of",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/fr/aurelia-slickgrid.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"LAST_UPDATE": "Dernière mise à jour",
"LESS_THAN": "Plus petit que",
"LESS_THAN_OR_EQUAL_TO": "Plus petit ou égal à",
"NOT_CONTAINS": "Ne contient pas",
"NOT_EQUAL_TO": "Non égal à",
"NOT_IN_COLLECTION_SEPERATED_BY_COMMA": "Recherche excluant certain éléments d'une collection, doit être séparé par une virgule (a,b)",
"OF": "de",
Expand Down
1 change: 1 addition & 0 deletions src/aurelia-slickgrid/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class Constants {
TEXT_LAST_UPDATE: 'Last Update',
TEXT_LESS_THAN: 'Less than',
TEXT_LESS_THAN_OR_EQUAL_TO: 'Less than or equal to',
TEXT_NOT_CONTAINS: 'Not contains',
TEXT_NOT_EQUAL_TO: 'Not equal to',
TEXT_PAGE: 'Page',
TEXT_REFRESH_DATASET: 'Refresh Dataset',
Expand Down
44 changes: 22 additions & 22 deletions src/aurelia-slickgrid/custom-elements/aurelia-slickgrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ declare const Slick: SlickNamespace;
)
export class AureliaSlickgridCustomElement {
private _columnDefinitions: Column[] = [];
private _dataset: any[] | null;
private _eventHandler: SlickEventHandler;
private _dataset: any[] | null = null;
private _eventHandler!: SlickEventHandler;
private _hideHeaderRowAfterPageLoad = false;
private _isGridInitialized = false;
private _isDatasetInitialized = false;
Expand All @@ -121,14 +121,14 @@ export class AureliaSlickgridCustomElement {
private _registeredResources: ExternalResource[] = [];
groupItemMetadataProvider: any;
backendServiceApi: BackendServiceApi | undefined;
customFooterOptions: CustomFooterOption;
locales: Locale;
metrics: Metrics;
customFooterOptions?: CustomFooterOption;
locales!: Locale;
metrics?: Metrics;
showCustomFooter = false;
showPagination = false;
serviceList: any[] = [];
subscriptions: Subscription[] = [];
paginationData: {
paginationData?: {
gridOptions: GridOption;
paginationService: PaginationService;
};
Expand All @@ -151,18 +151,18 @@ export class AureliaSlickgridCustomElement {
treeDataService: TreeDataService;

@bindable({ defaultBindingMode: bindingMode.twoWay }) columnDefinitions: Column[] = [];
@bindable({ defaultBindingMode: bindingMode.twoWay }) element: Element;
@bindable({ defaultBindingMode: bindingMode.twoWay }) dataview: SlickDataView;
@bindable({ defaultBindingMode: bindingMode.twoWay }) grid: SlickGrid;
@bindable({ defaultBindingMode: bindingMode.twoWay }) element!: Element;
@bindable({ defaultBindingMode: bindingMode.twoWay }) dataview!: SlickDataView;
@bindable({ defaultBindingMode: bindingMode.twoWay }) grid!: SlickGrid;
@bindable({ defaultBindingMode: bindingMode.twoWay }) paginationOptions: Pagination | undefined;
@bindable({ defaultBindingMode: bindingMode.twoWay }) totalItems: number;
@bindable({ defaultBindingMode: bindingMode.fromView }) extensions: ExtensionList<any, any>;
@bindable({ defaultBindingMode: bindingMode.fromView }) instances: AureliaGridInstance | null;
@bindable() customDataView: SlickDataView;
@bindable({ defaultBindingMode: bindingMode.twoWay }) totalItems = 0;
@bindable({ defaultBindingMode: bindingMode.fromView }) extensions!: ExtensionList<any, any>;
@bindable({ defaultBindingMode: bindingMode.fromView }) instances: AureliaGridInstance | null = null;
@bindable() customDataView?: SlickDataView;
@bindable() dataset: any[] = [];
@bindable() datasetHierarchical: any[] | null;
@bindable() gridId: string;
@bindable() gridOptions: GridOption;
@bindable() datasetHierarchical?: any[] | null;
@bindable() gridId = '';
@bindable() gridOptions!: GridOption;

constructor(
private readonly aureliaUtilService: AureliaUtilService,
Expand Down Expand Up @@ -573,15 +573,15 @@ export class AureliaSlickgridCustomElement {

if (this.backendServiceApi) {
for (const prop of Object.keys(this.backendServiceApi)) {
this.backendServiceApi[prop] = null;
(this.backendServiceApi as any)[prop] = null;
}
this.backendServiceApi = undefined;
}
for (const prop of Object.keys(this.columnDefinitions)) {
this.columnDefinitions[prop] = null;
(this.columnDefinitions as any)[prop] = null;
}
for (const prop of Object.keys(this.sharedService)) {
this.sharedService[prop] = null;
(this.sharedService as any)[prop] = null;
}
this._dataset = null;
this.datasetHierarchical = null;
Expand Down Expand Up @@ -759,7 +759,7 @@ export class AureliaSlickgridCustomElement {
// expose all Slick Grid Events through dispatch
for (const prop in grid) {
if (grid.hasOwnProperty(prop) && prop.startsWith('on')) {
const gridEventHandler = grid[prop];
const gridEventHandler = (grid as any)[prop];
(this._eventHandler as SlickEventHandler<GetSlickEventType<typeof gridEventHandler>>).subscribe(gridEventHandler, (event, args) => {
const eventPrefix = this.gridOptions?.defaultSlickgridEventPrefix ?? '';
return this.pubSubService.dispatchCustomEvent(this.elm, prop, { eventData: event, args }, eventPrefix);
Expand All @@ -770,7 +770,7 @@ export class AureliaSlickgridCustomElement {
// expose all Slick DataView Events through dispatch
for (const prop in dataView) {
if (dataView.hasOwnProperty(prop) && prop.startsWith('on')) {
const dataViewEventHandler = dataView[prop];
const dataViewEventHandler = (dataView as any)[prop];
(this._eventHandler as SlickEventHandler<GetSlickEventType<typeof dataViewEventHandler>>).subscribe(dataViewEventHandler, (event, args) => {
const eventPrefix = this.gridOptions?.defaultSlickgridEventPrefix ?? '';
return this.pubSubService.dispatchCustomEvent(this.elm, prop, { eventData: event, args }, eventPrefix);
Expand Down Expand Up @@ -1340,7 +1340,7 @@ export class AureliaSlickgridCustomElement {
for (const propName of Object.keys(customFooterOptions.metricTexts)) {
if (propName.lastIndexOf('Key') > 0) {
const propNameWithoutKey = propName.substring(0, propName.lastIndexOf('Key'));
customFooterOptions.metricTexts[propNameWithoutKey] = this.translaterService.translate(customFooterOptions.metricTexts[propName] || ' ');
(customFooterOptions.metricTexts as any)[propNameWithoutKey] = this.translaterService.translate((customFooterOptions.metricTexts as any)[propName] || ' ');
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/aurelia-slickgrid/custom-elements/slick-pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { TranslaterService } from '../services/translater.service';
@inject(EventAggregator, Optional.of(TranslaterService))
export class SlickPaginationCustomElement {
// we need to pass this service as a binding because it's transient and it must be created (then passed through the binding) in the Aurelia-Slickgrid custom element
@bindable() paginationService: PaginationService;
@bindable() gridOptions: GridOption;
@bindable() paginationService!: PaginationService;
@bindable() gridOptions!: GridOption;

private _enableTranslate = false;
private _locales: Locale;
private _gridOptions: GridOption;
private _locales!: Locale;
private _gridOptions!: GridOption;
private _subscriptions: Subscription[] = [];

// text translations (handled by i18n or by custom locale)
Expand Down
8 changes: 4 additions & 4 deletions src/aurelia-slickgrid/extensions/rowDetailViewExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ export interface CreatedView extends AureliaViewOutput {
SharedService,
)
export class RowDetailViewExtension implements UniversalRowDetailViewExtension {
private _addon: SlickRowDetailView | null;
private _addon: SlickRowDetailView | null = null;
private _eventHandler: SlickEventHandler;
private _preloadView: string;
private _preloadView = '';
private _slots: CreatedView[] = [];
private _viewModel: string;
private _viewModel = '';
private _subscriptions: Subscription[] = [];
private _userProcessFn: (item: any) => Promise<any>;
private _userProcessFn?: (item: any) => Promise<any>;

constructor(
private readonly aureliaUtilService: AureliaUtilService,
Expand Down
4 changes: 2 additions & 2 deletions src/aurelia-slickgrid/services/resizer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const DATAGRID_PAGINATION_HEIGHT = 35;
@singleton(true)
@inject(PubSubService)
export class ResizerService {
private _grid: SlickGrid;
private _addon: SlickResizer;
private _grid!: SlickGrid;
private _addon!: SlickResizer;
private _eventHandler: SlickEventHandler;

get eventHandler(): SlickEventHandler {
Expand Down
1 change: 1 addition & 0 deletions src/aurelia-slickgrid/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"forceConsistentCasingInFileNames": true,
"experimentalDecorators": true,
"noEmitHelpers": false,
"strict": true,
"stripInternal": true,
"sourceMap": true
},
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"allowJs": true,
"baseUrl": "src",
"skipLibCheck": true,
"strict": true,
"lib": [
"es2017",
"dom"
Expand Down
Loading

0 comments on commit 483c4ba

Please sign in to comment.