Skip to content

Commit

Permalink
JS linting
Browse files Browse the repository at this point in the history
  • Loading branch information
gael-ian committed May 20, 2024
1 parent 2482429 commit cc03115
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions npm/__tests__/unit/cocooned/plugins/core/triggers/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('Add', () => {
beforeEach(() => { document.body.innerHTML = given.html })

given('extended', () => coreMixin(Base))
// eslint-disable-next-line new-cap
given('add', () => new Add(given.addTrigger, new given.extended(given.container), given.options))
given('addTrigger', () => getAddLink(given.container))
given('container', () => document.querySelector('[data-cocooned-container]'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Builder', () => {
given('builder', () => {
return new Builder(
given.template.content,
given.extended.replacementsFor('new_person')
given.extended.replacementsFor('new_person')
)
})
given('id', () => faker.string.numeric(5))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('Extractor', () => {
beforeEach(() => { document.body.innerHTML = given.html })

given('extended', () => coreMixin(Base))
// eslint-disable-next-line new-cap
given('extractor', () => new Extractor(given.addTrigger, new given.extended(given.container)))
given('container', () => document.querySelector('[data-cocooned-container]'))
given('addTrigger', () => getAddLink(document))
Expand Down
8 changes: 4 additions & 4 deletions npm/src/cocooned/plugins/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const coreMixin = (Base) => class extends Base {
}

static get replacements () {
return this.__replacements;
return this.__replacements
}

static replacementsFor (association) {
Expand Down Expand Up @@ -46,7 +46,7 @@ const coreMixin = (Base) => class extends Base {
}

replacementsFor (association) {
return this.constructor.replacementsFor(association);
return this.constructor.replacementsFor(association)
}

/* Protected and private attributes and methods */
Expand All @@ -57,8 +57,8 @@ const coreMixin = (Base) => class extends Base {
{ tag: '*', attribute: 'name', delimiters: ['[', ']'] },

// Compatibility with Trix. See #65 on Github.
{ tag: 'trix-editor', attribute: 'input', delimiters: ['_'] },
];
{ tag: 'trix-editor', attribute: 'input', delimiters: ['_'] }
]
}

export {
Expand Down
2 changes: 1 addition & 1 deletion npm/src/cocooned/plugins/core/triggers/add/extractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Extractor {
return new Builder(
template.content,
this.#cocooned.replacementsFor(`new_${this.#dataset.association}`)
);
)
}

_extractCount () {
Expand Down
4 changes: 2 additions & 2 deletions npm/src/cocooned/plugins/core/triggers/add/replacement.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class Replacement {

#escape (string) {
return (string && reHasRegExpChar.test(string))
? string.replace(reRegExpChar, '\\$&')
: (string || '')
? string.replace(reRegExpChar, '\\$&')
: (string || '')
}
}

Expand Down

0 comments on commit cc03115

Please sign in to comment.