Skip to content

Commit 6bcf740

Browse files
committed
chore: fix eslint errors
1 parent aba7a39 commit 6bcf740

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

js/src/carousel.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ class Carousel extends BaseComponent {
369369

370370
const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement)
371371

372+
// eslint-disable-next-line unicorn/no-for-loop
372373
for (let i = 0; i < indicators.length; i++) {
373374
if (Number.parseInt(indicators[i].getAttribute('data-coreui-slide-to'), 10) === this._getItemIndex(element)) {
374375
indicators[i].classList.add(CLASS_NAME_ACTIVE)

js/src/util/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
* --------------------------------------------------------------------------
99
*/
1010

11-
const MAX_UID = 1000000
11+
const MAX_UID = 1_000_000
1212
const MILLISECONDS_MULTIPLIER = 1000
1313
const TRANSITION_END = 'transitionend'
1414

1515
// Shoutout AngusCroll (https://goo.gl/pxwQGp)
16-
const toType = obj => {
17-
if (obj === null || obj === undefined) {
18-
return `${obj}`
16+
const toType = object => {
17+
if (object === null || object === undefined) {
18+
return `${object}`
1919
}
2020

21-
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase()
21+
return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase()
2222
}
2323

2424
/**

js/tests/unit/dropdown.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('Dropdown', () => {
7474
const dropdown = new Dropdown(btnDropdown, {
7575
offset: getOffset,
7676
popperConfig: {
77-
onFirstUpdate: state => {
77+
onFirstUpdate(state) {
7878
expect(getOffset).toHaveBeenCalledWith({
7979
popper: state.rects.popper,
8080
reference: state.rects.reference,

js/tests/unit/scrollspy.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ describe('ScrollSpy', () => {
236236
contentEl,
237237
scrollSpy,
238238
spy,
239-
cb: () => {
239+
cb() {
240240
testElementIsActiveAfterScroll({
241241
elementSelector: '#a-2',
242242
targetSelector: '#div-2',
@@ -276,7 +276,7 @@ describe('ScrollSpy', () => {
276276
contentEl,
277277
scrollSpy,
278278
spy,
279-
cb: () => {
279+
cb() {
280280
testElementIsActiveAfterScroll({
281281
elementSelector: '#a-2',
282282
targetSelector: '#div-2',
@@ -316,7 +316,7 @@ describe('ScrollSpy', () => {
316316
contentEl,
317317
scrollSpy,
318318
spy,
319-
cb: () => {
319+
cb() {
320320
testElementIsActiveAfterScroll({
321321
elementSelector: '#a-2',
322322
targetSelector: '#div-2',

js/tests/unit/tooltip.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ describe('Tooltip', () => {
126126
const tooltip = new Tooltip(tooltipEl, {
127127
offset: getOffset,
128128
popperConfig: {
129-
onFirstUpdate: state => {
129+
onFirstUpdate(state) {
130130
expect(getOffset).toHaveBeenCalledWith({
131131
popper: state.rects.popper,
132132
reference: state.rects.reference,

0 commit comments

Comments
 (0)