Skip to content

Commit 2a6be72

Browse files
authored
Merge branch 'master' into prefer-define-component
2 parents 94b6915 + 31b30c4 commit 2a6be72

File tree

8 files changed

+111
-9
lines changed

8 files changed

+111
-9
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config/schema.json",
3+
"changelog": [
4+
"@svitejs/changesets-changelog-github-compact",
5+
{
6+
"repo": "vuejs/eslint-plugin-vue"
7+
}
8+
],
9+
"commit": false,
10+
"linked": [],
11+
"access": "public",
12+
"baseBranch": "master",
13+
"bumpVersionsWithWorkspaceProtocolOnly": true,
14+
"ignore": []
15+
}

.changeset/grumpy-humans-tickle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-vue": patch
3+
---
4+
5+
Updates resources

.github/workflows/Release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions: {}
9+
10+
jobs:
11+
release:
12+
# prevents this action from running on forks
13+
if: github.repository == 'vuejs/eslint-plugin-vue'
14+
permissions:
15+
contents: write # to create release (changesets/action)
16+
pull-requests: write # to create pull request (changesets/action)
17+
name: Release
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout Repo
21+
uses: actions/checkout@v4
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
- name: Install Dependencies
25+
run: npm install -f
26+
27+
- name: Create Release Pull Request or Publish to npm
28+
id: changesets
29+
uses: changesets/action@v1
30+
with:
31+
version: npm run changeset:version
32+
publish: npm run changeset:publish
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

docs/rules/define-props-destructuring.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ pageClass: rule-details
33
sidebarDepth: 0
44
title: vue/define-props-destructuring
55
description: enforce consistent style for props destructuring
6+
since: v10.1.0
67
---
78

89
# vue/define-props-destructuring
910

1011
> enforce consistent style for props destructuring
1112
12-
- :exclamation: <badge text="This rule has not been released yet." vertical="middle" type="error"> _**This rule has not been released yet.**_ </badge>
13-
1413
## :book: Rule Details
1514

1615
This rule enforces a consistent style for handling Vue 3 Composition API props, allowing you to choose between requiring destructuring or prohibiting it.
@@ -89,6 +88,10 @@ The rule applies to both JavaScript and TypeScript props:
8988

9089
- [Reactive Props Destructure](https://vuejs.org/guide/components/props.html#reactive-props-destructure)
9190

91+
## :rocket: Version
92+
93+
This rule was introduced in eslint-plugin-vue v10.1.0
94+
9295
## :mag: Implementation
9396

9497
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/define-props-destructuring.js)

lib/utils/vue3-export-names.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@
235235
"AsyncComponentOptions",
236236
"defineAsyncComponent",
237237
"useModel",
238+
"TemplateRef",
238239
"useTemplateRef",
239240
"useId",
240241
"h",
@@ -263,8 +264,8 @@
263264
"devtools",
264265
"setDevtoolsHook",
265266
"DeprecationTypes",
266-
"WatchOptionsBase",
267267
"createElementVNode",
268+
"WatchOptionsBase",
268269
"TransitionProps",
269270
"Transition",
270271
"TransitionGroupProps",

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-vue",
3-
"version": "10.0.1",
3+
"version": "10.1.0",
44
"description": "Official ESLint plugin for Vue.js",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
@@ -18,12 +18,15 @@
1818
"lint:fix": "eslint . --fix && markdownlint \"**/*.md\" --fix",
1919
"tsc": "tsc",
2020
"preversion": "npm test && git add .",
21-
"version": "env-cmd -e version npm run update && npm run lint -- --fix && git add .",
21+
"version": "npm run generate:version && git add .",
2222
"update": "node ./tools/update.js",
2323
"update-resources": "node ./tools/update-resources.js",
2424
"docs:watch": "vitepress dev docs",
2525
"predocs:build": "npm run update",
26-
"docs:build": "vitepress build docs"
26+
"docs:build": "vitepress build docs",
27+
"generate:version": "env-cmd -e version npm run update && npm run lint -- --fix",
28+
"changeset:version": "changeset version && npm run generate:version && git add --all",
29+
"changeset:publish": "changeset publish"
2730
},
2831
"files": [
2932
"lib"
@@ -66,8 +69,10 @@
6669
"xml-name-validator": "^4.0.0"
6770
},
6871
"devDependencies": {
72+
"@changesets/cli": "^2.29.2",
6973
"@ota-meshi/site-kit-eslint-editor-vue": "^0.2.4",
7074
"@stylistic/eslint-plugin": "^2.12.1",
75+
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
7176
"@types/eslint": "^8.56.2",
7277
"@types/natural-compare": "^1.4.3",
7378
"@types/node": "^14.18.63",

tests/lib/rules/eqeqeq.js

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
*/
44
'use strict'
55

6-
const RuleTester = require('../../eslint-compat').RuleTester
6+
const semver = require('semver')
7+
const { RuleTester, ESLint } = require('../../eslint-compat')
78
const rule = require('../../../lib/rules/eqeqeq')
89

910
const tester = new RuleTester({
@@ -24,7 +25,19 @@ tester.run('eqeqeq', rule, {
2425
invalid: [
2526
{
2627
code: '<template><div :attr="a == 1" /></template>',
27-
errors: ["Expected '===' and instead saw '=='."]
28+
errors: [
29+
{
30+
message: "Expected '===' and instead saw '=='.",
31+
suggestions: semver.gte(ESLint.version, '9.26.0')
32+
? [
33+
{
34+
desc: "Use '===' instead of '=='.",
35+
output: `<template><div :attr="a === 1" /></template>`
36+
}
37+
]
38+
: null
39+
}
40+
]
2841
},
2942
// CSS vars injection
3043
{
@@ -34,7 +47,24 @@ tester.run('eqeqeq', rule, {
3447
color: v-bind(a == 1 ? 'red' : 'blue')
3548
}
3649
</style>`,
37-
errors: ["Expected '===' and instead saw '=='."]
50+
errors: [
51+
{
52+
message: "Expected '===' and instead saw '=='.",
53+
suggestions: semver.gte(ESLint.version, '9.26.0')
54+
? [
55+
{
56+
desc: "Use '===' instead of '=='.",
57+
output: `
58+
<style>
59+
.text {
60+
color: v-bind(a === 1 ? 'red' : 'blue')
61+
}
62+
</style>`
63+
}
64+
]
65+
: null
66+
}
67+
]
3868
}
3969
]
4070
})

0 commit comments

Comments
 (0)