2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-23 07:20:35 +03:00

chore: lint

This commit is contained in:
pimlie
2020-01-03 10:30:33 +01:00
parent 7c2cb1ae89
commit 9041bfef62
7 changed files with 26 additions and 22 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ export function addCallback (query, callback) {
query = '' query = ''
} }
callbacks.push([ query, callback ]) callbacks.push([query, callback])
} }
export function addCallbacks ({ tagIDKeyName }, type, tags, autoAddListeners) { export function addCallbacks ({ tagIDKeyName }, type, tags, autoAddListeners) {
+1
View File
@@ -13,6 +13,7 @@ export function triggerUpdate ({ debounceWait }, rootVm, hookName) {
if (rootVm[rootConfigKey].initialized && !rootVm[rootConfigKey].pausing) { if (rootVm[rootConfigKey].initialized && !rootVm[rootConfigKey].pausing) {
// batch potential DOM updates to prevent extraneous re-rendering // batch potential DOM updates to prevent extraneous re-rendering
// eslint-disable-next-line no-void
batchUpdate(() => void rootVm.$meta().refresh(), debounceWait) batchUpdate(() => void rootVm.$meta().refresh(), debounceWait)
} }
} }
+1 -1
View File
@@ -50,7 +50,7 @@ export default function tagGenerator (options, type, tags, generatorOptions) {
} }
if (attr === 'callback') { if (attr === 'callback') {
attrs += ` onload="this.__vm_l=1"` attrs += ' onload="this.__vm_l=1"'
continue continue
} }
+7 -7
View File
@@ -16,8 +16,8 @@ export default function $meta (options) {
const $root = this.$root const $root = this.$root
return { return {
'getOptions': () => getOptions(options), getOptions: () => getOptions(options),
'setOptions': (newOptions) => { setOptions: (newOptions) => {
const refreshNavKey = 'refreshOnceOnNavigation' const refreshNavKey = 'refreshOnceOnNavigation'
if (newOptions && newOptions[refreshNavKey]) { if (newOptions && newOptions[refreshNavKey]) {
options.refreshOnceOnNavigation = !!newOptions[refreshNavKey] options.refreshOnceOnNavigation = !!newOptions[refreshNavKey]
@@ -37,10 +37,10 @@ export default function $meta (options) {
options.waitOnDestroyed = !!newOptions[waitOnDestroyedKey] options.waitOnDestroyed = !!newOptions[waitOnDestroyedKey]
} }
}, },
'refresh': () => refresh($root, options), refresh: () => refresh($root, options),
'inject': () => process.server ? inject($root, options) : showWarningNotSupportedInBrowserBundle('inject'), inject: () => process.server ? inject($root, options) : showWarningNotSupportedInBrowserBundle('inject'),
'pause': () => pause($root), pause: () => pause($root),
'resume': () => resume($root), resume: () => resume($root),
'addApp': appId => addApp($root, appId, options) addApp: appId => addApp($root, appId, options)
} }
} }
+2 -2
View File
@@ -109,8 +109,8 @@ describe('getComponentOption', () => {
const component = localVue.component('parent', { const component = localVue.component('parent', {
render: h => h('div', null, [ render: h => h('div', null, [
h('meta-child', null, [ h('nometa-child') ]), h('meta-child', null, [h('nometa-child')]),
h('nometa-child', null, [ h('meta-child') ]), h('nometa-child', null, [h('meta-child')]),
h('nometa-child') h('nometa-child')
]) ])
}) })
+3 -3
View File
@@ -23,7 +23,7 @@ export function getVueMetaPath (browser) {
} }
process.server = !browser process.server = !browser
return path.resolve(__dirname, `../../src`) return path.resolve(__dirname, '../../src')
} }
export function webpackRun (config) { export function webpackRun (config) {
@@ -152,7 +152,7 @@ export function createWebpackConfig (config = {}) {
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env': { 'process.env': {
// make sure our simple polyfills are enabled // make sure our simple polyfills are enabled
'NODE_ENV': '"test"' NODE_ENV: '"test"'
} }
}), }),
new CopyWebpackPlugin([ new CopyWebpackPlugin([
@@ -161,7 +161,7 @@ export function createWebpackConfig (config = {}) {
], ],
resolve: { resolve: {
alias: { alias: {
'vue': 'vue/dist/vue.esm.js', vue: 'vue/dist/vue.esm.js',
'vue-meta': getVueMetaPath(true) 'vue-meta': getVueMetaPath(true)
} }
}, },
+11 -8
View File
@@ -118,13 +118,14 @@ const metaInfoData = {
{ src: 'src-prepend', async: true, defer: false, pbody: true }, { src: 'src-prepend', async: true, defer: false, pbody: true },
{ src: 'src2', async: false, defer: true, body: true }, { src: 'src2', async: false, defer: true, body: true },
{ src: 'src3', async: false, skip: true }, { src: 'src3', async: false, skip: true },
{ type: 'application/ld+json', {
type: 'application/ld+json',
json: { json: {
'@context': 'http://schema.org', '@context': 'http://schema.org',
'@type': 'Organization', '@type': 'Organization',
'name': 'MyApp', name: 'MyApp',
'url': 'https://www.myurl.com', url: 'https://www.myurl.com',
'logo': 'https://www.myurl.com/images/logo.png' logo: 'https://www.myurl.com/images/logo.png'
} }
} }
], ],
@@ -280,10 +281,12 @@ const metaInfoData = {
defaultTest() defaultTest()
if (side === 'client') { if (side === 'client') {
expect(attributeMap).toEqual({ bodyAttrs: { expect(attributeMap).toEqual({
foo: { ssr: 'bar' }, bodyAttrs: {
fizz: { ssr: ['fuzz', 'fozz'] } foo: { ssr: 'bar' },
} }) fizz: { ssr: ['fuzz', 'fozz'] }
}
})
} }
} }
} }