Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'use strict'

module.exports = {
meta: require('./meta'),
rules: {
'array-bracket-newline': require('./rules/array-bracket-newline'),
'array-bracket-spacing': require('./rules/array-bracket-spacing'),
Expand Down
3 changes: 3 additions & 0 deletions lib/meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict'
const { name, version } = require('../package.json')
module.exports = { name, version }
5 changes: 1 addition & 4 deletions lib/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@ module.exports = {

supportsAutofix: true,

meta: {
name: 'eslint-plugin-vue',
version: require('../package.json').version
}
meta: require('./meta')
}

/**
Expand Down
20 changes: 20 additions & 0 deletions tests/lib/meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict'

const assert = require('assert')
const plugin = require('../..')
const expectedMeta = {
name: 'eslint-plugin-vue',
version: require('../../package.json').version
}

describe('Test for meta object', () => {
it('A plugin should have a meta object.', () => {
assert.deepStrictEqual(plugin.meta, expectedMeta)
})

for (const [name, processor] of Object.entries(plugin.processors)) {
it(`"${name}" processor should have a meta object.`, () => {
assert.deepStrictEqual(processor.meta, expectedMeta)
})
}
})
1 change: 1 addition & 0 deletions tools/update-lib-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const content = `/*
'use strict'

module.exports = {
meta: require('./meta'),
rules: {
${rules
.map((rule) => `'${rule.name}': require('./rules/${rule.name}')`)
Expand Down