Skip to content

Commit 76c51ac

Browse files
9romiseFloEdelmann
andauthored
chore: remove ESLint compatibility code (#2965)
Co-authored-by: Flo Edelmann <[email protected]>
1 parent 58e2197 commit 76c51ac

File tree

102 files changed

+163
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+163
-213
lines changed

lib/rules/attribute-hyphenation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ module.exports = {
7575
},
7676
/** @param {RuleContext} context */
7777
create(context) {
78-
const sourceCode = context.getSourceCode()
78+
const sourceCode = context.sourceCode
7979
const option = context.options[0]
8080
const optionsPayload = context.options[1]
8181
const useHyphenated = option !== 'never'

lib/rules/attributes-order.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ function isAlphabetical(prevNode, currNode, sourceCode) {
222222
* @returns {RuleListener} AST event handlers.
223223
*/
224224
function create(context) {
225-
const sourceCode = context.getSourceCode()
225+
const sourceCode = context.sourceCode
226226
const otherAttrs = [
227227
ATTRS.ATTR_DYNAMIC,
228228
ATTRS.ATTR_STATIC,

lib/rules/block-order.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ module.exports = {
106106
function getOrderElement(element) {
107107
return orders.find((o) => o.selector.test(element))
108108
}
109-
const sourceCode = context.getSourceCode()
109+
const sourceCode = context.sourceCode
110110
const documentFragment =
111111
sourceCode.parserServices.getDocumentFragment &&
112112
sourceCode.parserServices.getDocumentFragment()
@@ -129,7 +129,6 @@ module.exports = {
129129
const order = getOrderElement(element)
130130
return order ? [{ order, element }] : []
131131
})
132-
const sourceCode = context.getSourceCode()
133132
for (const [index, elementWithOrders] of elementsWithOrder.entries()) {
134133
const { order: expected, element } = elementWithOrders
135134
const firstUnordered = elementsWithOrder

lib/rules/block-tag-newline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ module.exports = {
8484
},
8585
/** @param {RuleContext} context */
8686
create(context) {
87-
const sourceCode = context.getSourceCode()
87+
const sourceCode = context.sourceCode
8888
const df =
8989
sourceCode.parserServices.getDocumentFragment &&
9090
sourceCode.parserServices.getDocumentFragment()

lib/rules/comment-directive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function reportUnused(context, comment, kind) {
214214
* @returns { { ruleId: string, key: string }[] }
215215
*/
216216
function reportUnusedRules(context, comment, kind, rules) {
217-
const sourceCode = context.getSourceCode()
217+
const sourceCode = context.sourceCode
218218
const commentStart = comment.range[0] + 4 /* <!-- */
219219

220220
return rules.map((rule) => {
@@ -313,7 +313,7 @@ module.exports = {
313313
const options = context.options[0] || {}
314314
/** @type {boolean} */
315315
const reportUnusedDisableDirectives = options.reportUnusedDisableDirectives
316-
const sourceCode = context.getSourceCode()
316+
const sourceCode = context.sourceCode
317317
const documentFragment =
318318
sourceCode.parserServices.getDocumentFragment &&
319319
sourceCode.parserServices.getDocumentFragment()

lib/rules/component-name-in-template-casing.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ module.exports = {
9595

9696
const isGlobalPattern = toRegExpGroupMatcher(globalPatterns)
9797
const registeredComponentsOnly = options.registeredComponentsOnly !== false
98-
const sourceCode = context.getSourceCode()
98+
const sourceCode = context.sourceCode
9999
const tokens =
100100
sourceCode.parserServices.getTemplateBodyTokenStore &&
101101
sourceCode.parserServices.getTemplateBodyTokenStore()
@@ -105,7 +105,7 @@ module.exports = {
105105

106106
if (utils.isScriptSetup(context)) {
107107
// For <script setup>
108-
const globalScope = context.getSourceCode().scopeManager.globalScope
108+
const globalScope = context.sourceCode.scopeManager.globalScope
109109
if (globalScope) {
110110
// Only check find the import module
111111
const moduleScope = globalScope.childScopes.find(

lib/rules/custom-event-name-casing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ module.exports = {
121121
})
122122
}
123123

124-
const programNode = context.getSourceCode().ast
124+
const programNode = context.sourceCode.ast
125125

126126
const callVisitor = {
127127
/**

lib/rules/define-macros-order.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function create(context) {
110110
return {}
111111
}
112112

113-
const sourceCode = context.getSourceCode()
113+
const sourceCode = context.sourceCode
114114
const options = context.options
115115
/** @type {[string, string]} */
116116
const order = (options[0] && options[0].order) || DEFAULT_ORDER

lib/rules/enforce-style-attribute.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ module.exports = {
8383

8484
/** @param {RuleContext} context */
8585
create(context) {
86-
const sourceCode = context.getSourceCode()
86+
const sourceCode = context.sourceCode
8787
if (!sourceCode.parserServices.getDocumentFragment) {
8888
return {}
8989
}

lib/rules/first-attribute-linebreak.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = {
3939
const multiline =
4040
(context.options[0] && context.options[0].multiline) || 'below'
4141

42-
const sourceCode = context.getSourceCode()
42+
const sourceCode = context.sourceCode
4343
const template =
4444
sourceCode.parserServices.getTemplateBodyTokenStore &&
4545
sourceCode.parserServices.getTemplateBodyTokenStore()

0 commit comments

Comments
 (0)