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

Change stylistic rules for expressions in <template> to extend from ESLint Stylistic #2330

Merged
merged 5 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
name: Versions
command: npm version
- checkout
- run:
name: Uninstall @stylistic/eslint-plugin
command: npm uninstall -D @stylistic/eslint-plugin
- run:
name: Install eslint@6
command: |
Expand All @@ -59,6 +62,9 @@ jobs:
name: Versions
command: npm version
- checkout
- run:
name: Uninstall @stylistic/eslint-plugin
command: npm uninstall -D @stylistic/eslint-plugin
- run:
name: Install eslint@7
command: |
Expand All @@ -77,6 +83,9 @@ jobs:
name: Versions
command: npm version
- checkout
- run:
name: Uninstall @stylistic/eslint-plugin
command: npm uninstall -D @stylistic/eslint-plugin
- run:
name: Install @typescript-eslint/parser@4 eslint@7 typescript@4.7
command: |
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js v${{ matrix.node }}
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
Expand All @@ -58,3 +58,20 @@ jobs:
run: npm install -D @typescript-eslint/parser
- name: Test
run: npm test

test-for-eslint-v8-without-eslint-stylistic:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
- name: Install Packages
run: npm install --legacy-peer-deps
- name: Uninstall @stylistic/eslint-plugin
run: npm uninstall -D @stylistic/eslint-plugin
- name: Install eslint v8
run: npm install -D eslint@8
- name: Test
run: npm test
4 changes: 2 additions & 2 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export default async () => {
const uncategorizedRules = rules.filter(
(rule) =>
!rule.meta.docs.categories &&
!rule.meta.docs.extensionRule &&
!rule.meta.docs.extensionSource &&
!rule.meta.deprecated
)
const uncategorizedExtensionRule = rules.filter(
(rule) =>
!rule.meta.docs.categories &&
rule.meta.docs.extensionRule &&
rule.meta.docs.extensionSource &&
!rule.meta.deprecated
)
const deprecatedRules = rules.filter((rule) => rule.meta.deprecated)
Expand Down
11 changes: 9 additions & 2 deletions docs/rules/array-bracket-newline.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ since: v7.1.0

- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

This rule is the same rule as core [array-bracket-newline] rule but it applies to the expressions in `<template>`.
This rule is the same rule as [@stylistic/array-bracket-newline] rule but it applies to the expressions in `<template>`.

This rule extends the rule that [@stylistic/eslint-plugin] has, but if [@stylistic/eslint-plugin] is not installed, this rule extracts and extends the same rule from ESLint core.
However, if neither is found, the rule cannot be used.

[@stylistic/eslint-plugin]: https://eslint.style/packages/default

## :books: Further Reading

- [@stylistic/array-bracket-newline]
- [array-bracket-newline]

[@stylistic/array-bracket-newline]: https://eslint.style/rules/default/array-bracket-newline
[array-bracket-newline]: https://eslint.org/docs/rules/array-bracket-newline

## :rocket: Version
Expand All @@ -28,4 +35,4 @@ This rule was introduced in eslint-plugin-vue v7.1.0
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/array-bracket-newline.js)
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/array-bracket-newline.js)

<sup>Taken with ❤️ [from ESLint core](https://eslint.org/docs/latest/rules/array-bracket-newline)</sup>
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/js/array-bracket-newline)</sup>
11 changes: 9 additions & 2 deletions docs/rules/array-bracket-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ since: v5.2.0

- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

This rule is the same rule as core [array-bracket-spacing] rule but it applies to the expressions in `<template>`.
This rule is the same rule as [@stylistic/array-bracket-spacing] rule but it applies to the expressions in `<template>`.

This rule extends the rule that [@stylistic/eslint-plugin] has, but if [@stylistic/eslint-plugin] is not installed, this rule extracts and extends the same rule from ESLint core.
However, if neither is found, the rule cannot be used.

[@stylistic/eslint-plugin]: https://eslint.style/packages/default

## :books: Further Reading

- [@stylistic/array-bracket-spacing]
- [array-bracket-spacing]

