diff --git a/lib/rules/attribute-hyphenation.js b/lib/rules/attribute-hyphenation.js index 45e7ca687..4b6084f20 100644 --- a/lib/rules/attribute-hyphenation.js +++ b/lib/rules/attribute-hyphenation.js @@ -75,7 +75,7 @@ module.exports = { }, /** @param {RuleContext} context */ create(context) { - const sourceCode = context.getSourceCode() + const sourceCode = context.sourceCode const option = context.options[0] const optionsPayload = context.options[1] const useHyphenated = option !== 'never' diff --git a/lib/rules/attributes-order.js b/lib/rules/attributes-order.js index 8fe461004..94b9cccdb 100644 --- a/lib/rules/attributes-order.js +++ b/lib/rules/attributes-order.js @@ -222,7 +222,7 @@ function isAlphabetical(prevNode, currNode, sourceCode) { * @returns {RuleListener} AST event handlers. */ function create(context) { - const sourceCode = context.getSourceCode() + const sourceCode = context.sourceCode const otherAttrs = [ ATTRS.ATTR_DYNAMIC, ATTRS.ATTR_STATIC, diff --git a/lib/rules/block-order.js b/lib/rules/block-order.js index d4fdb62ea..39bd4c6e3 100644 --- a/lib/rules/block-order.js +++ b/lib/rules/block-order.js @@ -106,7 +106,7 @@ module.exports = { function getOrderElement(element) { return orders.find((o) => o.selector.test(element)) } - const sourceCode = context.getSourceCode() + const sourceCode = context.sourceCode const documentFragment = sourceCode.parserServices.getDocumentFragment && sourceCode.parserServices.getDocumentFragment() @@ -129,7 +129,6 @@ module.exports = { const order = getOrderElement(element) return order ? [{ order, element }] : [] }) - const sourceCode = context.getSourceCode() for (const [index, elementWithOrders] of elementsWithOrder.entries()) { const { order: expected, element } = elementWithOrders const firstUnordered = elementsWithOrder diff --git a/lib/rules/block-tag-newline.js b/lib/rules/block-tag-newline.js index 22fb12870..1ccf45814 100644 --- a/lib/rules/block-tag-newline.js +++ b/lib/rules/block-tag-newline.js @@ -84,7 +84,7 @@ module.exports = { }, /** @param {RuleContext} context */ create(context) { - const sourceCode = context.getSourceCode() + const sourceCode = context.sourceCode const df = sourceCode.parserServices.getDocumentFragment && sourceCode.parserServices.getDocumentFragment() diff --git a/lib/rules/comment-directive.js b/lib/rules/comment-directive.js index 655e222bd..f1ec64e34 100644 --- a/lib/rules/comment-directive.js +++ b/lib/rules/comment-directive.js @@ -214,7 +214,7 @@ function reportUnused(context, comment, kind) { * @returns { { ruleId: string, key: string }[] } */ function reportUnusedRules(context, comment, kind, rules) { - const sourceCode = context.getSourceCode() + const sourceCode = context.sourceCode const commentStart = comment.range[0] + 4 /*