Skip to content

Commit

Permalink
Update ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Oct 28, 2023
1 parent 35c10af commit 61017cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/class-collision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
const nodeStartLine = node.loc.start.line
const nodeEndLine = node.loc.end.line
const ruleOfClass = {}

console.log(classNames)
classNames
.forEach(eachClassName => {
ruleOfClass[eachClassName] = createValidRules(eachClassName, { config })[0]
Expand Down
3 changes: 0 additions & 3 deletions packages/eslint-plugin/src/utils/are-declarations-equal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ export default function areDeclarationsEqual(aDeclarations, bDeclarations) {
if (!Object.prototype.hasOwnProperty.call(bDeclarations, key)) {
return false
}
if (aDeclarations[key] !== bDeclarations[key]) {
return false
}
}

// 如果所有属性都匹配,返回true
Expand Down
7 changes: 4 additions & 3 deletions packages/eslint-plugin/src/utils/define-visitors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { RuleListener } from '@typescript-eslint/utils/ts-eslint'
import { Rule } from 'eslint'

export default function defineVisitors({ context, settings }: any, visitNode) {
export default function defineVisitors({ context, settings }: { context: Rule.RuleContext, settings: any }, visitNode) {

const isFnNode = (node) => {
let calleeName = ''
Expand Down Expand Up @@ -70,9 +71,9 @@ export default function defineVisitors({ context, settings }: any, visitNode) {
},
}

if (context.parserServices == null || context.parserServices.defineTemplateBodyVisitor == null) {
if (context.sourceCode.parserServices == null || context.sourceCode.parserServices.defineTemplateBodyVisitor == null) {
return scriptVisitor
} else {
return context.parserServices.defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor)
return context.sourceCode.parserServices.defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor)
}
}

0 comments on commit 61017cc

Please sign in to comment.