Skip to content

Commit 7cdf3ff

Browse files
authored
Merge branch 'master' into feature/#2465_autofix_in_define-props-declaration
2 parents 2a1c654 + c64bf94 commit 7cdf3ff

File tree

84 files changed

+1175
-1023
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1175
-1023
lines changed

docs/.vitepress/build-system/build.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Pre-build cjs packages that cannot be bundled well.
33
*/
44
import esbuild from 'esbuild'
5-
import path from 'path'
5+
import path from 'pathe'
66
import fs from 'fs'
77
import { fileURLToPath } from 'url'
88

docs/.vitepress/config.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { DefaultTheme } from 'vitepress'
22
import { defineConfig } from 'vitepress'
3-
import path from 'path'
3+
import path from 'pathe'
44
import { fileURLToPath } from 'url'
55
import { viteCommonjs, vitePluginRequireResolve } from './vite-plugin.mjs'
66

@@ -214,6 +214,10 @@ export default async () => {
214214
]
215215
},
216216

217+
outline: {
218+
level: 'deep'
219+
},
220+
217221
algolia: {
218222
appId: '2L4MGZSULB',
219223
apiKey: 'fdf57932b27a6c230d01a890492ab76d',

docs/.vitepress/vite-plugin.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { UserConfig } from 'vitepress'
2-
import path from 'path'
2+
import path from 'pathe'
33
import { fileURLToPath } from 'url'
44
import esbuild from 'esbuild'
55
type Plugin = Extract<

docs/rules/object-curly-newline.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ This rule was introduced in eslint-plugin-vue v7.0.0
3636
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/object-curly-newline.js)
3737
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/object-curly-newline.js)
3838

39-
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/js/object-curly-newline)</sup>
39+
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/ts/object-curly-newline)</sup>

docs/rules/object-property-newline.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ This rule was introduced in eslint-plugin-vue v7.0.0
3636
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/object-property-newline.js)
3737
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/object-property-newline.js)
3838

39-
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/js/object-property-newline)</sup>
39+
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/ts/object-property-newline)</sup>

docs/user-guide/index.md

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,48 @@ If you want to use custom parsers such as [@babel/eslint-parser](https://www.npm
146146
}
147147
```
148148

149+
Full example:
150+
151+
::: code-group
152+
153+
```json [.eslintrc]
154+
{
155+
"root": true,
156+
"plugins": ["@typescript-eslint"],
157+
"extends": [
158+
"eslint:recommended",
159+
"plugin:@typescript-eslint/recommended",
160+
"plugin:vue/vue3-recommended"
161+
],
162+
"parser": "vue-eslint-parser",
163+
"parserOptions": {
164+
"parser": "@typescript-eslint/parser"
165+
}
166+
}
167+
```
168+
169+
```js [eslint.config.js]
170+
import js from '@eslint/js'
171+
import eslintPluginVue from 'eslint-plugin-vue'
172+
import ts from 'typescript-eslint'
173+
174+
export default ts.config(
175+
js.configs.recommended,
176+
...ts.configs.recommended,
177+
...eslintPluginVue.configs['flat/recommended'],
178+
{
179+
files: ['*.vue', '**/*.vue'],
180+
languageOptions: {
181+
parserOptions: {
182+
parser: '@typescript-eslint/parser'
183+
}
184+
}
185+
}
186+
)
187+
```
188+
189+
:::
190+
149191
The `parserOptions.parser` option can also specify an object to specify multiple parsers. See [vue-eslint-parser README](https://github.com/vuejs/vue-eslint-parser#readme) for more details.
150192

151193
### How does ESLint detect components?
@@ -441,8 +483,7 @@ In [Nuxt 3](https://nuxt.com/) or with [`unplugin-auto-import`](https://github.c
441483

442484
::: code-group
443485

444-
```json [Legacy Config]
445-
// .eslintrc
486+
```json [.eslintrc]
446487
{
447488
"globals": {
448489
"ref": "readonly",
@@ -454,8 +495,7 @@ In [Nuxt 3](https://nuxt.com/) or with [`unplugin-auto-import`](https://github.c
454495
}
455496
```
456497

457-
```js [Flat Config]
458-
// eslint.config.js
498+
```js [eslint.config.js]
459499
export default [
460500
{
461501
languageOptions: {

eslint.config.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
'use strict'
22

33
const globals = require('globals')
4-
const { FlatCompat } = require('@eslint/eslintrc')
54
const eslintPluginEslintPlugin = require('eslint-plugin-eslint-plugin/configs/all')
5+
const eslintPluginJsonc = require('eslint-plugin-jsonc')
6+
const eslintPluginNodeDependencies = require('eslint-plugin-node-dependencies')
67
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended')
78
const eslintPluginUnicorn = require('eslint-plugin-unicorn')
89

9-
const eslintrc = new FlatCompat({
10-
baseDirectory: __dirname
11-
})
12-
1310
module.exports = [
1411
{
1512
ignores: [
@@ -30,10 +27,8 @@ module.exports = [
3027
},
3128
eslintPluginEslintPlugin,
3229
eslintPluginUnicorn.configs['flat/recommended'],
33-
...eslintrc.extends(
34-
'plugin:node-dependencies/recommended',
35-
'plugin:jsonc/recommended-with-jsonc'
36-
),
30+
...eslintPluginNodeDependencies.configs['flat/recommended'],
31+
...eslintPluginJsonc.configs['flat/recommended-with-jsonc'],
3732
eslintPluginPrettierRecommended,
3833
{
3934
plugins: {
@@ -144,6 +139,7 @@ module.exports = [
144139
'prefer-const': 2,
145140

146141
'prettier/prettier': 'error',
142+
'eslint-plugin/require-meta-docs-recommended': 'off', // use `categories` instead
147143
'eslint-plugin/require-meta-fixable': [
148144
'error',
149145
{ catchNoFixerButFixableProperty: true }

lib/configs/flat/base.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
const globals = require('globals')
77
module.exports = [
88
{
9+
name: 'vue:base:setup',
910
plugins: {
1011
get vue() {
1112
return require('../../index')
@@ -17,6 +18,7 @@ module.exports = [
1718
}
1819
},
1920
{
21+
name: 'vue:base:setup-for-vue',
2022
files: ['*.vue', '**/*.vue'],
2123
plugins: {
2224
get vue() {

lib/configs/flat/vue2-essential.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const config = require('./base.js')
99
module.exports = [
1010
...config,
1111
{
12+
name: 'vue:vue2-essential:rules',
1213
rules: {
1314
'vue/multi-word-component-names': 'error',
1415
'vue/no-arrow-functions-in-watch': 'error',

lib/configs/flat/vue2-recommended.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const config = require('./vue2-strongly-recommended.js')
99
module.exports = [
1010
...config,
1111
{
12+
name: 'vue:vue2-recommended:rules',
1213
rules: {
1314
'vue/attributes-order': 'warn',
1415
'vue/component-tags-order': 'warn',

0 commit comments

Comments
 (0)