Skip to content

Fix: don't use internal APIs of ESLint (fixes #171) #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 3, 2017
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
6 changes: 3 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ machine:

dependencies:
pre:
- nvm install 7
- nvm install 6
- nvm install 8

test:
override:
- npm test
- nvm use 4 && npm test
- nvm use 6 && npm test
- nvm use 7 && npm test
- nvm use 8 && npm test
- nvm use 8 && npm i [email protected] --no-save && npm run -s test:base
4 changes: 1 addition & 3 deletions lib/rules/attribute-hyphenation.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function create (context) {
// Public
// ----------------------------------------------------------------------

utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
VAttribute (node) {
if (!utils.isCustomComponent(node.parent.parent)) return

Expand All @@ -53,8 +53,6 @@ function create (context) {
reportIssue(node, name)
}
})

return {}
}

module.exports = {
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/html-end-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const utils = require('../utils')
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
VElement (node) {
const name = node.name
const isVoid = utils.isHtmlVoidElementName(name)
Expand All @@ -48,8 +48,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/html-no-self-closing.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const utils = require('../utils')
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
'VElement' (node) {
if (utils.isSvgElementNode(node)) {
return
Expand All @@ -42,8 +42,6 @@ function create (context) {
})
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/html-quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function create (context) {
const quoteChar = double ? '"' : "'"
const quoteName = double ? 'double quotes' : 'single quotes'

utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
'VAttribute[value!=null]' (node) {
const text = sourceCode.getText(node.value)
const firstChar = text[0]
Expand All @@ -41,8 +41,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/html-self-closing.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function create (context) {
const sourceCode = context.getSourceCode()
const options = parseOptions(context.options[0])

utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
'VElement' (node) {
const elementType = getElementType(node)
const mode = options[elementType]
Expand Down Expand Up @@ -132,8 +132,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/max-attributes-per-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = {
const singlelinemMaximum = configuration.singleline
const canHaveFirstLine = configuration.allowFirstLine

utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
'VStartTag' (node) {
const numberOfAttributes = node.attributes.length

Expand Down Expand Up @@ -155,7 +155,5 @@ module.exports = {

return propsPerLine
}

return {}
}
}
4 changes: 1 addition & 3 deletions lib/rules/mustache-interpolation-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = {
// Public
// ----------------------------------------------------------------------

utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
'VExpressionContainer[expression!=null]' (node) {
const tokens = template.getTokens(node, {
includeComments: true,
Expand All @@ -85,7 +85,5 @@ module.exports = {
}
}
})

return { }
}
}
4 changes: 1 addition & 3 deletions lib/rules/no-confusing-v-for-v-if.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function isUsingIterationVar (vIf) {
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name='if']" (node) {
const element = node.parent.parent

Expand All @@ -50,8 +50,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-duplicate-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function create (context) {
return directiveNames.has(name) || attributeNames.has(name)
}

utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
'VStartTag' () {
directiveNames.clear()
attributeNames.clear()
Expand All @@ -78,8 +78,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-invalid-v-bind.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const VALID_MODIFIERS = new Set(['prop', 'camel', 'sync'])
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name='bind']" (node) {
for (const modifier of node.key.modifiers) {
if (!VALID_MODIFIERS.has(modifier)) {
Expand All @@ -46,8 +46,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-invalid-v-cloak.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const utils = require('../utils')
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name='cloak']" (node) {
if (node.key.argument) {
context.report({
Expand All @@ -47,8 +47,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-invalid-v-else-if.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const utils = require('../utils')
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name='else-if']" (node) {
const element = node.parent.parent

Expand Down Expand Up @@ -70,8 +70,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-invalid-v-else.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const utils = require('../utils')
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name='else']" (node) {
const element = node.parent.parent

Expand Down Expand Up @@ -70,8 +70,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-invalid-v-for.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function checkKey (context, vFor, element) {
function create (context) {
const sourceCode = context.getSourceCode()

utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name='for']" (node) {
const element = node.parent.parent

Expand Down Expand Up @@ -151,8 +151,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-invalid-v-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const utils = require('../utils')
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name='html']" (node) {
if (node.key.argument) {
context.report({
Expand All @@ -47,8 +47,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-invalid-v-if.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const utils = require('../utils')
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name='if']" (node) {
const element = node.parent.parent

Expand Down Expand Up @@ -63,8 +63,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-invalid-v-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function getVariable (name, leafNode) {
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name='model']" (node) {
const element = node.parent.parent
const name = element.name
Expand Down Expand Up @@ -164,8 +164,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-invalid-v-on.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const VERB_MODIFIERS = new Set([
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name='on']" (node) {
for (const modifier of node.key.modifiers) {
if (!VALID_MODIFIERS.has(modifier) && !Number.isInteger(parseInt(modifier, 10))) {
Expand All @@ -52,8 +52,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-invalid-v-once.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const utils = require('../utils')
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name='once']" (node) {
if (node.key.argument) {
context.report({
Expand All @@ -47,8 +47,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-invalid-v-pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const utils = require('../utils')
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name='pre']" (node) {
if (node.key.argument) {
context.report({
Expand All @@ -47,8 +47,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-invalid-v-show.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const utils = require('../utils')
* @returns {Object} AST event handlers.
*/
function create (context) {
utils.registerTemplateBodyVisitor(context, {
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name='show']" (node) {
if (node.key.argument) {
context.report({
Expand All @@ -47,8 +47,6 @@ function create (context) {
}
}
})

return {}
}

// ------------------------------------------------------------------------------
Expand Down
Loading