[@stylistic/array-bracket-spacing]: https://eslint.style/rules/default/array-bracket-spacing
[array-bracket-spacing]: https://eslint.org/docs/rules/array-bracket-spacing

## :rocket: Version
Expand All @@ -28,4 +35,4 @@ This rule was introduced in eslint-plugin-vue v5.2.0
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/array-bracket-spacing.js)
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/array-bracket-spacing.js)

<sup>Taken with ❤️ [from ESLint core](https://eslint.org/docs/latest/rules/array-bracket-spacing)</sup>
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/js/array-bracket-spacing)</sup>
15 changes: 13 additions & 2 deletions docs/rules/array-element-newline.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,25 @@ since: v9.9.0

- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

This rule is the same rule as core [array-element-newline] rule but it applies to the expressions in `<template>`.
This rule is the same rule as [@stylistic/array-element-newline] rule but it applies to the expressions in `<template>`.

This rule extends the rule that [@stylistic/eslint-plugin] has, but if [@stylistic/eslint-plugin] is not installed, this rule extracts and extends the same rule from ESLint core.
However, if neither is found, the rule cannot be used.

[@stylistic/eslint-plugin]: https://eslint.style/packages/default

## :books: Further Reading

- [@stylistic/array-element-newline]
- [@stylistic/array-bracket-spacing]
- [@stylistic/array-bracket-newline]
- [array-bracket-spacing]
- [array-bracket-newline]
- [array-element-newline]

[@stylistic/array-element-newline]: https://eslint.style/rules/default/array-element-newline
[@stylistic/array-bracket-spacing]: https://eslint.style/rules/default/array-bracket-spacing
[@stylistic/array-bracket-newline]: https://eslint.style/rules/default/array-bracket-newline
[array-bracket-spacing]: https://eslint.org/docs/rules/array-bracket-spacing
[array-bracket-newline]: https://eslint.org/docs/rules/array-bracket-newline
[array-element-newline]: https://eslint.org/docs/rules/array-element-newline
Expand All @@ -32,4 +43,4 @@ This rule was introduced in eslint-plugin-vue v9.9.0
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/array-element-newline.js)
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/array-element-newline.js)

<sup>Taken with ❤️ [from ESLint core](https://eslint.org/docs/latest/rules/array-element-newline)</sup>
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/js/array-element-newline)</sup>
11 changes: 9 additions & 2 deletions docs/rules/arrow-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ since: v5.2.0

- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

This rule is the same rule as core [arrow-spacing] rule but it applies to the expressions in `<template>`.
This rule is the same rule as [@stylistic/arrow-spacing] rule but it applies to the expressions in `<template>`.

This rule extends the rule that [@stylistic/eslint-plugin] has, but if [@stylistic/eslint-plugin] is not installed, this rule extracts and extends the same rule from ESLint core.
However, if neither is found, the rule cannot be used.

[@stylistic/eslint-plugin]: https://eslint.style/packages/default

## :books: Further Reading

- [@stylistic/arrow-spacing]
- [arrow-spacing]

[@stylistic/arrow-spacing]: https://eslint.style/rules/default/arrow-spacing
[arrow-spacing]: https://eslint.org/docs/rules/arrow-spacing

## :rocket: Version
Expand All @@ -28,4 +35,4 @@ This rule was introduced in eslint-plugin-vue v5.2.0
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/arrow-spacing.js)
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/arrow-spacing.js)

<sup>Taken with ❤️ [from ESLint core](https://eslint.org/docs/latest/rules/arrow-spacing)</sup>
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/js/arrow-spacing)</sup>
11 changes: 9 additions & 2 deletions docs/rules/block-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ since: v5.2.0

- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

This rule is the same rule as core [block-spacing] rule but it applies to the expressions in `<template>`.
This rule is the same rule as [@stylistic/block-spacing] rule but it applies to the expressions in `<template>`.

This rule extends the rule that [@stylistic/eslint-plugin] has, but if [@stylistic/eslint-plugin] is not installed, this rule extracts and extends the same rule from ESLint core.
However, if neither is found, the rule cannot be used.

