aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2023-03-29 20:49:30 +0300
committerGitHub <[email protected]>2023-03-29 13:49:30 -0400
commitae43f0c48bf7acede8a325b24197001fe2b2f416 (patch)
tree780ea3b362bff6b88eaed4f4387217264c3b3189
parent3aabfc70c38db03e77229a49f4f8c7ed58169cf7 (diff)
downloadbootstrap-ae43f0c48bf7acede8a325b24197001fe2b2f416.tar.xz
bootstrap-ae43f0c48bf7acede8a325b24197001fe2b2f416.zip
Tweak and re-organize ESLint config (#38369)
* Tweak and re-organize ESLint config * merge individual configs to the root config * enable more eslint-plugin-import rules * lint markdown files * Lint
-rw-r--r--.eslintignore3
-rw-r--r--.eslintrc.json153
-rw-r--r--build/.eslintrc.json15
-rw-r--r--build/banner.js1
-rw-r--r--js/.eslintrc.json26
-rw-r--r--js/src/alert.js4
-rw-r--r--js/src/base-component.js2
-rw-r--r--js/src/button.js4
-rw-r--r--js/src/carousel.js10
-rw-r--r--js/src/collapse.js6
-rw-r--r--js/src/dom/event-handler.js2
-rw-r--r--js/src/dropdown.js14
-rw-r--r--js/src/modal.js8
-rw-r--r--js/src/offcanvas.js12
-rw-r--r--js/src/popover.js2
-rw-r--r--js/src/scrollspy.js4
-rw-r--r--js/src/tab.js8
-rw-r--r--js/src/toast.js4
-rw-r--r--js/src/tooltip.js12
-rw-r--r--js/src/util/backdrop.js2
-rw-r--r--js/src/util/component-functions.js2
-rw-r--r--js/src/util/config.js2
-rw-r--r--js/src/util/scrollbar.js2
-rw-r--r--js/src/util/swipe.js2
-rw-r--r--js/src/util/template-factory.js4
-rw-r--r--js/tests/browsers.js3
-rw-r--r--js/tests/integration/bundle-modularity.js2
-rw-r--r--js/tests/integration/rollup.bundle-modularity.js4
-rw-r--r--js/tests/integration/rollup.bundle.js2
-rw-r--r--js/tests/karma.conf.js4
-rw-r--r--js/tests/unit/.eslintrc.json13
-rw-r--r--js/tests/unit/alert.spec.js6
-rw-r--r--js/tests/unit/base-component.spec.js8
-rw-r--r--js/tests/unit/button.spec.js4
-rw-r--r--js/tests/unit/carousel.spec.js10
-rw-r--r--js/tests/unit/collapse.spec.js6
-rw-r--r--js/tests/unit/dom/data.spec.js6
-rw-r--r--js/tests/unit/dom/event-handler.spec.js6
-rw-r--r--js/tests/unit/dom/manipulator.spec.js4
-rw-r--r--js/tests/unit/dom/selector-engine.spec.js4
-rw-r--r--js/tests/unit/dropdown.spec.js8
-rw-r--r--js/tests/unit/jquery.spec.js26
-rw-r--r--js/tests/unit/modal.spec.js8
-rw-r--r--js/tests/unit/offcanvas.spec.js10
-rw-r--r--js/tests/unit/popover.spec.js6
-rw-r--r--js/tests/unit/scrollspy.spec.js8
-rw-r--r--js/tests/unit/tab.spec.js4
-rw-r--r--js/tests/unit/toast.spec.js4
-rw-r--r--js/tests/unit/tooltip.spec.js8
-rw-r--r--js/tests/unit/util/backdrop.spec.js6
-rw-r--r--js/tests/unit/util/component-functions.spec.js8
-rw-r--r--js/tests/unit/util/config.spec.js4
-rw-r--r--js/tests/unit/util/focustrap.spec.js8
-rw-r--r--js/tests/unit/util/index.spec.js6
-rw-r--r--js/tests/unit/util/sanitizer.spec.js2
-rw-r--r--js/tests/unit/util/scrollbar.spec.js6
-rw-r--r--js/tests/unit/util/swipe.spec.js8
-rw-r--r--js/tests/unit/util/template-factory.spec.js4
-rw-r--r--js/tests/visual/.eslintrc.json19
-rw-r--r--package.json2
-rw-r--r--scss/tests/jasmine.js2
-rw-r--r--scss/tests/sass-true/register.js3
-rw-r--r--scss/tests/sass-true/runner.js4
-rw-r--r--site/.eslintrc.json55
-rw-r--r--site/content/docs/5.3/getting-started/javascript.md2
65 files changed, 311 insertions, 296 deletions
diff --git a/.eslintignore b/.eslintignore
index 04bae1541..4c5b84f35 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -3,6 +3,5 @@
**/vendor/
/_site/
/js/coverage/
-/js/tests/integration/
/site/static/sw.js
-/site/layouts/
+/site/layouts/partials/
diff --git a/.eslintrc.json b/.eslintrc.json
index 5443b97bc..6b3d61469 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -14,6 +14,35 @@
"error",
"never"
],
+ "import/extensions": [
+ "error",
+ "ignorePackages",
+ {
+ "js": "always"
+ }
+ ],
+ "import/first": "error",
+ "import/newline-after-import": "error",
+ "import/no-absolute-path": "error",
+ "import/no-amd": "error",
+ "import/no-cycle": [
+ "error",
+ {
+ "ignoreExternal": true
+ }
+ ],
+ "import/no-duplicates": "error",
+ "import/no-extraneous-dependencies": "error",
+ "import/no-mutable-exports": "error",
+ "import/no-named-as-default": "error",
+ "import/no-named-as-default-member": "error",
+ "import/no-named-default": "error",
+ "import/no-self-import": "error",
+ "import/no-unassigned-import": [
+ "error"
+ ],
+ "import/no-useless-path-segments": "error",
+ "import/order": "error",
"indent": [
"error",
2,
@@ -51,7 +80,9 @@
"error",
"never"
],
+ "strict": "error",
"unicorn/explicit-length-check": "off",
+ "unicorn/filename-case": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-array-method-this-argument": "off",
"unicorn/no-null": "off",
@@ -63,5 +94,125 @@
"unicorn/prefer-query-selector": "off",
"unicorn/prefer-spread": "off",
"unicorn/prevent-abbreviations": "off"
- }
+ },
+ "overrides": [
+ {
+ "files": [
+ "build/**"
+ ],
+ "env": {
+ "browser": false,
+ "node": true
+ },
+ "parserOptions": {
+ "sourceType": "script"
+ },
+ "rules": {
+ "no-console": "off",
+ "unicorn/prefer-top-level-await": "off"
+ }
+ },
+ {
+ "files": [
+ "js/**"
+ ],
+ "parserOptions": {
+ "sourceType": "module"
+ }
+ },
+ {
+ "files": [
+ "js/tests/*.js",
+ "js/tests/integration/rollup*.js"
+ ],
+ "env": {
+ "node": true
+ },
+ "parserOptions": {
+ "sourceType": "script"
+ }
+ },
+ {
+ "files": [
+ "js/tests/unit/**"
+ ],
+ "env": {
+ "jasmine": true
+ },
+ "rules": {
+ "no-console": "off",
+ "unicorn/consistent-function-scoping": "off",
+ "unicorn/no-useless-undefined": "off",
+ "unicorn/prefer-add-event-listener": "off"
+ }
+ },
+ {
+ "files": [
+ "js/tests/visual/**"
+ ],
+ "plugins": [
+ "html"
+ ],
+ "settings": {
+ "html/html-extensions": [
+ ".html"
+ ]
+ },
+ "rules": {
+ "no-console": "off",
+ "no-new": "off",
+ "unicorn/no-array-for-each": "off"
+ }
+ },
+ {
+ "files": [
+ "scss/tests/**"
+ ],
+ "env": {
+ "node": true
+ },
+ "parserOptions": {
+ "sourceType": "script"
+ }
+ },
+ {
+ "files": [
+ "site/**"
+ ],
+ "env": {
+ "browser": true,
+ "node": false
+ },
+ "parserOptions": {
+ "sourceType": "script",
+ "ecmaVersion": 2019
+ },
+ "rules": {
+ "no-new": "off",
+ "unicorn/no-array-for-each": "off",
+ "unicorn/numeric-separators-style": "off"
+ }
+ },
+ {
+ "files": [
+ "**/*.md"
+ ],
+ "plugins": [
+ "markdown"
+ ],
+ "processor": "markdown/markdown"
+ },
+ {
+ "files": [
+ "**/*.md/*.js"
+ ],
+ "extends": "plugin:markdown/recommended",
+ "parserOptions": {
+ "sourceType": "module"
+ },
+ "rules": {
+ "unicorn/prefer-node-protocol": "off"
+ }
+ }
+ ]
}
diff --git a/build/.eslintrc.json b/build/.eslintrc.json
deleted file mode 100644
index dec6323d0..000000000
--- a/build/.eslintrc.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "env": {
- "browser": false,
- "node": true
- },
- "parserOptions": {
- "sourceType": "script"
- },
- "extends": "../.eslintrc.json",
- "rules": {
- "no-console": "off",
- "strict": "error",
- "unicorn/prefer-top-level-await": "off"
- }
-}
diff --git a/build/banner.js b/build/banner.js
index df82ff32e..a022f1c48 100644
--- a/build/banner.js
+++ b/build/banner.js
@@ -1,6 +1,7 @@
'use strict'
const pkg = require('../package.json')
+
const year = new Date().getFullYear()
function getBanner(pluginFilename) {
diff --git a/js/.eslintrc.json b/js/.eslintrc.json
deleted file mode 100644
index 97ea9e043..000000000
--- a/js/.eslintrc.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "extends": "../.eslintrc.json",
- "env": {
- "es2022": true
- },
- "parserOptions": {
- "ecmaVersion": "latest",
- "sourceType": "module"
- },
- "overrides": [
- {
- "files": [
- "./*.js",
- "./src/**/*.js"
- ],
- "rules": {
- "import/extensions": [
- 2,
- {
- "js": "always"
- }
- ]
- }
- }
- ]
-}
diff --git a/js/src/alert.js b/js/src/alert.js
index 0c60b88d3..88232bceb 100644
--- a/js/src/alert.js
+++ b/js/src/alert.js
@@ -5,10 +5,10 @@
* --------------------------------------------------------------------------
*/
-import { defineJQueryPlugin } from './util/index.js'
-import EventHandler from './dom/event-handler.js'
import BaseComponent from './base-component.js'
+import EventHandler from './dom/event-handler.js'
import { enableDismissTrigger } from './util/component-functions.js'
+import { defineJQueryPlugin } from './util/index.js'
/**
* Constants
diff --git a/js/src/base-component.js b/js/src/base-component.js
index ee30390ae..813fc39c6 100644
--- a/js/src/base-component.js
+++ b/js/src/base-component.js
@@ -6,9 +6,9 @@
*/
import Data from './dom/data.js'
-import { executeAfterTransition, getElement } from './util/index.js'
import EventHandler from './dom/event-handler.js'
import Config from './util/config.js'
+import { executeAfterTransition, getElement } from './util/index.js'
/**
* Constants
diff --git a/js/src/button.js b/js/src/button.js
index 7b4e12804..a797f5050 100644
--- a/js/src/button.js
+++ b/js/src/button.js
@@ -5,9 +5,9 @@
* --------------------------------------------------------------------------
*/
-import { defineJQueryPlugin } from './util/index.js'
-import EventHandler from './dom/event-handler.js'
import BaseComponent from './base-component.js'
+import EventHandler from './dom/event-handler.js'
+import { defineJQueryPlugin } from './util/index.js'
/**
* Constants
diff --git a/js/src/carousel.js b/js/src/carousel.js
index 4d15d7fde..68d11a32f 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -5,6 +5,10 @@
* --------------------------------------------------------------------------
*/
+import BaseComponent from './base-component.js'
+import EventHandler from './dom/event-handler.js'
+import Manipulator from './dom/manipulator.js'
+import SelectorEngine from './dom/selector-engine.js'
import {
defineJQueryPlugin,
getNextActiveElement,
@@ -13,11 +17,7 @@ import {
reflow,
triggerTransitionEnd
} from './util/index.js'
-import EventHandler from './dom/event-handler.js'
-import Manipulator from './dom/manipulator.js'
-import SelectorEngine from './dom/selector-engine.js'
import Swipe from './util/swipe.js'
-import BaseComponent from './base-component.js'
/**
* Constants
@@ -329,7 +329,7 @@ class Carousel extends BaseComponent {
if (!activeElement || !nextElement) {
// Some weirdness is happening, so we bail
- // todo: change tests that use empty divs to avoid this check
+ // TODO: change tests that use empty divs to avoid this check
return
}
diff --git a/js/src/collapse.js b/js/src/collapse.js
index 815b415d4..9f0c60cc5 100644
--- a/js/src/collapse.js
+++ b/js/src/collapse.js
@@ -5,14 +5,14 @@
* --------------------------------------------------------------------------
*/
+import BaseComponent from './base-component.js'
+import EventHandler from './dom/event-handler.js'
+import SelectorEngine from './dom/selector-engine.js'
import {
defineJQueryPlugin,
getElement,
reflow
} from './util/index.js'
-import EventHandler from './dom/event-handler.js'
-import SelectorEngine from './dom/selector-engine.js'
-import BaseComponent from './base-component.js'
/**
* Constants
diff --git a/js/src/dom/event-handler.js b/js/src/dom/event-handler.js
index 97cf3041e..561d8751d 100644
--- a/js/src/dom/event-handler.js
+++ b/js/src/dom/event-handler.js
@@ -128,7 +128,7 @@ function findHandler(events, callable, delegationSelector = null) {
function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
const isDelegated = typeof handler === 'string'
- // todo: tooltip passes `false` instead of selector, so we need to check
+ // TODO: tooltip passes `false` instead of selector, so we need to check
const callable = isDelegated ? delegationFunction : (handler || delegationFunction)
let typeEvent = getTypeEvent(originalTypeEvent)
diff --git a/js/src/dropdown.js b/js/src/dropdown.js
index b2030f7a8..af5fd16fc 100644
--- a/js/src/dropdown.js
+++ b/js/src/dropdown.js
@@ -6,6 +6,10 @@
*/
import * as Popper from '@popperjs/core'
+import BaseComponent from './base-component.js'
+import EventHandler from './dom/event-handler.js'
+import Manipulator from './dom/manipulator.js'
+import SelectorEngine from './dom/selector-engine.js'
import {
defineJQueryPlugin,
execute,
@@ -17,10 +21,6 @@ import {
isVisible,
noop
} from './util/index.js'
-import EventHandler from './dom/event-handler.js'
-import Manipulator from './dom/manipulator.js'
-import SelectorEngine from './dom/selector-engine.js'
-import BaseComponent from './base-component.js'
/**
* Constants
@@ -96,7 +96,7 @@ class Dropdown extends BaseComponent {
this._popper = null
this._parent = this._element.parentNode // dropdown wrapper
- // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
+ // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] ||
SelectorEngine.prev(this._element, SELECTOR_MENU)[0] ||
SelectorEngine.findOne(SELECTOR_MENU, this._parent)
@@ -311,7 +311,7 @@ class Dropdown extends BaseComponent {
// Disable Popper if we have a static display or Dropdown is in Navbar
if (this._inNavbar || this._config.display === 'static') {
- Manipulator.setDataAttribute(this._menu, 'popper', 'static') // todo:v6 remove
+ Manipulator.setDataAttribute(this._menu, 'popper', 'static') // TODO: v6 remove
defaultBsPopperConfig.modifiers = [{
name: 'applyStyles',
enabled: false
@@ -409,7 +409,7 @@ class Dropdown extends BaseComponent {
event.preventDefault()
- // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
+ // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ?
this :
(SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0] ||
diff --git a/js/src/modal.js b/js/src/modal.js
index c4c410204..b44cbb94d 100644
--- a/js/src/modal.js
+++ b/js/src/modal.js
@@ -5,14 +5,14 @@
* --------------------------------------------------------------------------
*/
-import { defineJQueryPlugin, isRTL, isVisible, reflow } from './util/index.js'
+import BaseComponent from './base-component.js'
import EventHandler from './dom/event-handler.js'
import SelectorEngine from './dom/selector-engine.js'
-import ScrollBarHelper from './util/scrollbar.js'
-import BaseComponent from './base-component.js'
import Backdrop from './util/backdrop.js'
-import FocusTrap from './util/focustrap.js'
import { enableDismissTrigger } from './util/component-functions.js'
+import FocusTrap from './util/focustrap.js'
+import { defineJQueryPlugin, isRTL, isVisible, reflow } from './util/index.js'
+import ScrollBarHelper from './util/scrollbar.js'
/**
* Constants
diff --git a/js/src/offcanvas.js b/js/src/offcanvas.js
index 7a7f92e96..8d1feb13b 100644
--- a/js/src/offcanvas.js
+++ b/js/src/offcanvas.js
@@ -5,18 +5,18 @@
* --------------------------------------------------------------------------
*/
+import BaseComponent from './base-component.js'
+import EventHandler from './dom/event-handler.js'
+import SelectorEngine from './dom/selector-engine.js'
+import Backdrop from './util/backdrop.js'
+import { enableDismissTrigger } from './util/component-functions.js'
+import FocusTrap from './util/focustrap.js'
import {
defineJQueryPlugin,
isDisabled,
isVisible
} from './util/index.js'
import ScrollBarHelper from './util/scrollbar.js'
-import EventHandler from './dom/event-handler.js'
-import BaseComponent from './base-component.js'
-import SelectorEngine from './dom/selector-engine.js'
-import Backdrop from './util/backdrop.js'
-import FocusTrap from './util/focustrap.js'
-import { enableDismissTrigger } from './util/component-functions.js'
/**
* Constants
diff --git a/js/src/popover.js b/js/src/popover.js
index 2679bdae9..612c5218f 100644
--- a/js/src/popover.js
+++ b/js/src/popover.js
@@ -5,8 +5,8 @@
* --------------------------------------------------------------------------
*/
-import { defineJQueryPlugin } from './util/index.js'
import Tooltip from './tooltip.js'
+import { defineJQueryPlugin } from './util/index.js'
/**
* Constants
diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js
index 7695f2aef..0b1747c8a 100644
--- a/js/src/scrollspy.js
+++ b/js/src/scrollspy.js
@@ -5,10 +5,10 @@
* --------------------------------------------------------------------------
*/
-import { defineJQueryPlugin, getElement, isDisabled, isVisible } from './util/index.js'
+import BaseComponent from './base-component.js'
import EventHandler from './dom/event-handler.js'
import SelectorEngine from './dom/selector-engine.js'
-import BaseComponent from './base-component.js'
+import { defineJQueryPlugin, getElement, isDisabled, isVisible } from './util/index.js'
/**
* Constants
diff --git a/js/src/tab.js b/js/src/tab.js
index d46f290f0..d9993d56e 100644
--- a/js/src/tab.js
+++ b/js/src/tab.js
@@ -5,10 +5,10 @@
* --------------------------------------------------------------------------
*/
-import { defineJQueryPlugin, getNextActiveElement, isDisabled } from './util/index.js'
+import BaseComponent from './base-component.js'
import EventHandler from './dom/event-handler.js'
import SelectorEngine from './dom/selector-engine.js'
-import BaseComponent from './base-component.js'
+import { defineJQueryPlugin, getNextActiveElement, isDisabled } from './util/index.js'
/**
* Constants
@@ -43,7 +43,7 @@ const NOT_SELECTOR_DROPDOWN_TOGGLE = ':not(.dropdown-toggle)'
const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]'
const SELECTOR_OUTER = '.nav-item, .list-group-item'
const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`
-const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]' // todo:v6: could be only `tab`
+const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]' // TODO: could only be `tab` in v6
const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`
const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`
@@ -59,7 +59,7 @@ class Tab extends BaseComponent {
if (!this._parent) {
return
- // todo: should Throw exception on v6
+ // TODO: should throw exception in v6
// throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)
}
diff --git a/js/src/toast.js b/js/src/toast.js
index a62044222..d5d9c0ee0 100644
--- a/js/src/toast.js
+++ b/js/src/toast.js
@@ -5,10 +5,10 @@
* --------------------------------------------------------------------------
*/
-import { defineJQueryPlugin, reflow } from './util/index.js'
-import EventHandler from './dom/event-handler.js'
import BaseComponent from './base-component.js'
+import EventHandler from './dom/event-handler.js'
import { enableDismissTrigger } from './util/component-functions.js'
+import { defineJQueryPlugin, reflow } from './util/index.js'
/**
* Constants
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index ff1db974f..125281157 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -6,11 +6,11 @@
*/
import * as Popper from '@popperjs/core'
-import { defineJQueryPlugin, execute, findShadowRoot, getElement, getUID, isRTL, noop } from './util/index.js'
-import { DefaultAllowlist } from './util/sanitizer.js'
+import BaseComponent from './base-component.js'
import EventHandler from './dom/event-handler.js'
import Manipulator from './dom/manipulator.js'
-import BaseComponent from './base-component.js'
+import { defineJQueryPlugin, execute, findShadowRoot, getElement, getUID, isRTL, noop } from './util/index.js'
+import { DefaultAllowlist } from './util/sanitizer.js'
import TemplateFactory from './util/template-factory.js'
/**
@@ -197,7 +197,7 @@ class Tooltip extends BaseComponent {
return
}
- // todo v6 remove this OR make it optional
+ // TODO: v6 remove this or make it optional
this._disposePopper()
const tip = this._getTipElement()
@@ -302,13 +302,13 @@ class Tooltip extends BaseComponent {
_createTipElement(content) {
const tip = this._getTemplateFactory(content).toHtml()
- // todo: remove this check on v6
+ // TODO: remove this check in v6
if (!tip) {
return null
}
tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
- // todo: on v6 the following can be achieved with CSS only
+ // TODO: v6 the following can be achieved with CSS only
tip.classList.add(`bs-${this.constructor.NAME}-auto`)
const tipId = getUID(this.constructor.NAME).toString()
diff --git a/js/src/util/backdrop.js b/js/src/util/backdrop.js
index c552aef43..0d478e98d 100644
--- a/js/src/util/backdrop.js
+++ b/js/src/util/backdrop.js
@@ -6,8 +6,8 @@
*/
import EventHandler from '../dom/event-handler.js'
-import { execute, executeAfterTransition, getElement, reflow } from './index.js'
import Config from './config.js'
+import { execute, executeAfterTransition, getElement, reflow } from './index.js'
/**
* Constants
diff --git a/js/src/util/component-functions.js b/js/src/util/component-functions.js
index 5eb59b4af..4be828f83 100644
--- a/js/src/util/component-functions.js
+++ b/js/src/util/component-functions.js
@@ -6,8 +6,8 @@
*/
import EventHandler from '../dom/event-handler.js'
-import { isDisabled } from './index.js'
import SelectorEngine from '../dom/selector-engine.js'
+import { isDisabled } from './index.js'
const enableDismissTrigger = (component, method = 'hide') => {
const clickEvent = `click.dismiss${component.EVENT_KEY}`
diff --git a/js/src/util/config.js b/js/src/util/config.js
index 95221c1ef..a2b4bfba0 100644
--- a/js/src/util/config.js
+++ b/js/src/util/config.js
@@ -5,8 +5,8 @@
* --------------------------------------------------------------------------
*/
-import { isElement, toType } from './index.js'
import Manipulator from '../dom/manipulator.js'
+import { isElement, toType } from './index.js'
/**
* Class definition
diff --git a/js/src/util/scrollbar.js b/js/src/util/scrollbar.js
index 079c9108b..413f178da 100644
--- a/js/src/util/scrollbar.js
+++ b/js/src/util/scrollbar.js
@@ -5,8 +5,8 @@
* --------------------------------------------------------------------------
*/
-import SelectorEngine from '../dom/selector-engine.js'
import Manipulator from '../dom/manipulator.js'
+import SelectorEngine from '../dom/selector-engine.js'
import { isElement } from './index.js'
/**
diff --git a/js/src/util/swipe.js b/js/src/util/swipe.js
index 33ca90d8a..d2f708711 100644
--- a/js/src/util/swipe.js
+++ b/js/src/util/swipe.js
@@ -5,8 +5,8 @@
* --------------------------------------------------------------------------
*/
-import Config from './config.js'
import EventHandler from '../dom/event-handler.js'
+import Config from './config.js'
import { execute } from './index.js'
/**
diff --git a/js/src/util/template-factory.js b/js/src/util/template-factory.js
index bd827174b..f73589bcc 100644
--- a/js/src/util/template-factory.js
+++ b/js/src/util/template-factory.js
@@ -5,10 +5,10 @@
* --------------------------------------------------------------------------
*/
-import { DefaultAllowlist, sanitizeHtml } from './sanitizer.js'
-import { execute, getElement, isElement } from './index.js'
import SelectorEngine from '../dom/selector-engine.js'
import Config from './config.js'
+import { DefaultAllowlist, sanitizeHtml } from './sanitizer.js'
+import { execute, getElement, isElement } from './index.js'
/**
* Constants
diff --git a/js/tests/browsers.js b/js/tests/browsers.js
index 8adedc68b..c515e64a0 100644
--- a/js/tests/browsers.js
+++ b/js/tests/browsers.js
@@ -1,6 +1,7 @@
-/* eslint-env node */
/* eslint-disable camelcase */
+'use strict'
+
const browsers = {
safariMac: {
base: 'BrowserStack',
diff --git a/js/tests/integration/bundle-modularity.js b/js/tests/integration/bundle-modularity.js
index 8546141b1..3c1eec944 100644
--- a/js/tests/integration/bundle-modularity.js
+++ b/js/tests/integration/bundle-modularity.js
@@ -1,3 +1,5 @@
+/* eslint-disable import/extensions, import/no-unassigned-import */
+
import Tooltip from '../../dist/tooltip'
import '../../dist/carousel'
diff --git a/js/tests/integration/rollup.bundle-modularity.js b/js/tests/integration/rollup.bundle-modularity.js
index a8670ca8c..63d651525 100644
--- a/js/tests/integration/rollup.bundle-modularity.js
+++ b/js/tests/integration/rollup.bundle-modularity.js
@@ -1,7 +1,7 @@
-/* eslint-env node */
+'use strict'
const commonjs = require('@rollup/plugin-commonjs')
-const configRollup = require('./rollup.bundle')
+const configRollup = require('./rollup.bundle.js')
const config = {
...configRollup,
diff --git a/js/tests/integration/rollup.bundle.js b/js/tests/integration/rollup.bundle.js
index caddcab48..8b3c578a2 100644
--- a/js/tests/integration/rollup.bundle.js
+++ b/js/tests/integration/rollup.bundle.js
@@ -1,4 +1,4 @@
-/* eslint-env node */
+'use strict'
const { babel } = require('@rollup/plugin-babel')
const { nodeResolve } = require('@rollup/plugin-node-resolve')
diff --git a/js/tests/karma.conf.js b/js/tests/karma.conf.js
index 11c6f3045..36bf7f2df 100644
--- a/js/tests/karma.conf.js
+++ b/js/tests/karma.conf.js
@@ -1,5 +1,3 @@
-/* eslint-env node */
-
'use strict'
const path = require('node:path')
@@ -8,7 +6,7 @@ const { babel } = require('@rollup/plugin-babel')
const istanbul = require('rollup-plugin-istanbul')
const { nodeResolve } = require('@rollup/plugin-node-resolve')
const replace = require('@rollup/plugin-replace')
-const { browsers } = require('./browsers')
+const { browsers } = require('./browsers.js')
const ENV = process.env
const BROWSERSTACK = Boolean(ENV.BROWSERSTACK)
diff --git a/js/tests/unit/.eslintrc.json b/js/tests/unit/.eslintrc.json
deleted file mode 100644
index 6362a1acf..000000000
--- a/js/tests/unit/.eslintrc.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "extends": [
- "../../../.eslintrc.json"
- ],
- "env": {
- "jasmine": true
- },
- "rules": {
- "unicorn/consistent-function-scoping": "off",
- "unicorn/no-useless-undefined": "off",
- "unicorn/prefer-add-event-listener": "off"
- }
-}
diff --git a/js/tests/unit/alert.spec.js b/js/tests/unit/alert.spec.js
index d3740c91e..97cc3cc53 100644
--- a/js/tests/unit/alert.spec.js
+++ b/js/tests/unit/alert.spec.js
@@ -1,6 +1,6 @@
-import Alert from '../../src/alert'
-import { getTransitionDurationFromElement } from '../../src/util/index'
-import { clearFixture, getFixture, jQueryMock } from '../helpers/fixture'
+import Alert from '../../src/alert.js'
+import { getTransitionDurationFromElement } from '../../src/util/index.js'
+import { clearFixture, getFixture, jQueryMock } from '../helpers/fixture.js'
describe('Alert', () => {
let fixtureEl
diff --git a/js/tests/unit/base-component.spec.js b/js/tests/unit/base-component.spec.js
index b2352d66b..5b7d52e23 100644
--- a/js/tests/unit/base-component.spec.js
+++ b/js/tests/unit/base-component.spec.js
@@ -1,7 +1,7 @@
-import BaseComponent from '../../src/base-component'
-import { clearFixture, getFixture } from '../helpers/fixture'
-import EventHandler from '../../src/dom/event-handler'
-import { noop } from '../../src/util'
+import BaseComponent from '../../src/base-component.js'
+import EventHandler from '../../src/dom/event-handler.js'
+import { noop } from '../../src/util/index.js'
+import { clearFixture, getFixture } from '../helpers/fixture.js'
class DummyClass extends BaseComponent {
constructor(element) {
diff --git a/js/tests/unit/button.spec.js b/js/tests/unit/button.spec.js
index 09ed17efe..6624fee7c 100644
--- a/js/tests/unit/button.spec.js
+++ b/js/tests/unit/button.spec.js
@@ -1,5 +1,5 @@
-import Button from '../../src/button'
-import { getFixture, clearFixture, jQueryMock } from '../helpers/fixture'
+import Button from '../../src/button.js'
+import { clearFixture, getFixture, jQueryMock } from '../helpers/fixture.js'
describe('Button', () => {
let fixtureEl
diff --git a/js/tests/unit/carousel.spec.js b/js/tests/unit/carousel.spec.js
index d951bd5ae..c468b5c04 100644
--- a/js/tests/unit/carousel.spec.js
+++ b/js/tests/unit/carousel.spec.js
@@ -1,8 +1,8 @@
-import Carousel from '../../src/carousel'
-import EventHandler from '../../src/dom/event-handler'
-import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture'
-import { isRTL, noop } from '../../src/util/index'
-import Swipe from '../../src/util/swipe'
+import Carousel from '../../src/carousel.js'
+import EventHandler from '../../src/dom/event-handler.js'
+import { isRTL, noop } from '../../src/util/index.js'
+import Swipe from '../../src/util/swipe.js'
+import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture.js'
describe('Carousel', () => {
const { Simulator, PointerEvent } = window
diff --git a/js/tests/unit/collapse.spec.js b/js/tests/unit/collapse.spec.js
index 5a4fe1063..58c536752 100644
--- a/js/tests/unit/collapse.spec.js
+++ b/js/tests/unit/collapse.spec.js
@@ -1,6 +1,6 @@
-import Collapse from '../../src/collapse'
-import EventHandler from '../../src/dom/event-handler'
-import { clearFixture, getFixture, jQueryMock } from '../helpers/fixture'
+import Collapse from '../../src/collapse.js'
+import EventHandler from '../../src/dom/event-handler.js'
+import { clearFixture, getFixture, jQueryMock } from '../helpers/fixture.js'
describe('Collapse', () => {
let fixtureEl
diff --git a/js/tests/unit/dom/data.spec.js b/js/tests/unit/dom/data.spec.js
index e898cbba2..04e57a8bc 100644
--- a/js/tests/unit/dom/data.spec.js
+++ b/js/tests/unit/dom/data.spec.js
@@ -1,5 +1,5 @@
-import Data from '../../../src/dom/data'
-import { getFixture, clearFixture } from '../../helpers/fixture'
+import Data from '../../../src/dom/data.js'
+import { clearFixture, getFixture } from '../../helpers/fixture.js'
describe('Data', () => {
const TEST_KEY = 'bs.test'
@@ -89,7 +89,6 @@ describe('Data', () => {
expect(Data.get(div, TEST_KEY)).toBeNull()
})
- /* eslint-disable no-console */
it('should console.error a message if called with multiple keys', () => {
console.error = jasmine.createSpy('console.error')
@@ -102,5 +101,4 @@ describe('Data', () => {
expect(console.error).toHaveBeenCalled()
expect(Data.get(div, UNKNOWN_KEY)).toBeNull()
})
- /* eslint-enable no-console */
})
diff --git a/js/tests/unit/dom/event-handler.spec.js b/js/tests/unit/dom/event-handler.spec.js
index 623b9c160..7f99c4122 100644
--- a/js/tests/unit/dom/event-handler.spec.js
+++ b/js/tests/unit/dom/event-handler.spec.js
@@ -1,6 +1,6 @@
-import EventHandler from '../../../src/dom/event-handler'
-import { clearFixture, getFixture } from '../../helpers/fixture'
-import { noop } from '../../../src/util'
+import EventHandler from '../../../src/dom/event-handler.js'
+import { noop } from '../../../src/util/index.js'
+import { clearFixture, getFixture } from '../../helpers/fixture.js'
describe('EventHandler', () => {
let fixtureEl
diff --git a/js/tests/unit/dom/manipulator.spec.js b/js/tests/unit/dom/manipulator.spec.js
index 4561e2e46..9d0be3218 100644
--- a/js/tests/unit/dom/manipulator.spec.js
+++ b/js/tests/unit/dom/manipulator.spec.js
@@ -1,5 +1,5 @@
-import Manipulator from '../../../src/dom/manipulator'
-import { clearFixture, getFixture } from '../../helpers/fixture'
+import Manipulator from '../../../src/dom/manipulator.js'
+import { clearFixture, getFixture } from '../../helpers/fixture.js'
describe('Manipulator', () => {
let fixtureEl
diff --git a/js/tests/unit/dom/selector-engine.spec.js b/js/tests/unit/dom/selector-engine.spec.js
index 905e25bae..8dd7b1f89 100644
--- a/js/tests/unit/dom/selector-engine.spec.js
+++ b/js/tests/unit/dom/selector-engine.spec.js
@@ -1,5 +1,5 @@
-import SelectorEngine from '../../../src/dom/selector-engine'
-import { clearFixture, getFixture } from '../../helpers/fixture'
+import SelectorEngine from '../../../src/dom/selector-engine.js'
+import { clearFixture, getFixture } from '../../helpers/fixture.js'
describe('SelectorEngine', () => {
let fixtureEl
diff --git a/js/tests/unit/dropdown.spec.js b/js/tests/unit/dropdown.spec.js
index 2bbd7c00a..918435247 100644
--- a/js/tests/unit/dropdown.spec.js
+++ b/js/tests/unit/dropdown.spec.js
@@ -1,7 +1,7 @@
-import Dropdown from '../../src/dropdown'
-import EventHandler from '../../src/dom/event-handler'
-import { noop } from '../../src/util/index'
-import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture'
+import EventHandler from '../../src/dom/event-handler.js'
+import Dropdown from '../../src/dropdown.js'
+import { noop } from '../../src/util/index.js'
+import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture.js'
describe('Dropdown', () => {
let fixtureEl
diff --git a/js/tests/unit/jquery.spec.js b/js/tests/unit/jquery.spec.js
index 7da39d630..7d7f29dc7 100644
--- a/js/tests/unit/jquery.spec.js
+++ b/js/tests/unit/jquery.spec.js
@@ -1,18 +1,18 @@
/* eslint-env jquery */
-import Alert from '../../src/alert'
-import Button from '../../src/button'
-import Carousel from '../../src/carousel'
-import Collapse from '../../src/collapse'
-import Dropdown from '../../src/dropdown'
-import Modal from '../../src/modal'
-import Offcanvas from '../../src/offcanvas'
-import Popover from '../../src/popover'
-import ScrollSpy from '../../src/scrollspy'
-import Tab from '../../src/tab'
-import Toast from '../../src/toast'
-import Tooltip from '../../src/tooltip'
-import { clearFixture, getFixture } from '../helpers/fixture'
+import Alert from '../../src/alert.js'
+import Button from '../../src/button.js'
+import Carousel from '../../src/carousel.js'
+import Collapse from '../../src/collapse.js'
+import Dropdown from '../../src/dropdown.js'
+import Modal from '../../src/modal.js'
+import Offcanvas from '../../src/offcanvas.js'
+import Popover from '../../src/popover.js'
+import ScrollSpy from '../../src/scrollspy.js'
+import Tab from '../../src/tab.js'
+import Toast from '../../src/toast.js'
+import Tooltip from '../../src/tooltip.js'
+import { clearFixture, getFixture } from '../helpers/fixture.js'
describe('jQuery', () => {
let fixtureEl
diff --git a/js/tests/unit/modal.spec.js b/js/tests/unit/modal.spec.js
index fdee29e95..6434d8b3c 100644
--- a/js/tests/unit/modal.spec.js
+++ b/js/tests/unit/modal.spec.js
@@ -1,7 +1,7 @@
-import Modal from '../../src/modal'
-import EventHandler from '../../src/dom/event-handler'
-import ScrollBarHelper from '../../src/util/scrollbar'
-import { clearBodyAndDocument, clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture'
+import EventHandler from '../../src/dom/event-handler.js'
+import Modal from '../../src/modal.js'
+import ScrollBarHelper from '../../src/util/scrollbar.js'
+import { clearBodyAndDocument, clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture.js'
describe('Modal', () => {
let fixtureEl
diff --git a/js/tests/unit/offcanvas.spec.js b/js/tests/unit/offcanvas.spec.js
index da2fb9748..03e7d9ed3 100644
--- a/js/tests/unit/offcanvas.spec.js
+++ b/js/tests/unit/offcanvas.spec.js
@@ -1,8 +1,8 @@
-import Offcanvas from '../../src/offcanvas'
-import EventHandler from '../../src/dom/event-handler'
-import { clearBodyAndDocument, clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture'
-import { isVisible } from '../../src/util/index'
-import ScrollBarHelper from '../../src/util/scrollbar'
+import EventHandler from '../../src/dom/event-handler.js'
+import Offcanvas from '../../src/offcanvas.js'
+import { isVisible } from '../../src/util/index.js'
+import ScrollBarHelper from '../../src/util/scrollbar.js'
+import { clearBodyAndDocument, clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture.js'
describe('Offcanvas', () => {
let fixtureEl
diff --git a/js/tests/unit/popover.spec.js b/js/tests/unit/popover.spec.js
index baf691cdc..53dc7d89e 100644
--- a/js/tests/unit/popover.spec.js
+++ b/js/tests/unit/popover.spec.js
@@ -1,6 +1,6 @@
-import Popover from '../../src/popover'
-import EventHandler from '../../src/dom/event-handler'
-import { clearFixture, getFixture, jQueryMock } from '../helpers/fixture'
+import EventHandler from '../../src/dom/event-handler.js'
+import Popover from '../../src/popover.js'
+import { clearFixture, getFixture, jQueryMock } from '../helpers/fixture.js'
describe('Popover', () => {
let fixtureEl
diff --git a/js/tests/unit/scrollspy.spec.js b/js/tests/unit/scrollspy.spec.js
index c7951e6ff..070448c17 100644
--- a/js/tests/unit/scrollspy.spec.js
+++ b/js/tests/unit/scrollspy.spec.js
@@ -1,8 +1,6 @@
-import ScrollSpy from '../../src/scrollspy'
-
-/** Test helpers */
-import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture'
-import EventHandler from '../../src/dom/event-handler'
+import EventHandler from '../../src/dom/event-handler.js'
+import ScrollSpy from '../../src/scrollspy.js'
+import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture.js'
describe('ScrollSpy', () => {
let fixtureEl
diff --git a/js/tests/unit/tab.spec.js b/js/tests/unit/tab.spec.js
index 95b31b4f0..84690fc51 100644
--- a/js/tests/unit/tab.spec.js
+++ b/js/tests/unit/tab.spec.js
@@ -1,5 +1,5 @@
-import Tab from '../../src/tab'
-import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture'
+import Tab from '../../src/tab.js'
+import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture.js'
describe('Tab', () => {
let fixtureEl
diff --git a/js/tests/unit/toast.spec.js b/js/tests/unit/toast.spec.js
index 42d25156b..cfc56c74a 100644
--- a/js/tests/unit/toast.spec.js
+++ b/js/tests/unit/toast.spec.js
@@ -1,5 +1,5 @@
-import Toast from '../../src/toast'
-import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture'
+import Toast from '../../src/toast.js'
+import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture.js'
describe('Toast', () => {
let fixtureEl
diff --git a/js/tests/unit/tooltip.spec.js b/js/tests/unit/tooltip.spec.js
index 1c85640c0..080432e9a 100644
--- a/js/tests/unit/tooltip.spec.js
+++ b/js/tests/unit/tooltip.spec.js
@@ -1,7 +1,7 @@
-import Tooltip from '../../src/tooltip'
-import EventHandler from '../../src/dom/event-handler'
-import { noop } from '../../src/util/index'
-import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture'
+import EventHandler from '../../src/dom/event-handler.js'
+import Tooltip from '../../src/tooltip.js'
+import { noop } from '../../src/util/index.js'
+import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture.js'
describe('Tooltip', () => {
let fixtureEl
diff --git a/js/tests/unit/util/backdrop.spec.js b/js/tests/unit/util/backdrop.spec.js
index 73384fc90..0faaac6a5 100644
--- a/js/tests/unit/util/backdrop.spec.js
+++ b/js/tests/unit/util/backdrop.spec.js
@@ -1,6 +1,6 @@
-import Backdrop from '../../../src/util/backdrop'
-import { getTransitionDurationFromElement } from '../../../src/util/index'
-import { clearFixture, getFixture } from '../../helpers/fixture'
+import Backdrop from '../../../src/util/backdrop.js'
+import { getTransitionDurationFromElement } from '../../../src/util/index.js'
+import { clearFixture, getFixture } from '../../helpers/fixture.js'
const CLASS_BACKDROP = '.modal-backdrop'
const CLASS_NAME_FADE = 'fade'
diff --git a/js/tests/unit/util/component-functions.spec.js b/js/tests/unit/util/component-functions.spec.js
index ec36672cb..ce83785e2 100644
--- a/js/tests/unit/util/component-functions.spec.js
+++ b/js/tests/unit/util/component-functions.spec.js
@@ -1,8 +1,6 @@
-/* Test helpers */
-
-import { clearFixture, createEvent, getFixture } from '../../helpers/fixture'
-import { enableDismissTrigger } from '../../../src/util/component-functions'
-import BaseComponent from '../../../src/base-component'
+import BaseComponent from '../../../src/base-component.js'
+import { enableDismissTrigger } from '../../../src/util/component-functions.js'
+import { clearFixture, createEvent, getFixture } from '../../helpers/fixture.js'
class DummyClass2 extends BaseComponent {
static get NAME() {
diff --git a/js/tests/unit/util/config.spec.js b/js/tests/unit/util/config.spec.js
index 0037e09d7..93987a74a 100644
--- a/js/tests/unit/util/config.spec.js
+++ b/js/tests/unit/util/config.spec.js
@@ -1,5 +1,5 @@
-import Config from '../../../src/util/config'
-import { clearFixture, getFixture } from '../../helpers/fixture'
+import Config from '../../../src/util/config.js'
+import { clearFixture, getFixture } from '../../helpers/fixture.js'
class DummyConfigClass extends Config {
static get NAME() {
diff --git a/js/tests/unit/util/focustrap.spec.js b/js/tests/unit/util/focustrap.spec.js
index bedd124c9..0a20017d5 100644
--- a/js/tests/unit/util/focustrap.spec.js
+++ b/js/tests/unit/util/focustrap.spec.js
@@ -1,7 +1,7 @@
-import FocusTrap from '../../../src/util/focustrap'
-import EventHandler from '../../../src/dom/event-handler'
-import SelectorEngine from '../../../src/dom/selector-engine'
-import { clearFixture, createEvent, getFixture } from '../../helpers/fixture'
+import EventHandler from '../../../src/dom/event-handler.js'
+import SelectorEngine from '../../../src/dom/selector-engine.js'
+import FocusTrap from '../../../src/util/focustrap.js'
+import { clearFixture, createEvent, getFixture } from '../../helpers/fixture.js'
describe('FocusTrap', () => {
let fixtureEl
diff --git a/js/tests/unit/util/index.spec.js b/js/tests/unit/util/index.spec.js
index 202c72061..4065a9168 100644
--- a/js/tests/unit/util/index.spec.js
+++ b/js/tests/unit/util/index.spec.js
@@ -1,6 +1,6 @@
-import * as Util from '../../../src/util/index'
-import { clearFixture, getFixture } from '../../helpers/fixture'
-import { noop } from '../../../src/util/index'
+import * as Util from '../../../src/util/index.js'
+import { noop } from '../../../src/util/index.js'
+import { clearFixture, getFixture } from '../../helpers/fixture.js'
describe('Util', () => {
let fixtureEl
diff --git a/js/tests/unit/util/sanitizer.spec.js b/js/tests/unit/util/sanitizer.spec.js
index c656aed35..55e9b6336 100644
--- a/js/tests/unit/util/sanitizer.spec.js
+++ b/js/tests/unit/util/sanitizer.spec.js
@@ -1,4 +1,4 @@
-import { DefaultAllowlist, sanitizeHtml } from '../../../src/util/sanitizer'
+import { DefaultAllowlist, sanitizeHtml } from '../../../src/util/sanitizer.js'
describe('Sanitizer', () => {
describe('sanitizeHtml', () => {
diff --git a/js/tests/unit/util/scrollbar.spec.js b/js/tests/unit/util/scrollbar.spec.js
index 6fcf5718b..6dadfcdd1 100644
--- a/js/tests/unit/util/scrollbar.spec.js
+++ b/js/tests/unit/util/scrollbar.spec.js
@@ -1,6 +1,6 @@
-import { clearBodyAndDocument, clearFixture, getFixture } from '../../helpers/fixture'
-import Manipulator from '../../../src/dom/manipulator'
-import ScrollBarHelper from '../../../src/util/scrollbar'
+import Manipulator from '../../../src/dom/manipulator.js'
+import ScrollBarHelper from '../../../src/util/scrollbar.js'
+import { clearBodyAndDocument, clearFixture, getFixture } from '../../helpers/fixture.js'
describe('ScrollBar', () => {
let fixtureEl
diff --git a/js/tests/unit/util/swipe.spec.js b/js/tests/unit/util/swipe.spec.js
index f92bb5d00..9252d312b 100644
--- a/js/tests/unit/util/swipe.spec.js
+++ b/js/tests/unit/util/swipe.spec.js
@@ -1,7 +1,7 @@
-import { clearFixture, getFixture } from '../../helpers/fixture'
-import EventHandler from '../../../src/dom/event-handler'
-import Swipe from '../../../src/util/swipe'
-import { noop } from '../../../src/util'
+import EventHandler from '../../../src/dom/event-handler.js'
+import { noop } from '../../../src/util/index.js'
+import Swipe from '../../../src/util/swipe.js'
+import { clearFixture, getFixture } from '../../helpers/fixture.js'
describe('Swipe', () => {
const { Simulator, PointerEvent } = window
diff --git a/js/tests/unit/util/template-factory.spec.js b/js/tests/unit/util/template-factory.spec.js
index 5e5724c5f..07f4d91c7 100644
--- a/js/tests/unit/util/template-factory.spec.js
+++ b/js/tests/unit/util/template-factory.spec.js
@@ -1,5 +1,5 @@
-import { clearFixture, getFixture } from '../../helpers/fixture'
-import TemplateFactory from '../../../src/util/template-factory'
+import TemplateFactory from '../../../src/util/template-factory.js'
+import { clearFixture, getFixture } from '../../helpers/fixture.js'
describe('TemplateFactory', () => {
let fixtureEl
diff --git a/js/tests/visual/.eslintrc.json b/js/tests/visual/.eslintrc.json
deleted file mode 100644
index 8a3322572..000000000
--- a/js/tests/visual/.eslintrc.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "plugins": [
- "html"
- ],
- "extends": "../../../.eslintrc.json",
- "parserOptions": {
- "sourceType": "module"
- },
- "settings": {
- "html/html-extensions": [
- ".html"
- ]
- },
- "rules": {
- "no-console": "off",
- "no-new": "off",
- "unicorn/no-array-for-each": "off"
- }
-}
diff --git a/package.json b/package.json
index 415a49408..602192164 100644
--- a/package.json
+++ b/package.json
@@ -61,7 +61,7 @@
"js-compile-standalone-esm": "rollup --environment ESM:true,BUNDLE:false --config build/rollup.config.js --sourcemap",
"js-compile-bundle": "rollup --environment BUNDLE:true --config build/rollup.config.js --sourcemap",
"js-compile-plugins": "node build/build-plugins.js",
- "js-lint": "eslint --cache --cache-location .cache/.eslintcache --report-unused-disable-directives --ext .html,.js .",
+ "js-lint": "eslint --cache --cache-location .cache/.eslintcache --report-unused-disable-directives --ext .html,.js,.md .",
"js-minify": "npm-run-all --aggregate-output --parallel js-minify-*",
"js-minify-standalone": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.js.map,includeSources,url=bootstrap.min.js.map\" --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
"js-minify-standalone-esm": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.esm.js.map,includeSources,url=bootstrap.esm.min.js.map\" --output dist/js/bootstrap.esm.min.js dist/js/bootstrap.esm.js",
diff --git a/scss/tests/jasmine.js b/scss/tests/jasmine.js
index dd78aa551..25d838c97 100644
--- a/scss/tests/jasmine.js
+++ b/scss/tests/jasmine.js
@@ -1,5 +1,3 @@
-/* eslint-env node */
-
/* eslint-disable camelcase */
'use strict'
diff --git a/scss/tests/sass-true/register.js b/scss/tests/sass-true/register.js
index bf4139ab1..d93e414c1 100644
--- a/scss/tests/sass-true/register.js
+++ b/scss/tests/sass-true/register.js
@@ -1,8 +1,7 @@
-/* eslint-env node */
-
'use strict'
const path = require('node:path')
+
const runnerPath = path.join(__dirname, 'runner').replace(/\\/g, '/')
require.extensions['.scss'] = (module, filename) => {
diff --git a/scss/tests/sass-true/runner.js b/scss/tests/sass-true/runner.js
index 71dc222a5..bef870ac6 100644
--- a/scss/tests/sass-true/runner.js
+++ b/scss/tests/sass-true/runner.js
@@ -1,10 +1,8 @@
-/* eslint-env node */
-
'use strict'
-const { runSass } = require('sass-true')
const fs = require('node:fs')
const path = require('node:path')
+const { runSass } = require('sass-true')
module.exports = (filename, { describe, it }) => {
const data = fs.readFileSync(filename, 'utf8')
diff --git a/site/.eslintrc.json b/site/.eslintrc.json
deleted file mode 100644
index 0a16f82f9..000000000
--- a/site/.eslintrc.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "extends": "../.eslintrc.json",
- "env": {
- "browser": true,
- "node": false
- },
- "parserOptions": {
- "sourceType": "script"
- },
- "plugins": [
- "markdown"
- ],
- "rules": {
- "no-new": "off",
- "strict": "error",
- "unicorn/no-array-for-each": "off",
- "unicorn/numeric-separators-style": "off",
- "unicorn/prefer-node-protocol": "off"
- },
- "overrides": [
- {
- // 2. Enable the Markdown processor for all .md files.
- "files": [
- "./**/*.md"
- ],
- "processor": "markdown/markdown"
- },
- {
- // In v2, configuration for fenced code blocks is separate from the
- // containing Markdown file. Each code block has a virtual filename
- // appended to the Markdown file's path.
- "files": [
- "./**/*.md/*.js"
- ],
- // Configuration for fenced code blocks goes with the override for
- // the code block's virtual filename, for example:
- "parserOptions": {
- "ecmaFeatures": {
- "impliedStrict": true
- }
- },
- "rules": {
- "no-array-for-each": "off",
- "no-labels": "off",
- "no-redeclare": "off",
- "no-undef": "off",
- "no-unused-expressions": "off",
- "no-unused-labels": "off",
- "no-unused-vars": "off",
- "unicorn/no-array-for-each": "off",
- "unicorn/numeric-separators-style": "off"
- }
- }
- ]
-}
diff --git a/site/content/docs/5.3/getting-started/javascript.md b/site/content/docs/5.3/getting-started/javascript.md
index 739e9ef63..ef3c3ba64 100644
--- a/site/content/docs/5.3/getting-started/javascript.md
+++ b/site/content/docs/5.3/getting-started/javascript.md
@@ -30,6 +30,7 @@ A better alternative for those using this type of frameworks is to use a framewo
We provide a version of Bootstrap built as `ESM` (`bootstrap.esm.js` and `bootstrap.esm.min.js`) which allows you to use Bootstrap as a module in the browser, if your [targeted browsers support it](https://caniuse.com/es6-module).
+<!-- eslint-skip -->
```html
<script type="module">
import { Toast } from 'bootstrap.esm.min.js'
@@ -54,6 +55,7 @@ Uncaught TypeError: Failed to resolve module specifier "@popperjs/core". Relativ
To fix this, you can use an `importmap` to resolve the arbitrary module names to complete paths. If your [targeted browsers](https://caniuse.com/?search=importmap) do not support `importmap`, you'll need to use the [es-module-shims](https://github.com/guybedford/es-module-shims) project. Here's how it works for Bootstrap and Popper:
+<!-- eslint-skip -->
```html
<!doctype html>
<html lang="en">