Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75eee98

Browse files
committed
Fix lint violations
1 parent da7ded1 commit 75eee98

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"mocha": true
1515
},
1616
"rules": {
17+
"github/no-inner-html": "off",
1718
"github/unescaped-html-literal": "off"
1819
}
1920
}

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ async function handleData(el: IncludeFragmentElement) {
3232
return getData(el).then(
3333
function (html: string) {
3434
const template = document.createElement('template')
35+
// eslint-disable-next-line github/no-inner-html
3536
template.innerHTML = html
3637
const fragment = document.importNode(template.content, true)
3738
const canceled = !el.dispatchEvent(new CustomEvent('include-fragment-replace', {cancelable: true, detail: {fragment}}))
@@ -163,6 +164,7 @@ export default class IncludeFragmentElement extends HTMLElement {
163164

164165
constructor() {
165166
super()
167+
// eslint-disable-next-line github/no-inner-html
166168
this.attachShadow({mode: 'open'}).innerHTML = `
167169
<style>
168170
:host {

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function when(el, eventType) {
7878
setup(function () {
7979
count = 0
8080
window.IncludeFragmentElement.prototype.fetch = function (request) {
81-
const pathname = new URL(request.url).pathname
81+
const pathname = new URL(request.url, window.location.origin).pathname
8282
return Promise.resolve(responses[pathname](request))
8383
}
8484
})

0 commit comments

Comments
 (0)