mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-19 16:54:24 +01:00
ESLint: enable prefer-template rule (#37484)
This commit is contained in:
parent
21e036bf13
commit
5208dd10c4
@ -46,6 +46,7 @@
|
||||
"error",
|
||||
"after"
|
||||
],
|
||||
"prefer-template": "error",
|
||||
"semi": [
|
||||
"error",
|
||||
"never"
|
||||
|
@ -16,7 +16,7 @@ const { babel } = require('@rollup/plugin-babel')
|
||||
const banner = require('./banner.js')
|
||||
|
||||
const sourcePath = path.resolve(__dirname, '../js/src/').replace(/\\/g, '/')
|
||||
const jsFiles = globby.sync(sourcePath + '/**/*.js')
|
||||
const jsFiles = globby.sync(`${sourcePath}/**/*.js`)
|
||||
|
||||
// Array which holds the resolved plugins
|
||||
const resolvedPlugins = []
|
||||
|
@ -17,7 +17,7 @@ const TRANSITION_END = 'transitionend'
|
||||
const parseSelector = selector => {
|
||||
if (selector && window.CSS && window.CSS.escape) {
|
||||
// document.querySelector needs escaping to handle IDs (html5+) containing for instance /
|
||||
selector = selector.replace(/#([^\s"#']+)/g, (match, id) => '#' + CSS.escape(id))
|
||||
selector = selector.replace(/#([^\s"#']+)/g, (match, id) => `#${CSS.escape(id)}`)
|
||||
}
|
||||
|
||||
return selector
|
||||
|
@ -105,7 +105,7 @@ if (BROWSERSTACK) {
|
||||
config.browserStack = {
|
||||
username: ENV.BROWSER_STACK_USERNAME,
|
||||
accessKey: ENV.BROWSER_STACK_ACCESS_KEY,
|
||||
build: `bootstrap-${ENV.GITHUB_SHA ? ENV.GITHUB_SHA.slice(0, 7) + '-' : ''}${new Date().toISOString()}`,
|
||||
build: `bootstrap-${ENV.GITHUB_SHA ? `${ENV.GITHUB_SHA.slice(0, 7)}-` : ''}${new Date().toISOString()}`,
|
||||
project: 'Bootstrap',
|
||||
retryLimit: 2
|
||||
}
|
||||
|
@ -897,7 +897,7 @@ describe('Collapse', () => {
|
||||
const trigger2 = fixtureEl.querySelector('#trigger2')
|
||||
const trigger3 = fixtureEl.querySelector('#trigger3')
|
||||
const target1 = fixtureEl.querySelector('#test1')
|
||||
const target2 = fixtureEl.querySelector('#' + CSS.escape('0/my/id'))
|
||||
const target2 = fixtureEl.querySelector(`#${CSS.escape('0/my/id')}`)
|
||||
|
||||
const target2Shown = () => {
|
||||
expect(trigger1).not.toHaveClass('collapsed')
|
||||
|
@ -207,7 +207,7 @@ describe('Tab', () => {
|
||||
const tab = new Tab(profileTriggerEl)
|
||||
|
||||
profileTriggerEl.addEventListener('shown.bs.tab', () => {
|
||||
expect(fixtureEl.querySelector('#' + CSS.escape('2'))).toHaveClass('active')
|
||||
expect(fixtureEl.querySelector(`#${CSS.escape('2')}`)).toHaveClass('active')
|
||||
done()
|
||||
})
|
||||
|
||||
|
@ -128,7 +128,7 @@ describe('Config', () => {
|
||||
const obj = new DummyConfigClass()
|
||||
expect(() => {
|
||||
obj._typeCheckConfig(config)
|
||||
}).toThrowError(TypeError, obj.constructor.NAME.toUpperCase() + ': Option "parent" provided type "number" but expected type "(string|element)".')
|
||||
}).toThrowError(TypeError, `${obj.constructor.NAME.toUpperCase()}: Option "parent" provided type "number" but expected type "(string|element)".`)
|
||||
})
|
||||
|
||||
it('should return null stringified when null is passed', () => {
|
||||
|
@ -55,7 +55,7 @@
|
||||
// Test to show that transition-duration can be changed with css
|
||||
carousel.addEventListener('slid.bs.carousel', event => {
|
||||
t1 = performance.now()
|
||||
console.log('transition-duration took ' + (t1 - t0) + 'ms, slid at ' + event.timeStamp)
|
||||
console.log(`transition-duration took ${t1 - t0}ms, slid at ${event.timeStamp}`)
|
||||
})
|
||||
carousel.addEventListener('slide.bs.carousel', () => {
|
||||
t0 = performance.now()
|
||||
|
@ -264,7 +264,7 @@
|
||||
|
||||
slowModal.addEventListener('shown.bs.modal', () => {
|
||||
t1 = performance.now()
|
||||
console.log('transition-duration took ' + (t1 - t0) + 'ms.')
|
||||
console.log(`transition-duration took ${t1 - t0}ms.`)
|
||||
})
|
||||
|
||||
slowModal.addEventListener('show.bs.modal', () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user