Skip to content

Commit dc6da8b

Browse files
committed
refactor: update scripts to remove eslint warnings
1 parent df60365 commit dc6da8b

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

build/postinstall.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const main = () => {
1515

1616
try {
1717
const Configstore = require('configstore')
18-
const pkg = require(__dirname + '/../package.json')
18+
const pkg = require(`${__dirname}/../package.json`)
1919
const now = Date.now()
2020

2121
const week = 1000 * 60 * 60 * 24 * 7

build/vendors.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ const injector = require('@coreui/vendors-injector')
1111
const dist = 'dist/'
1212

1313
const walkSync = (dir, filelist = []) => {
14-
fs.readdirSync(dir).forEach(file => {
14+
for (const file of fs.readdirSync(dir)) {
1515
filelist = fs.statSync(path.join(dir, file)).isDirectory() ? walkSync(path.join(dir, file), filelist) : filelist.concat(path.join(dir, file))
16-
})
16+
}
17+
1718
return filelist
1819
}
1920

2021
const main = () => {
2122
const filenames = walkSync(dist)
22-
filenames.forEach(filename => {
23+
for (const filename of filenames) {
2324
if (extension(filename) === '.html') {
2425
injector.toFile(filename)
2526
}
26-
})
27+
}
2728
}
2829

2930
main()

src/js/colors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* --------------------------------------------------------------------------
88
*/
99

10-
document.querySelectorAll('.theme-color').forEach(element => {
10+
for (const element of document.querySelectorAll('.theme-color')) {
1111
const color = getComputedStyle(element, null).getPropertyValue('background-color')
1212
const table = document.createElement('table')
1313
table.classList.add('w-100')
@@ -24,4 +24,4 @@ document.querySelectorAll('.theme-color').forEach(element => {
2424
</table>
2525
`
2626
element.parentNode.append(table)
27-
})
27+
}

src/js/popovers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* --------------------------------------------------------------------------
88
*/
99

10-
document.querySelectorAll('[data-coreui-toggle="popover"]').forEach(element => {
10+
for (const element of document.querySelectorAll('[data-coreui-toggle="popover"]')) {
1111
// eslint-disable-next-line no-new
1212
new coreui.Popover(element)
13-
})
13+
}
1414

src/js/tooltips.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* --------------------------------------------------------------------------
88
*/
99

10-
document.querySelectorAll('[data-coreui-toggle="tooltip"]').forEach(element => {
10+
for (const element of document.querySelectorAll('[data-coreui-toggle="tooltip"]')) {
1111
// eslint-disable-next-line no-new
1212
new coreui.Tooltip(element)
13-
})
13+
}

0 commit comments

Comments
 (0)