Skip to content

Commit

Permalink
fix(build): add ESLint-TS rules to enforce type imports and exports (
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Mar 22, 2024
1 parent 7bcabae commit 324c4fe
Show file tree
Hide file tree
Showing 26 changed files with 40 additions and 43 deletions.
2 changes: 1 addition & 1 deletion examples/vite-demo-vanilla-bundle/src/app-routing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RouterConfig } from './interfaces';
import type { RouterConfig } from './interfaces';

import Icons from './examples/icons';
import Example01 from './examples/example01';
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-demo-vanilla-bundle/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AppRouting } from './app-routing';
import { Renderer } from './renderer';
import { ElementEventListener, RouterConfig } from './interfaces';
import type { ElementEventListener, RouterConfig } from './interfaces';
const pageLayoutGlobs = import.meta.glob('./examples/**/*.html', { query: '?raw', eager: true, import: 'default' });

export class App {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Column, ExtensionName, FieldType, Formatters, type GridOption } from '@slickgrid-universal/common';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { ExampleGridOptions } from './example-grid-options';
// import '@slickgrid-universal/common/dist/styles/sass/slickgrid-theme-salesforce.scss?inline';
// import cssCode from '@slickgrid-universal/common/dist/styles/sass/slickgrid-theme-salesforce.scss?url';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { BindingEventService } from '@slickgrid-universal/binding';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { TextExportService } from '@slickgrid-universal/text-export';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import './example02.scss';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { BindingEventService } from '@slickgrid-universal/binding';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { TextExportService } from '@slickgrid-universal/text-export';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import './example03.scss?inline';
Expand Down
4 changes: 2 additions & 2 deletions examples/vite-demo-vanilla-bundle/src/examples/example04.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
AutocompleterOption,
type AutocompleterOption,
type Column,
type ColumnEditorDualInput,
type EditCommand,
Expand All @@ -15,7 +15,7 @@ import {
} from '@slickgrid-universal/common';
import { BindingEventService } from '@slickgrid-universal/binding';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import fetchJsonp from 'fetch-jsonp';
// import { fetch } from 'whatwg-fetch';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '@slickgrid-universal/common';
import { BindingEventService } from '@slickgrid-universal/binding';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import './example05.scss';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '@slickgrid-universal/common';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { TextExportService } from '@slickgrid-universal/text-export';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import './example06.scss';
import { ExampleGridOptions } from './example-grid-options';
Expand Down
4 changes: 2 additions & 2 deletions examples/vite-demo-vanilla-bundle/src/examples/example07.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {
} from '@slickgrid-universal/common';
import { BindingEventService } from '@slickgrid-universal/binding';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import DOMPurify from 'isomorphic-dompurify';

import { ExampleGridOptions } from './example-grid-options';
import { TranslateService } from '../translate.service';
import type { TranslateService } from '../translate.service';
import './example07.scss';
import '../material-styles.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '@slickgrid-universal/common';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { TextExportService } from '@slickgrid-universal/text-export';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import './example08.scss';
Expand Down
4 changes: 2 additions & 2 deletions examples/vite-demo-vanilla-bundle/src/examples/example09.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BindingEventService } from '@slickgrid-universal/binding';
import { type Column, FieldType, Filters, type GridOption, type GridStateChange, type Metrics, OperatorType, } from '@slickgrid-universal/common';
import { GridOdataService, OdataServiceApi, type OdataOption } from '@slickgrid-universal/odata';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { GridOdataService, type OdataServiceApi, type OdataOption } from '@slickgrid-universal/odata';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { ExampleGridOptions } from './example-grid-options';
import Data from './data/customers_100.json';
import './example09.scss';
Expand Down
6 changes: 3 additions & 3 deletions examples/vite-demo-vanilla-bundle/src/examples/example10.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import {
SortDirection,
} from '@slickgrid-universal/common';
import { BindingEventService } from '@slickgrid-universal/binding';
import { GraphqlService, GraphqlPaginatedResult, GraphqlServiceApi, GraphqlServiceOption, } from '@slickgrid-universal/graphql';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { GraphqlService, type GraphqlPaginatedResult, type GraphqlServiceApi, type GraphqlServiceOption, } from '@slickgrid-universal/graphql';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import moment from 'moment-mini';
import { ExampleGridOptions } from './example-grid-options';
import { TranslateService } from '../translate.service';
import type { TranslateService } from '../translate.service';
import './example10.scss';
import '../material-styles.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
type GridOption,
} from '@slickgrid-universal/common';
import { BindingEventService } from '@slickgrid-universal/binding';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import './example11-modal.scss';
Expand Down
4 changes: 2 additions & 2 deletions examples/vite-demo-vanilla-bundle/src/examples/example11.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
type AutocompleterOption,
DOMEvent,
type DOMEvent,
type Column,
type CurrentColumn,
type CurrentFilter,
Expand All @@ -24,7 +24,7 @@ import {
} from '@slickgrid-universal/common';
import { BindingEventService } from '@slickgrid-universal/binding';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import moment from 'moment-mini';

