eslint-plugin-vue
Advanced tools
Comparing version 9.26.0 to 9.27.0
@@ -9,2 +9,3 @@ /* | ||
{ | ||
name: 'vue:base:setup', | ||
plugins: { | ||
@@ -21,2 +22,3 @@ get vue() { | ||
{ | ||
name: 'vue:base:setup-for-vue', | ||
files: ['*.vue', '**/*.vue'], | ||
@@ -23,0 +25,0 @@ plugins: { |
@@ -12,2 +12,3 @@ /* | ||
{ | ||
name: 'vue:vue2-essential:rules', | ||
rules: { | ||
@@ -14,0 +15,0 @@ 'vue/multi-word-component-names': 'error', |
@@ -12,2 +12,3 @@ /* | ||
{ | ||
name: 'vue:vue2-recommended:rules', | ||
rules: { | ||
@@ -14,0 +15,0 @@ 'vue/attributes-order': 'warn', |
@@ -12,2 +12,3 @@ /* | ||
{ | ||
name: 'vue:vue2-strongly-recommended:rules', | ||
rules: { | ||
@@ -14,0 +15,0 @@ 'vue/attribute-hyphenation': 'warn', |
@@ -12,2 +12,3 @@ /* | ||
{ | ||
name: 'vue:essential:rules', | ||
rules: { | ||
@@ -14,0 +15,0 @@ 'vue/multi-word-component-names': 'error', |
@@ -12,2 +12,3 @@ /* | ||
{ | ||
name: 'vue:recommended:rules', | ||
rules: { | ||
@@ -14,0 +15,0 @@ 'vue/attributes-order': 'warn', |
@@ -12,2 +12,3 @@ /* | ||
{ | ||
name: 'vue:strongly-recommended:rules', | ||
rules: { | ||
@@ -14,0 +15,0 @@ 'vue/attribute-hyphenation': 'warn', |
@@ -54,3 +54,3 @@ /** | ||
{ not: { type: 'string', pattern: ':exit$' } }, | ||
{ not: { type: 'string', pattern: '^\\s*$' } } | ||
{ not: { type: 'string', pattern: String.raw`^\s*$` } } | ||
] | ||
@@ -57,0 +57,0 @@ }, |
@@ -65,3 +65,3 @@ /** | ||
{ not: { type: 'string', pattern: ':exit$' } }, | ||
{ not: { type: 'string', pattern: '^\\s*$' } } | ||
{ not: { type: 'string', pattern: String.raw`^\s*$` } } | ||
] | ||
@@ -68,0 +68,0 @@ }, |
@@ -16,5 +16,5 @@ 'use strict' | ||
}, | ||
schema: [], | ||
deprecated: true, | ||
replacedBy: ['valid-model-definition'] | ||
replacedBy: ['valid-model-definition'], | ||
schema: [] | ||
}, | ||
@@ -21,0 +21,0 @@ /** @param {RuleContext} context */ |
@@ -158,3 +158,3 @@ /** | ||
.slice(1, -1) | ||
.replace(/'/gu, "\\'")}${ | ||
.replace(/'/gu, String.raw`\'`)}${ | ||
sourceCode.text[nameWithLoc.range[1] - 1] | ||
@@ -161,0 +161,0 @@ }` |
@@ -82,3 +82,4 @@ /** | ||
rightNode.type !== 'MemberExpression' && | ||
rightNode.type !== 'ConditionalExpression' | ||
rightNode.type !== 'ConditionalExpression' && | ||
rightNode.type !== 'TemplateLiteral' | ||
) { | ||
@@ -88,4 +89,19 @@ return | ||
/** @type {Expression | Super} */ | ||
let rightId = rightNode | ||
if (rightNode.type === 'TemplateLiteral') { | ||
rightNode.expressions.some((expression) => | ||
checkMemberAccess(expression, propsReferences, left, right) | ||
) | ||
} else { | ||
checkMemberAccess(rightNode, propsReferences, left, right) | ||
} | ||
} | ||
/** | ||
* @param {Expression | Super} rightId | ||
* @param {ScopePropsReferences} propsReferences | ||
* @param {Pattern} left | ||
* @param {Expression} right | ||
* @return {boolean} | ||
*/ | ||
function checkMemberAccess(rightId, propsReferences, left, right) { | ||
while (rightId.type === 'MemberExpression') { | ||
@@ -96,2 +112,3 @@ rightId = utils.skipChainExpression(rightId.object) | ||
report(left, 'getProperty', propsReferences.scopeName) | ||
return true | ||
} | ||
@@ -105,3 +122,5 @@ if ( | ||
report(right, 'getProperty', propsReferences.scopeName) | ||
return true | ||
} | ||
return false | ||
} | ||
@@ -108,0 +127,0 @@ |
@@ -109,5 +109,5 @@ /** | ||
const options = context.options[0] || {} | ||
const ignores = /** @type {string[]} */ (options.ignores || ['/^\\$/']).map( | ||
toRegExp | ||
) | ||
const ignores = /** @type {string[]} */ ( | ||
options.ignores || [String.raw`/^\$/`] | ||
).map(toRegExp) | ||
const propertyReferenceExtractor = definePropertyReferenceExtractor(context) | ||
@@ -114,0 +114,0 @@ const programNode = context.getSourceCode().ast |
@@ -262,2 +262,3 @@ /** | ||
/** | ||
* @param {RuleFixer} fixer | ||
* @param {Property} propertyNode | ||
@@ -264,0 +265,0 @@ * @param {Property} unorderedPropertyNode |
@@ -9,2 +9,16 @@ /** | ||
/** | ||
* @param {VDirective} vBindAppear | ||
*/ | ||
function isValidBindAppear(vBindAppear) { | ||
if ( | ||
vBindAppear.value?.expression && | ||
vBindAppear.value.expression.type === 'Literal' | ||
) { | ||
return vBindAppear.value.expression?.value !== false | ||
} | ||
return true | ||
} | ||
module.exports = { | ||
@@ -39,3 +53,7 @@ meta: { | ||
const parent = element.parent | ||
if (utils.hasAttribute(parent, 'appear')) { | ||
const vBindAppear = utils.getDirective(parent, 'bind', 'appear') | ||
if ( | ||
utils.hasAttribute(parent, 'appear') || | ||
(vBindAppear && isValidBindAppear(vBindAppear)) | ||
) { | ||
return | ||
@@ -42,0 +60,0 @@ } |
@@ -35,3 +35,3 @@ /** | ||
{ not: { type: 'string', pattern: ':exit$' } }, | ||
{ not: { type: 'string', pattern: '^\\s*$' } } | ||
{ not: { type: 'string', pattern: String.raw`^\s*$` } } | ||
] | ||
@@ -38,0 +38,0 @@ }, |
@@ -31,4 +31,4 @@ /** | ||
}, | ||
schema: [], | ||
deprecated: true | ||
deprecated: true, | ||
schema: [] | ||
}, | ||
@@ -35,0 +35,0 @@ /** |
@@ -33,3 +33,3 @@ 'use strict' | ||
{ not: { type: 'string', pattern: ':exit$' } }, | ||
{ not: { type: 'string', pattern: '^\\s*$' } } | ||
{ not: { type: 'string', pattern: String.raw`^\s*$` } } | ||
] | ||
@@ -36,0 +36,0 @@ }, |
@@ -74,2 +74,4 @@ /** | ||
fixable: 'code', | ||
deprecated: true, | ||
replacedBy: ['v-on-handler-style'], | ||
schema: [ | ||
@@ -91,5 +93,3 @@ { enum: ['always', 'never'] }, | ||
"Method calls without arguments inside of 'v-on' directives must not have parentheses." | ||
}, | ||
deprecated: true, | ||
replacedBy: ['v-on-handler-style'] | ||
} | ||
}, | ||
@@ -96,0 +96,0 @@ /** @param {RuleContext} context */ |
@@ -15,3 +15,3 @@ const RE_REGEXP_CHAR = /[\\^$.*+?()[\]{}|]/gu | ||
return string && RE_HAS_REGEXP_CHAR.test(string) | ||
? string.replace(RE_REGEXP_CHAR, '\\$&') | ||
? string.replace(RE_REGEXP_CHAR, String.raw`\$&`) | ||
: string | ||
@@ -18,0 +18,0 @@ } |
@@ -15,2 +15,3 @@ [ | ||
"Raw", | ||
"Reactive", | ||
"ReactiveEffect", | ||
@@ -17,0 +18,0 @@ "ReactiveEffectOptions", |
{ | ||
"name": "eslint-plugin-vue", | ||
"version": "9.26.0", | ||
"version": "9.27.0", | ||
"description": "Official ESLint plugin for Vue.js", | ||
@@ -64,8 +64,8 @@ "main": "lib/index.js", | ||
"semver": "^7.6.0", | ||
"vue-eslint-parser": "^9.4.2", | ||
"vue-eslint-parser": "^9.4.3", | ||
"xml-name-validator": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@ota-meshi/site-kit-eslint-editor-vue": "^0.1.2", | ||
"@stylistic/eslint-plugin": "^1.6.1", | ||
"@ota-meshi/site-kit-eslint-editor-vue": "^0.2.0", | ||
"@stylistic/eslint-plugin": "^2.2.2", | ||
"@types/eslint": "^8.56.2", | ||
@@ -77,21 +77,22 @@ "@types/eslint-visitor-keys": "^3.3.0", | ||
"@types/xml-name-validator": "^4.0.3", | ||
"@typescript-eslint/parser": "^7.0.1", | ||
"@typescript-eslint/types": "^7.0.1", | ||
"@typescript-eslint/parser": "^7.13.1", | ||
"@typescript-eslint/types": "^7.13.1", | ||
"assert": "^2.1.0", | ||
"env-cmd": "^10.1.0", | ||
"esbuild": "^0.20.0", | ||
"esbuild": "^0.21.5", | ||
"eslint": "^8.56.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-eslint-plugin": "~5.3.0", | ||
"eslint-plugin-eslint-plugin": "~6.1.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-jsonc": "^2.13.0", | ||
"eslint-plugin-node-dependencies": "^0.11.2", | ||
"eslint-plugin-node-dependencies": "^0.12.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-unicorn": "^51.0.1", | ||
"eslint-plugin-unicorn": "^54.0.0", | ||
"eslint-plugin-vue": "file:.", | ||
"espree": "^9.6.1", | ||
"events": "^3.3.0", | ||
"markdownlint-cli": "^0.39.0", | ||
"markdownlint-cli": "^0.41.0", | ||
"mocha": "^10.3.0", | ||
"nyc": "^15.1.0", | ||
"nyc": "^17.0.0", | ||
"pathe": "^1.1.2", | ||
"prettier": "^3.2.5", | ||
@@ -98,0 +99,0 @@ "typescript": "^5.3.3", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1340023
43821
31
Updatedvue-eslint-parser@^9.4.3