Skip to content

Commit

Permalink
Merge pull request #1714 from ghiscoding/chore/import-file-extensions
Browse files Browse the repository at this point in the history
chore: add `.js` file extensions to all imports
  • Loading branch information
ghiscoding authored Oct 12, 2024
2 parents 59a2a18 + 2231da7 commit a0a595e
Show file tree
Hide file tree
Showing 580 changed files with 2,126 additions and 2,089 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"typescript"
],
"typescript.format.semicolons": "insert",
"vitest.rootConfig": "./test/vitest.config.mts"
"vitest.rootConfig": "./test/vitest.config.mts",
"typescript.tsdk": "node_modules\\typescript\\lib"
}
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export default tseslint.config(
'cypress/no-assigning-return-values': 'off',
'cypress/unsafe-to-chain-command': 'off',
'object-shorthand': 'error',
'n/file-extension-in-import': ['error', 'always', { ".cy.ts": "never" }],
'no-async-promise-executor': 'off',
'no-case-declarations': 'off',
'no-prototype-builtins': 'off',
Expand Down
64 changes: 32 additions & 32 deletions examples/vite-demo-vanilla-bundle/src/app-routing.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import type { RouterConfig } from './interfaces';
import type { RouterConfig } from './interfaces.js';

import Icons from './examples/icons';
import Example01 from './examples/example01';
import Example02 from './examples/example02';
import Example03 from './examples/example03';
import Example04 from './examples/example04';
import Example05 from './examples/example05';
import Example06 from './examples/example06';
import Example07 from './examples/example07';
import Example08 from './examples/example08';
import Example09 from './examples/example09';
import Example10 from './examples/example10';
import Example11 from './examples/example11';
import Example12 from './examples/example12';
import Example13 from './examples/example13';
import Example14 from './examples/example14';
import Example15 from './examples/example15';
import Example16 from './examples/example16';
import Example17 from './examples/example17';
import Example18 from './examples/example18';
import Example19 from './examples/example19';
import Example20 from './examples/example20';
import Example21 from './examples/example21';
import Example22 from './examples/example22';
import Example23 from './examples/example23';
import Example24 from './examples/example24';
import Example25 from './examples/example25';
import Example26 from './examples/example26';
import Example27 from './examples/example27';
import Example28 from './examples/example28';
import Example29 from './examples/example29';
import Example30 from './examples/example30';
import Icons from './examples/icons.js';
import Example01 from './examples/example01.js';
import Example02 from './examples/example02.js';
import Example03 from './examples/example03.js';
import Example04 from './examples/example04.js';
import Example05 from './examples/example05.js';
import Example06 from './examples/example06.js';
import Example07 from './examples/example07.js';
import Example08 from './examples/example08.js';
import Example09 from './examples/example09.js';
import Example10 from './examples/example10.js';
import Example11 from './examples/example11.js';
import Example12 from './examples/example12.js';
import Example13 from './examples/example13.js';
import Example14 from './examples/example14.js';
import Example15 from './examples/example15.js';
import Example16 from './examples/example16.js';
import Example17 from './examples/example17.js';
import Example18 from './examples/example18.js';
import Example19 from './examples/example19.js';
import Example20 from './examples/example20.js';
import Example21 from './examples/example21.js';
import Example22 from './examples/example22.js';
import Example23 from './examples/example23.js';
import Example24 from './examples/example24.js';
import Example25 from './examples/example25.js';
import Example26 from './examples/example26.js';
import Example27 from './examples/example27.js';
import Example28 from './examples/example28.js';
import Example29 from './examples/example29.js';
import Example30 from './examples/example30.js';

export class AppRouting {
constructor(private config: RouterConfig) {
Expand Down
6 changes: 3 additions & 3 deletions 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 type { ElementEventListener, RouterConfig } from './interfaces';
import { AppRouting } from './app-routing.js';
import { Renderer } from './renderer.js';
import type { ElementEventListener, RouterConfig } from './interfaces.js';
const pageLayoutGlobs = import.meta.glob('./examples/**/*.html', { query: '?raw', eager: true, import: 'default' });

export class App {
Expand Down
3 changes: 2 additions & 1 deletion examples/vite-demo-vanilla-bundle/src/examples/example01.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { type Column, ExtensionName, FieldType, Formatters, type GridOption } from '@slickgrid-universal/common';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { ExampleGridOptions } from './example-grid-options';

import { ExampleGridOptions } from './example-grid-options.js';
// 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 @@ -18,7 +18,7 @@ import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { TextExportService } from '@slickgrid-universal/text-export';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import '../material-styles.scss';

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

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';

interface ReportItem {
title: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanil
import fetchJsonp from 'fetch-jsonp';
// import { fetch } from 'whatwg-fetch';

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import './example04.scss';

// const URL_COUNTRIES_COLLECTION = 'assets/data/countries.json';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { BindingEventService } from '@slickgrid-universal/binding';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import './example05.scss';

const NB_ITEMS = 500;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { TextExportService } from '@slickgrid-universal/text-export';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import './example06.scss';
import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';

export default class Example06 {
columnDefinitions: Column[];
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 @@ -12,8 +12,8 @@ import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import DOMPurify from 'dompurify';

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

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

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import './example08.scss';

export default class Example08 {
Expand Down
3 changes: 2 additions & 1 deletion examples/vite-demo-vanilla-bundle/src/examples/example09.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { BindingEventService } from '@slickgrid-universal/binding';
import { type Column, FieldType, Filters, type GridOption, type GridStateChange, type Metrics, OperatorType, type GridState, } from '@slickgrid-universal/common';
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 { ExampleGridOptions } from './example-grid-options.js';
import Data from './data/customers_100.json';
import './example09.scss';

Expand Down
4 changes: 2 additions & 2 deletions examples/vite-demo-vanilla-bundle/src/examples/example10.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanil
import { addDay, format as tempoFormat } from '@formkit/tempo';
import { type MultipleSelectOption } from 'multiple-select-vanilla';

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

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

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import './example11-modal.scss';

export default class Example11Modal {
Expand Down
6 changes: 3 additions & 3 deletions examples/vite-demo-vanilla-bundle/src/examples/example11.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ import { format as tempoFormat, addDay } from '@formkit/tempo';
import { type MultipleSelectOption } from 'multiple-select-vanilla';

import exampleModal from './example11-modal.html?raw';
import Example11Modal from './example11-modal';
import Example11Modal from './example11-modal.js';
import countriesJson from './data/countries.json?raw';
import { ExampleGridOptions } from './example-grid-options';
import { loadComponent } from './utilities';
import { ExampleGridOptions } from './example-grid-options.js';
import { loadComponent } from './utilities.js';
import './example11.scss';

const LOCAL_STORAGE_KEY = 'gridViewPreset';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Slicker, type VanillaForceGridBundle } from '@slickgrid-universal/vanil
import { SlickCompositeEditor, SlickCompositeEditorComponent } from '@slickgrid-universal/composite-editor-component';
import { type MultipleSelectOption } from 'multiple-select-vanilla';

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import countriesJson from './data/countries.json?raw';
import './example12.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type Column, Editors, FieldType, type GridOption } from '@slickgrid-uni
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import '../material-styles.scss';
import './example13.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { SlickCustomTooltip } from '@slickgrid-universal/custom-tooltip-plugin';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import countriesJson from './data/countries.json?raw';
import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import './example14.scss';

const NB_ITEMS = 400;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { RxJsResource } from '@slickgrid-universal/rxjs-observable';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { delay, Observable, of, type Subject } from 'rxjs';

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import Data from './data/customers_100.json';
import './example15.scss';

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

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import './example16.scss';

export default class Example16 {
Expand Down
3 changes: 2 additions & 1 deletion examples/vite-demo-vanilla-bundle/src/examples/example17.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Aggregators, type Column, Formatters, type GridOption, type Grouping, GroupTotalFormatters, SlickCellRangeSelector, SlickCellSelectionModel, SlickRowSelectionModel } from '@slickgrid-universal/common';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { ExampleGridOptions } from './example-grid-options';

import { ExampleGridOptions } from './example-grid-options.js';

// use any of the Styling Theme
// import '../material-styles.scss';
Expand Down
3 changes: 2 additions & 1 deletion examples/vite-demo-vanilla-bundle/src/examples/example18.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
GroupTotalFormatters,
} from '@slickgrid-universal/common';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { ExampleGridOptions } from './example-grid-options';

import { ExampleGridOptions } from './example-grid-options.js';
import './example18.scss';
import '../material-styles.scss';

Expand Down
7 changes: 4 additions & 3 deletions examples/vite-demo-vanilla-bundle/src/examples/example19.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { type Column, type GridOption, SlickEventHandler, Editors, Formatters } from '@slickgrid-universal/common';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { ExampleGridOptions } from './example-grid-options';

import { ExampleGridOptions } from './example-grid-options.js';
import './example19.scss';

const NB_ITEMS = 100;
Expand Down Expand Up @@ -89,7 +90,7 @@ export default class Example19 {
field: 'approvalDate',
minWidth: 120,
width: 120,
editor: { model: Editors.date, type: 'date'},
editor: { model: Editors.date, type: 'date' },
formatter: Formatters.dateIso,
exportWithFormatter: true
});
Expand Down Expand Up @@ -149,7 +150,7 @@ export default class Example19 {
getData(itemCount: number) {
// mock a dataset
const datasetTmp: any[] = [];
const start = new Date(2000,0,1);
const start = new Date(2000, 0, 1);
const end = new Date();
for (let i = 0; i < itemCount; i++) {
const d: any = (datasetTmp[i] = {});
Expand Down
3 changes: 2 additions & 1 deletion examples/vite-demo-vanilla-bundle/src/examples/example20.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { type Column, FieldType, Filters, Formatters, type GridOption, SlickEventHandler, } from '@slickgrid-universal/common';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { ExampleGridOptions } from './example-grid-options';

import { ExampleGridOptions } from './example-grid-options.js';

const NB_ITEMS = 100;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type Column, createDomElement, FieldType, Filters, Formatters, type Gri
import { SlickRowDetailView } from '@slickgrid-universal/row-detail-view-plugin';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import './example21.scss';

const NB_ITEMS = 995;
Expand Down
4 changes: 2 additions & 2 deletions examples/vite-demo-vanilla-bundle/src/examples/example22.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { SlickCustomTooltip } from '@slickgrid-universal/custom-tooltip-plugin';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { BindingEventService } from '@slickgrid-universal/binding';

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import type { TranslateService } from '../translate.service.js';
import './example22.scss';
import type { TranslateService } from '../translate.service';

const NB_ITEMS = 20;

Expand Down
4 changes: 2 additions & 2 deletions examples/vite-demo-vanilla-bundle/src/examples/example23.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import {
type SlickGroupTotals,
} from '@slickgrid-universal/common';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { BindingEventService } from '@slickgrid-universal/binding';
import { ExcelExportService } from '@slickgrid-universal/excel-export';

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import './example23.scss';
import { BindingEventService } from '@slickgrid-universal/binding';

interface GroceryItem {
id: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BindingEventService } from '@slickgrid-universal/binding';
import { type Column, Editors, FieldType, type GridOption, SlickEventHandler, } from '@slickgrid-universal/common';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import './example24.scss';

const NB_ITEMS = 100;
Expand Down
4 changes: 2 additions & 2 deletions examples/vite-demo-vanilla-bundle/src/examples/example25.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
} from '@slickgrid-universal/common';
import { BindingEventService } from '@slickgrid-universal/binding';

import { ExampleGridOptions } from './example-grid-options';
import { type TranslateService } from '../translate.service';
import { ExampleGridOptions } from './example-grid-options.js';
import { type TranslateService } from '../translate.service.js';

const NB_ITEMS = 5000;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Aggregators, type Column, FieldType, Filters, type GridOption, type Gro
import { GridOdataService, type OdataServiceApi } from '@slickgrid-universal/odata';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';
import Data from './data/customers_100.json';
import './example26.scss';

Expand Down
4 changes: 2 additions & 2 deletions examples/vite-demo-vanilla-bundle/src/examples/example27.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { GraphqlService, type GraphqlPaginatedResult, type GraphqlServiceApi, }
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import { type MultipleSelectOption } from 'multiple-select-vanilla';

import { ExampleGridOptions } from './example-grid-options';
import type { TranslateService } from '../translate.service';
import { ExampleGridOptions } from './example-grid-options.js';
import type { TranslateService } from '../translate.service.js';
import CustomersData from './data/customers_100.json';
import './example27.scss';
import '../material-styles.scss';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BindingEventService } from '@slickgrid-universal/binding';
import { Aggregators, type Column, FieldType, Formatters, type GridOption, type Grouping, type OnRowCountChangedEventArgs, SortComparers, SortDirectionNumber, } from '@slickgrid-universal/common';
import { Slicker, type SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';

import { ExampleGridOptions } from './example-grid-options';
import { ExampleGridOptions } from './example-grid-options.js';

const FETCH_SIZE = 50;

Expand Down
Loading

0 comments on commit a0a595e

Please sign in to comment.