|
6 | 6 |
|
7 | 7 | const utils = require('../utils')
|
8 | 8 | 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') |
16 | 10 | /**
|
17 | 11 | * @typedef {import('../utils').ComponentEmit} ComponentEmit
|
18 | 12 | * @typedef {import('../utils').ComponentProp} ComponentProp
|
@@ -67,26 +61,14 @@ module.exports = {
|
67 | 61 | },
|
68 | 62 | fixable: null,
|
69 | 63 | hasSuggestions: false,
|
70 |
| - schema: [ |
71 |
| - { |
72 |
| - type: 'object', |
73 |
| - properties: { |
74 |
| - allowProps: { |
75 |
| - type: 'boolean' |
76 |
| - } |
77 |
| - }, |
78 |
| - additionalProperties: false |
79 |
| - } |
80 |
| - ], |
| 64 | + schema: [], |
81 | 65 | messages: {
|
82 | 66 | 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.' |
84 | 68 | }
|
85 | 69 | },
|
86 | 70 | /** @param {RuleContext} context */
|
87 | 71 | create(context) {
|
88 |
| - const options = context.options[0] || {} |
89 |
| - const allowProps = !!options.allowProps |
90 | 72 | /** @type {Map<ObjectExpression | Program, { contextReferenceIds: Set<Identifier>, emitReferenceIds: Set<Identifier> }>} */
|
91 | 73 | const setupContexts = new Map()
|
92 | 74 |
|
@@ -267,11 +249,6 @@ module.exports = {
|
267 | 249 | emitReferenceIds
|
268 | 250 | })
|
269 | 251 | },
|
270 |
| - onDefinePropsEnter: (node, props) => { |
271 |
| - if (allowProps) { |
272 |
| - // TODO: verify props |
273 |
| - } |
274 |
| - }, |
275 | 252 | ...callVisitor
|
276 | 253 | }),
|
277 | 254 | utils.defineVueVisitor(context, {
|
@@ -345,11 +322,6 @@ module.exports = {
|
345 | 322 | onVueObjectEnter(node) {
|
346 | 323 | const emits = utils.getComponentEmitsFromOptions(node)
|
347 | 324 | verifyEmitDeclaration(emits)
|
348 |
| - |
349 |
| - if (allowProps) { |
350 |
| - // TODO: verify props |
351 |
| - // utils.getComponentPropsFromOptions(node) |
352 |
| - } |
353 | 325 | },
|
354 | 326 | onVueObjectExit(node, { type }) {
|
355 | 327 | if (
|
|
0 commit comments