Skip to content

Commit

Permalink
chore: add .js extension to all imports and enable Biome rule (#306)
Browse files Browse the repository at this point in the history
* chore: add `.js` extension to all imports and enable Biome rule
  • Loading branch information
ghiscoding authored Oct 12, 2024
1 parent f308f73 commit f7e601a
Show file tree
Hide file tree
Showing 25 changed files with 149 additions and 146 deletions.
3 changes: 3 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
"noStaticOnlyClass": "off",
"noUselessSwitchCase": "off"
},
"correctness": {
"useImportExtensions": "error"
},
"performance": {
"noDelete": "off"
},
Expand Down
140 changes: 70 additions & 70 deletions packages/demo/src/app-routing.ts
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
import Events from './events/events';
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 GettingStarted from './getting-started';
import I18n from './i18n/i18n';
import Methods01 from './methods/methods01';
import Methods02 from './methods/methods02';
import Methods03 from './methods/methods03';
import Methods04 from './methods/methods04';
import Methods05 from './methods/methods05';
import Methods06 from './methods/methods06';
import Methods07 from './methods/methods07';
import Methods08 from './methods/methods08';
import Methods09 from './methods/methods09';
import Methods10 from './methods/methods10';
import Methods11 from './methods/methods11';
import Methods12 from './methods/methods12';
import Options01 from './options/options01';
import Options02 from './options/options02';
import Options03 from './options/options03';
import Options04 from './options/options04';
import Options05 from './options/options05';
import Options06 from './options/options06';
import Options07 from './options/options07';
import Options08 from './options/options08';
import Options09 from './options/options09';
import Options10 from './options/options10';
import Options11 from './options/options11';
import Options12 from './options/options12';
import Options13 from './options/options13';
import Options14 from './options/options14';
import Options15 from './options/options15';
import Options16 from './options/options16';
import Options17 from './options/options17';
import Options18 from './options/options18';
import Options19 from './options/options19';
import Options20 from './options/options20';
import Options21 from './options/options21';
import Options22 from './options/options22';
import Options23 from './options/options23';
import Options24 from './options/options24';
import Options25 from './options/options25';
import Options26 from './options/options26';
import Options27 from './options/options27';
import Options28 from './options/options28';
import Options29 from './options/options29';
import Options30 from './options/options30';
import Options31 from './options/options31';
import Options32 from './options/options32';
import Options33 from './options/options33';
import Options34 from './options/options34';
import Options35 from './options/options35';
import Options36 from './options/options36';
import Options37 from './options/options37';
import Options38 from './options/options38';
import Options39 from './options/options39';
import Events from './events/events.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 GettingStarted from './getting-started.js';
import I18n from './i18n/i18n.js';
import Methods01 from './methods/methods01.js';
import Methods02 from './methods/methods02.js';
import Methods03 from './methods/methods03.js';
import Methods04 from './methods/methods04.js';
import Methods05 from './methods/methods05.js';
import Methods06 from './methods/methods06.js';
import Methods07 from './methods/methods07.js';
import Methods08 from './methods/methods08.js';
import Methods09 from './methods/methods09.js';
import Methods10 from './methods/methods10.js';
import Methods11 from './methods/methods11.js';
import Methods12 from './methods/methods12.js';
import Options01 from './options/options01.js';
import Options02 from './options/options02.js';
import Options03 from './options/options03.js';
import Options04 from './options/options04.js';
import Options05 from './options/options05.js';
import Options06 from './options/options06.js';
import Options07 from './options/options07.js';
import Options08 from './options/options08.js';
import Options09 from './options/options09.js';
import Options10 from './options/options10.js';
import Options11 from './options/options11.js';
import Options12 from './options/options12.js';
import Options13 from './options/options13.js';
import Options14 from './options/options14.js';
import Options15 from './options/options15.js';
import Options16 from './options/options16.js';
import Options17 from './options/options17.js';
import Options18 from './options/options18.js';
import Options19 from './options/options19.js';
import Options20 from './options/options20.js';
import Options21 from './options/options21.js';
import Options22 from './options/options22.js';
import Options23 from './options/options23.js';
import Options24 from './options/options24.js';
import Options25 from './options/options25.js';
import Options26 from './options/options26.js';
import Options27 from './options/options27.js';
import Options28 from './options/options28.js';
import Options29 from './options/options29.js';
import Options30 from './options/options30.js';
import Options31 from './options/options31.js';
import Options32 from './options/options32.js';
import Options33 from './options/options33.js';
import Options34 from './options/options34.js';
import Options35 from './options/options35.js';
import Options36 from './options/options36.js';
import Options37 from './options/options37.js';
import Options38 from './options/options38.js';
import Options39 from './options/options39.js';

