Skip to content

Commit 892f277

Browse files
committed
clean up
1 parent fe3615d commit 892f277

File tree

1 file changed

+3
-31
lines changed

1 file changed

+3
-31
lines changed

lib/rules/no-shadow-native-events.js

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@
66

77
const utils = require('../utils')
88
const domEvents = require('../utils/dom-events.json')
9-
const { capitalize } = require('../utils/casing.js')
10-
const {
11-
findVariable,
12-
isOpeningBraceToken,
13-
isClosingBraceToken,
14-
isOpeningBracketToken
15-
} = require('@eslint-community/eslint-utils')
9+
const { findVariable } = require('@eslint-community/eslint-utils')
1610
/**
1711
* @typedef {import('../utils').ComponentEmit} ComponentEmit
1812
* @typedef {import('../utils').ComponentProp} ComponentProp
@@ -67,26 +61,14 @@ module.exports = {
6761
},
6862
fixable: null,
6963
hasSuggestions: false,
70-
schema: [
71-
{
72-
type: 'object',
73-
properties: {
74-
allowProps: {
75-
type: 'boolean'
76-
}
77-
},
78-
additionalProperties: false
79-
}
80-
],
64+
schema: [],
8165
messages: {
8266
violation:
83-
'Use a different emit name to avoid shadowing native events: {{ name }}.'
67+
'Use a different emit name to avoid shadowing the native event with name "{{ name }}". Consider an emit name which communicates the users intent, if applicable.'
8468
}
8569
},
8670
/** @param {RuleContext} context */
8771
create(context) {
88-
const options = context.options[0] || {}
89-
const allowProps = !!options.allowProps
9072
/** @type {Map<ObjectExpression | Program, { contextReferenceIds: Set<Identifier>, emitReferenceIds: Set<Identifier> }>} */
9173
const setupContexts = new Map()
9274

@@ -267,11 +249,6 @@ module.exports = {
267249
emitReferenceIds
268250
})
269251
},
270-
onDefinePropsEnter: (node, props) => {
271-
if (allowProps) {
272-
// TODO: verify props
273-
}
274-
},
275252
...callVisitor
276253
}),
277254
utils.defineVueVisitor(context, {
@@ -345,11 +322,6 @@ module.exports = {
345322
onVueObjectEnter(node) {
346323
const emits = utils.getComponentEmitsFromOptions(node)
347324
verifyEmitDeclaration(emits)
348-
349-
if (allowProps) {
350-
// TODO: verify props
351-
// utils.getComponentPropsFromOptions(node)
352-
}
353325
},
354326
onVueObjectExit(node, { type }) {
355327
if (

0 commit comments

Comments
 (0)