[@stylistic/eslint-plugin]: https://eslint.style/packages/default

## :books: Further Reading

- [@stylistic/block-spacing]
- [block-spacing]

[@stylistic/block-spacing]: https://eslint.style/rules/default/block-spacing
[block-spacing]: https://eslint.org/docs/rules/block-spacing

## :rocket: Version
Expand All @@ -28,4 +35,4 @@ This rule was introduced in eslint-plugin-vue v5.2.0
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/block-spacing.js)
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/block-spacing.js)

<sup>Taken with ❤️ [from ESLint core](https://eslint.org/docs/latest/rules/block-spacing)</sup>
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/ts/block-spacing)</sup>
11 changes: 9 additions & 2 deletions docs/rules/brace-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ since: v5.2.0

- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

This rule is the same rule as core [brace-style] rule but it applies to the expressions in `<template>`.
This rule is the same rule as [@stylistic/brace-style] rule but it applies to the expressions in `<template>`.

This rule extends the rule that [@stylistic/eslint-plugin] has, but if [@stylistic/eslint-plugin] is not installed, this rule extracts and extends the same rule from ESLint core.
However, if neither is found, the rule cannot be used.

[@stylistic/eslint-plugin]: https://eslint.style/packages/default

## :books: Further Reading

- [@stylistic/brace-style]
- [brace-style]

[@stylistic/brace-style]: https://eslint.style/rules/default/brace-style
[brace-style]: https://eslint.org/docs/rules/brace-style

## :rocket: Version
Expand All @@ -28,4 +35,4 @@ This rule was introduced in eslint-plugin-vue v5.2.0
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/brace-style.js)
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/brace-style.js)

<sup>Taken with ❤️ [from ESLint core](https://eslint.org/docs/latest/rules/brace-style)</sup>
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/ts/brace-style)</sup>
11 changes: 9 additions & 2 deletions docs/rules/comma-dangle.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ since: v5.2.0

- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

This rule is the same rule as core [comma-dangle] rule but it applies to the expressions in `<template>`.
This rule is the same rule as [@stylistic/comma-dangle] rule but it applies to the expressions in `<template>`.

This rule extends the rule that [@stylistic/eslint-plugin] has, but if [@stylistic/eslint-plugin] is not installed, this rule extracts and extends the same rule from ESLint core.
However, if neither is found, the rule cannot be used.

[@stylistic/eslint-plugin]: https://eslint.style/packages/default

## :books: Further Reading

- [@stylistic/comma-dangle]
- [comma-dangle]

[@stylistic/comma-dangle]: https://eslint.style/rules/default/comma-dangle
[comma-dangle]: https://eslint.org/docs/rules/comma-dangle

## :rocket: Version
Expand All @@ -28,4 +35,4 @@ This rule was introduced in eslint-plugin-vue v5.2.0
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/comma-dangle.js)
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/comma-dangle.js)

<sup>Taken with ❤️ [from ESLint core](https://eslint.org/docs/latest/rules/comma-dangle)</sup>
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/ts/comma-dangle)</sup>
11 changes: 9 additions & 2 deletions docs/rules/comma-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ since: v7.0.0

- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

This rule is the same rule as core [comma-spacing] rule but it applies to the expressions in `<template>`.
This rule is the same rule as [@stylistic/comma-spacing] rule but it applies to the expressions in `<template>`.

This rule extends the rule that [@stylistic/eslint-plugin] has, but if [@stylistic/eslint-plugin] is not installed, this rule extracts and extends the same rule from ESLint core.
However, if neither is found, the rule cannot be used.

[@stylistic/eslint-plugin]: https://eslint.style/packages/default

## :books: Further Reading

- [@stylistic/comma-spacing]
- [comma-spacing]

[@stylistic/comma-spacing]: https://eslint.style/rules/default/comma-spacing
[comma-spacing]: https://eslint.org/docs/rules/comma-spacing

## :rocket: Version
Expand All @@ -28,4 +35,4 @@ This rule was introduced in eslint-plugin-vue v7.0.0
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/comma-spacing.js)
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/comma-spacing.js)

