Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend API for directives and attributes #49

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ module.exports = {
],
'prefer-destructuring': 'error',
'import/extensions': 'off',
'no-underscore-dangle': 'off',
'import/newline-after-import': ['error', { count: 1 }],
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
'import/no-extraneous-dependencies': [
Expand Down Expand Up @@ -78,7 +79,7 @@ module.exports = {
},
],
'import/prefer-default-export': 'off',
'jest/no-disabled-tests': 'error',
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'error',
Expand Down
24 changes: 24 additions & 0 deletions src/shims/compiler-core.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type { Node as VueNode, ExpressionNode } from '@vue/compiler-core'

declare module '@vue/compiler-core' {
interface ForNodeParams {
element: ElementNode
isTemplateFor: boolean
}
interface ForDirectiveParams {
index?: ExpressionNode
key?: ExpressionNode
value?: ExpressionNode
source: ExpressionNode
}

interface Node {
sfcmodMeta?: {
isGenerated?: boolean
shorthand?: boolean
forNode?: ForNodeParams
forDirective?: ForDirectiveParams
}
}
}
Loading
Loading