export const navbarRouting = [
{ name: 'getting-started', view: '/src/getting-started.html', viewModel: GettingStarted, title: 'Getting Started' },
Expand Down
2 changes: 1 addition & 1 deletion packages/demo/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import DOMPurify from 'dompurify';
import 'font-awesome/css/font-awesome.css';
import { createDomElement, emptyElement } from 'multiple-select-vanilla';

import { exampleRouting, navbarRouting } from './app-routing';
import { exampleRouting, navbarRouting } from './app-routing.js';
import mainHtml from './main.html?raw';
import './style.scss';

Expand Down
18 changes: 9 additions & 9 deletions packages/multiple-select-vanilla/src/MultipleSelectInstance.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* @author zhixin wen <[email protected]>
*/
import Constants from './constants';
import type { HtmlStruct, OptGroupRowData, OptionDataObject, OptionRowData } from './models/interfaces';
import type { MultipleSelectLocales } from './models/locale.interface';
import type { CloseReason, MultipleSelectOption } from './models/multipleSelectOption.interface';
import { BindingEventService } from './services/binding-event.service';
import { VirtualScroll } from './services/virtual-scroll';
import { compareObjects, deepCopy, findByParam, removeDiacritics, removeUndefined, setDataKeys, stripScripts } from './utils/utils';
import Constants from './constants.js';
import type { HtmlStruct, OptGroupRowData, OptionDataObject, OptionRowData } from './models/interfaces.js';
import type { MultipleSelectLocales } from './models/locale.interface.js';
import type { CloseReason, MultipleSelectOption } from './models/multipleSelectOption.interface.js';
import { BindingEventService } from './services/binding-event.service.js';
import { VirtualScroll } from './services/virtual-scroll.js';
import { compareObjects, deepCopy, findByParam, removeDiacritics, removeUndefined, setDataKeys, stripScripts } from './utils/utils.js';
import {
calculateAvailableSpace,
classNameToList,
Expand All @@ -19,8 +19,8 @@ import {
getElementSize,
insertAfter,
toggleElement,
} from './utils/domUtils';
import type { HtmlElementPosition } from './utils/domUtils';
} from './utils/domUtils.js';
import type { HtmlElementPosition } from './utils/domUtils.js';

const OPTIONS_LIST_SELECTOR = '.ms-select-all, ul li[data-key]';
const OPTIONS_HIGHLIGHT_LIST_SELECTOR = '.ms-select-all.highlighted, ul li[data-key].highlighted';
Expand Down
6 changes: 3 additions & 3 deletions packages/multiple-select-vanilla/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { LabelFilter, TextFilter } from './models/interfaces';
import type { MultipleSelectOption } from './models/multipleSelectOption.interface';
import English from './locales/multiple-select-en-US';
import type { LabelFilter, TextFilter } from './models/interfaces.js';
import type { MultipleSelectOption } from './models/multipleSelectOption.interface.js';
import English from './locales/multiple-select-en-US.js';

const BLOCK_ROWS = 50;
const CLUSTER_BLOCKS = 4;
Expand Down
18 changes: 9 additions & 9 deletions packages/multiple-select-vanilla/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export type * from './models/interfaces';
export type * from './models/locale.interface';
export type * from './models/multipleSelectOption.interface';
export { BindingEventService, type ElementEventListener } from './services/binding-event.service';
export { VirtualScroll } from './services/virtual-scroll';
export type * from './models/interfaces.js';
export type * from './models/locale.interface.js';
export type * from './models/multipleSelectOption.interface.js';
export { BindingEventService, type ElementEventListener } from './services/binding-event.service.js';
export { VirtualScroll } from './services/virtual-scroll.js';
export {
type HtmlElementPosition,
calculateAvailableSpace,
Expand All @@ -19,7 +19,7 @@ export {
toggleElement,
toggleElementClass,
windowScrollPosition,
} from './utils/domUtils';
} from './utils/domUtils.js';
export {
compareObjects,
deepCopy,
Expand All @@ -31,6 +31,6 @@ export {
setDataKeys,
stripScripts,
toCamelCase,
} from './utils/utils';
export { multipleSelect } from './multiple-select';
export { MultipleSelectInstance } from './MultipleSelectInstance';
} from './utils/utils.js';
export { multipleSelect } from './multiple-select.js';
export { MultipleSelectInstance } from './MultipleSelectInstance.js';
28 changes: 14 additions & 14 deletions packages/multiple-select-vanilla/src/locales/all-locales-index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export * from './multiple-select-cz-CS';
export * from './multiple-select-da-DK';
export * from './multiple-select-de-DE';
export * from './multiple-select-en-US';
export * from './multiple-select-es-ES';
export * from './multiple-select-fr-FR';
export * from './multiple-select-hu-HU';
export * from './multiple-select-it-IT';
export * from './multiple-select-ja-JP';
export * from './multiple-select-pt-BR';
export * from './multiple-select-ru-RU';
export * from './multiple-select-vi-VN';
export * from './multiple-select-zh-CN';
export * from './multiple-select-zh-TW';
export * from './multiple-select-cz-CS.js';
export * from './multiple-select-da-DK.js';
export * from './multiple-select-de-DE.js';
export * from './multiple-select-en-US.js';
export * from './multiple-select-es-ES.js';
export * from './multiple-select-fr-FR.js';
export * from './multiple-select-hu-HU.js';
export * from './multiple-select-it-IT.js';
export * from './multiple-select-ja-JP.js';
export * from './multiple-select-pt-BR.js';
export * from './multiple-select-ru-RU.js';
export * from './multiple-select-vi-VN.js';
export * from './multiple-select-zh-CN.js';
export * from './multiple-select-zh-TW.js';
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: Matej Puhony<[email protected]>
*/

import type { MultipleSelectInstance } from '../MultipleSelectInstance';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface';
import type { MultipleSelectInstance } from '../MultipleSelectInstance.js';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface.js';

const ms =
typeof window !== 'undefined' && window.multipleSelect !== undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: HThuren<[email protected]>
*/

import type { MultipleSelectInstance } from '../MultipleSelectInstance';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface';
import type { MultipleSelectInstance } from '../MultipleSelectInstance.js';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface.js';

const ms =
typeof window !== 'undefined' && window.multipleSelect !== undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: Bugi Goertz
*/

import type { MultipleSelectInstance } from '../MultipleSelectInstance';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface';
import type { MultipleSelectInstance } from '../MultipleSelectInstance.js';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface.js';

const ms =
typeof window !== 'undefined' && window.multipleSelect !== undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: Zhixin Wen<[email protected]>
*/

import type { MultipleSelectInstance } from '../MultipleSelectInstance';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface';
import type { MultipleSelectInstance } from '../MultipleSelectInstance.js';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface.js';

const ms =
typeof window !== 'undefined' && window.multipleSelect !== undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: Zhixin Wen<[email protected]>
*/

import type { MultipleSelectInstance } from '../MultipleSelectInstance';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface';
import type { MultipleSelectInstance } from '../MultipleSelectInstance.js';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface.js';

const ms =
typeof window !== 'undefined' && window.multipleSelect !== undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: Francis Perron <[email protected]>
*/

import type { MultipleSelectInstance } from '../MultipleSelectInstance';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface';
import type { MultipleSelectInstance } from '../MultipleSelectInstance.js';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface.js';

const ms =
typeof window !== 'undefined' && window.multipleSelect !== undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: Péter Báthory<[email protected]>
*/

import type { MultipleSelectInstance } from '../MultipleSelectInstance';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface';
import type { MultipleSelectInstance } from '../MultipleSelectInstance.js';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface.js';

const ms =
typeof window !== 'undefined' && window.multipleSelect !== undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: Giuseppe Lodi Rizzini
*/

import type { MultipleSelectInstance } from '../MultipleSelectInstance';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface';
import type { MultipleSelectInstance } from '../MultipleSelectInstance.js';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface.js';

const ms =
typeof window !== 'undefined' && window.multipleSelect !== undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: Nozomi Anzai<[email protected]>
*/

import type { MultipleSelectInstance } from '../MultipleSelectInstance';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface';
import type { MultipleSelectInstance } from '../MultipleSelectInstance.js';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface.js';

const ms =
typeof window !== 'undefined' && window.multipleSelect !== undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: Lucas Aguiar<[email protected]>
*/

import type { MultipleSelectInstance } from '../MultipleSelectInstance';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface';
import type { MultipleSelectInstance } from '../MultipleSelectInstance.js';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface.js';

const ms =
typeof window !== 'undefined' && window.multipleSelect !== undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: Zhixin Wen<[email protected]>
*/

import type { MultipleSelectInstance } from '../MultipleSelectInstance';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface';
import type { MultipleSelectInstance } from '../MultipleSelectInstance.js';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface.js';

const ms =
typeof window !== 'undefined' && window.multipleSelect !== undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Author: hoangbaovu <ineo.vn>
*/

import type { MultipleSelectInstance } from '../MultipleSelectInstance';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface';
import type { MultipleSelectInstance } from '../MultipleSelectInstance.js';
import type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface.js';

const ms =
typeof window !== 'undefined' && window.multipleSelect !== undefined
Expand Down
Loading

0 comments on commit f7e601a

Please sign in to comment.