<sup>Taken with ❤️ [from ESLint core](https://eslint.org/docs/latest/rules/comma-spacing)</sup>
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/ts/comma-spacing)</sup>
11 changes: 9 additions & 2 deletions docs/rules/comma-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ since: v7.0.0

- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

This rule is the same rule as core [comma-style] rule but it applies to the expressions in `<template>`.
This rule is the same rule as [@stylistic/comma-style] rule but it applies to the expressions in `<template>`.

This rule extends the rule that [@stylistic/eslint-plugin] has, but if [@stylistic/eslint-plugin] is not installed, this rule extracts and extends the same rule from ESLint core.
However, if neither is found, the rule cannot be used.

[@stylistic/eslint-plugin]: https://eslint.style/packages/default

## :books: Further Reading

- [@stylistic/comma-style]
- [comma-style]

[@stylistic/comma-style]: https://eslint.style/rules/default/comma-style
[comma-style]: https://eslint.org/docs/rules/comma-style

## :rocket: Version
Expand All @@ -28,4 +35,4 @@ This rule was introduced in eslint-plugin-vue v7.0.0
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/comma-style.js)
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/comma-style.js)

<sup>Taken with ❤️ [from ESLint core](https://eslint.org/docs/latest/rules/comma-style)</sup>
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/js/comma-style)</sup>
1 change: 0 additions & 1 deletion docs/rules/define-emits-declaration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ title: vue/define-emits-declaration
description: enforce declaration style of `defineEmits`
since: v9.5.0
---

# vue/define-emits-declaration

> enforce declaration style of `defineEmits`
Expand Down
11 changes: 9 additions & 2 deletions docs/rules/dot-location.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ since: v6.0.0

- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

This rule is the same rule as core [dot-location] rule but it applies to the expressions in `<template>`.
This rule is the same rule as [@stylistic/dot-location] rule but it applies to the expressions in `<template>`.

This rule extends the rule that [@stylistic/eslint-plugin] has, but if [@stylistic/eslint-plugin] is not installed, this rule extracts and extends the same rule from ESLint core.
However, if neither is found, the rule cannot be used.

[@stylistic/eslint-plugin]: https://eslint.style/packages/default

## :books: Further Reading

- [@stylistic/dot-location]
- [dot-location]

[@stylistic/dot-location]: https://eslint.style/rules/default/dot-location
[dot-location]: https://eslint.org/docs/rules/dot-location

## :rocket: Version
Expand All @@ -28,4 +35,4 @@ This rule was introduced in eslint-plugin-vue v6.0.0
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/dot-location.js)
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/dot-location.js)

<sup>Taken with ❤️ [from ESLint core](https://eslint.org/docs/latest/rules/dot-location)</sup>
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/js/dot-location)</sup>
11 changes: 9 additions & 2 deletions docs/rules/func-call-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ since: v7.0.0

- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

This rule is the same rule as core [func-call-spacing] rule but it applies to the expressions in `<template>`.
This rule is the same rule as [@stylistic/function-call-spacing] rule but it applies to the expressions in `<template>`.

This rule extends the rule that [@stylistic/eslint-plugin] has, but if [@stylistic/eslint-plugin] is not installed, this rule extracts and extends the same rule from ESLint core.
However, if neither is found, the rule cannot be used.

[@stylistic/eslint-plugin]: https://eslint.style/packages/default

## :books: Further Reading

- [@stylistic/function-call-spacing]
- [func-call-spacing]

[@stylistic/function-call-spacing]: https://eslint.style/rules/default/function-call-spacing
[func-call-spacing]: https://eslint.org/docs/rules/func-call-spacing

## :rocket: Version
Expand All @@ -28,4 +35,4 @@ This rule was introduced in eslint-plugin-vue v7.0.0
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/func-call-spacing.js)
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/func-call-spacing.js)

<sup>Taken with ❤️ [from ESLint core](https://eslint.org/docs/latest/rules/func-call-spacing)</sup>
<sup>Taken with ❤️ [from ESLint Stylistic](https://eslint.style/rules/ts/function-call-spacing)</sup>
Loading
Loading