import exampleModal from './example11-modal.html?raw';
Expand Down
6 changes: 3 additions & 3 deletions examples/vite-demo-vanilla-bundle/src/examples/example12.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// import { Instance as FlatpickrInstance } from 'flatpickr/dist/types/instance';
import {
AutocompleterOption,
type AutocompleterOption,
type Column,
CompositeEditorModalType,
type CompositeEditorModalType,
type EditCommand,
Editors,
EventNamingStyle,
Expand All @@ -24,7 +24,7 @@ import {
import { BindingEventService } from '@slickgrid-universal/binding';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { type SlickerGridInstance } from '@slickgrid-universal/vanilla-bundle';
import { VanillaForceGridBundle, Slicker } from '@slickgrid-universal/vanilla-force-bundle';
import { Slicker, type VanillaForceGridBundle } from '@slickgrid-universal/vanilla-force-bundle';
import { SlickCompositeEditor, SlickCompositeEditorComponent } from '@slickgrid-universal/composite-editor-component';
import { ExampleGridOptions } from './example-grid-options';
import countriesJson from './data/countries.json?raw';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BindingEventService } from '@slickgrid-universal/binding';
import { type Column, Editors, FieldType, type GridOption } from '@slickgrid-universal/common';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import '../material-styles.scss';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from '@slickgrid-universal/common';
import { BindingEventService } from '@slickgrid-universal/binding';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import countriesJson from './data/countries.json?raw';
import { ExampleGridOptions } from './example-grid-options';
Expand Down
4 changes: 2 additions & 2 deletions examples/vite-demo-vanilla-bundle/src/examples/example15.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { type Column, Editors, FieldType, Filters, type GridOption, type GridSta
import { SlickCustomTooltip } from '@slickgrid-universal/custom-tooltip-plugin';
import { GridOdataService, type OdataServiceApi, type OdataOption } from '@slickgrid-universal/odata';
import { RxJsResource } from '@slickgrid-universal/rxjs-observable';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { delay, Observable, of, Subject } from 'rxjs';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { delay, Observable, of, type Subject } from 'rxjs';

import { ExampleGridOptions } from './example-grid-options';
import Data from './data/customers_100.json';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { BindingEventService } from '@slickgrid-universal/binding';
import { SlickCustomTooltip } from '@slickgrid-universal/custom-tooltip-plugin';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { TextExportService } from '@slickgrid-universal/text-export';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import './example16.scss';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Aggregators, type Column, Formatters, type GridOption, type Grouping, GroupTotalFormatters, SlickCellRangeSelector, SlickCellSelectionModel, SlickRowSelectionModel } from '@slickgrid-universal/common';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { ExampleGridOptions } from './example-grid-options';

// use any of the Styling Theme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
type GridOption,
GroupTotalFormatters,
} from '@slickgrid-universal/common';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { ExampleGridOptions } from './example-grid-options';
import './example18.scss';
import '../material-styles.scss';
Expand Down
10 changes: 5 additions & 5 deletions examples/vite-demo-vanilla-bundle/src/examples/example19.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Column, type GridOption, SlickEventHandler, Editors } from '@slickgrid-universal/common';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { ExampleGridOptions } from './example-grid-options';
import './example19.scss';

Expand Down Expand Up @@ -58,7 +58,7 @@ export default class Example19 {
4: 'blocked-cell',
}
};
for ( let i = 0; i < NB_ITEMS; i++) {
for (let i = 0; i < NB_ITEMS; i++) {
hash[0][i] = 'blocked-cell';
}

Expand Down Expand Up @@ -122,9 +122,9 @@ export default class Example19 {
// when using the ExcelCopyBuffer, you can see what the selection range is
enableExcelCopyBuffer: true,
excelCopyBufferOptions: {
// onCopyCells: (e, args: { ranges: SelectedRange[] }) => console.log('onCopyCells', args.ranges),
// onPasteCells: (e, args: { ranges: SelectedRange[] }) => console.log('onPasteCells', args.ranges),
// onCopyCancelled: (e, args: { ranges: SelectedRange[] }) => console.log('onCopyCancelled', args.ranges),
// onCopyCells: (e, args: { ranges: SelectedRange[] }) => console.log('onCopyCells', args.ranges),
// onPasteCells: (e, args: { ranges: SelectedRange[] }) => console.log('onPasteCells', args.ranges),
// onCopyCancelled: (e, args: { ranges: SelectedRange[] }) => console.log('onCopyCancelled', args.ranges),
onBeforePasteCell: (_e, args) => {
// deny the whole first row and the cells C-E of the second row
return !(args.row === 0 || (args.row === 1 && args.cell > 2 && args.cell < 6));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Column, FieldType, Filters, Formatters, type GridOption, SlickEventHandler, } from '@slickgrid-universal/common';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { ExampleGridOptions } from './example-grid-options';

const NB_ITEMS = 100;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BindingEventService } from '@slickgrid-universal/binding';
import { type Column, createDomElement, FieldType, Filters, Formatters, type GridOption, SlickEventHandler, Editors } from '@slickgrid-universal/common';
import { SlickRowDetailView } from '@slickgrid-universal/row-detail-view-plugin';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import './example21.scss';
Expand Down
7 changes: 2 additions & 5 deletions examples/vite-demo-vanilla-bundle/src/examples/example22.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ import {
type GridOption,
Editors,
} from '@slickgrid-universal/common';
import {
Slicker,
SlickVanillaGridBundle,
} from '@slickgrid-universal/vanilla-bundle';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { ExampleGridOptions } from './example-grid-options';

import './example22.scss';
import { TranslateService } from '../translate.service';
import type { TranslateService } from '../translate.service';

const NB_ITEMS = 20;

Expand Down
2 changes: 1 addition & 1 deletion examples/vite-demo-vanilla-bundle/src/translate.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getDescendantProperty, PubSubService, TranslaterService, TranslateServiceEventName } from '@slickgrid-universal/common';
import { getDescendantProperty, type PubSubService, type TranslaterService, type TranslateServiceEventName } from '@slickgrid-universal/common';
import { fetch } from 'whatwg-fetch/fetch';

interface Locales {
Expand Down

0 comments on commit 324c4fe

Please sign in to comment.