diff --git a/.github/workflows/check-for-resources-update.yml b/.github/workflows/check-for-resources-update.yml index 613125fc3..31f881b1d 100644 --- a/.github/workflows/check-for-resources-update.yml +++ b/.github/workflows/check-for-resources-update.yml @@ -5,12 +5,13 @@ on: - cron: 0 0 * * 0 # At 00:00 on Sunday, see https://crontab.guru/#0_0_*_*_0 permissions: - contents: write - pull-requests: write + contents: write + pull-requests: write jobs: check-for-resources-update: runs-on: ubuntu-latest + if: ${{ github.repository == 'vuejs/eslint-plugin-vue' }} steps: - name: Checkout uses: actions/checkout@v4 diff --git a/README.md b/README.md index 95e0c08be..bdeb5e167 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![NPM version](https://img.shields.io/npm/v/eslint-plugin-vue.svg?style=flat)](https://npmjs.org/package/eslint-plugin-vue) [![NPM downloads](https://img.shields.io/npm/dm/eslint-plugin-vue.svg?style=flat)](https://npmjs.org/package/eslint-plugin-vue) -[![CircleCI](https://img.shields.io/circleci/project/github/vuejs/eslint-plugin-vue/master.svg?style=flat)](https://circleci.com/gh/vuejs/eslint-plugin-vue) +[![CI](https://img.shields.io/github/actions/workflow/status/vuejs/eslint-plugin-vue/CI.yml?style=flat&label=CI)](https://github.com/vuejs/eslint-plugin-vue/actions/workflows/CI.yml) [![License](https://img.shields.io/github/license/vuejs/eslint-plugin-vue.svg?style=flat)](https://github.com/vuejs/eslint-plugin-vue/blob/master/LICENSE) > Official ESLint plugin for Vue.js diff --git a/docs/rules/define-emits-declaration.md b/docs/rules/define-emits-declaration.md index 7a11524c5..c24f5ec62 100644 --- a/docs/rules/define-emits-declaration.md +++ b/docs/rules/define-emits-declaration.md @@ -35,8 +35,8 @@ const emit = defineEmits<{ /* ✗ BAD */ const emit = defineEmits({ - change: (id) => typeof id == 'number', - update: (value) => typeof value == 'string' + change: (id) => typeof id === 'number', + update: (value) => typeof value === 'string' }) /* ✗ BAD */ @@ -70,8 +70,8 @@ const emit = defineEmits<{ /* ✓ GOOD */ const emit = defineEmits({ - change: (id) => typeof id == 'number', - update: (value) => typeof value == 'string' + change: (id) => typeof id === 'number', + update: (value) => typeof value === 'string' }) /* ✓ GOOD */ @@ -92,8 +92,8 @@ const emit = defineEmits(['change', 'update']) /* ✗ BAD */ const emit = defineEmits({ - change: (id) => typeof id == 'number', - update: (value) => typeof value == 'string' + change: (id) => typeof id === 'number', + update: (value) => typeof value === 'string' }) /* ✗ BAD */ diff --git a/docs/user-guide/index.md b/docs/user-guide/index.md index fcd7ff45c..103471f61 100644 --- a/docs/user-guide/index.md +++ b/docs/user-guide/index.md @@ -11,7 +11,7 @@ npm install --save-dev eslint eslint-plugin-vue Via [yarn](https://yarnpkg.com/): ```bash -yarn add -D eslint eslint-plugin-vue globals +yarn add -D eslint eslint-plugin-vue vue-eslint-parser globals ``` ::: tip Requirements @@ -166,8 +166,8 @@ module.exports = { extends: [ // add more generic rulesets here, such as: // 'eslint:recommended', - 'plugin:vue/vue3-recommended', - // 'plugin:vue/recommended' // Use this if you are using Vue.js 2.x. + 'plugin:vue/recommended', + // 'plugin:vue/vue2-recommended' // Use this if you are using Vue.js 2.x. ], rules: { // override/add rules settings here, such as: @@ -185,13 +185,13 @@ You can use the following configs by adding them to `extends`. - `"plugin:vue/base"` ... Settings and rules to enable correct ESLint parsing. - Configurations for using Vue.js 3.x: - - `"plugin:vue/vue3-essential"` ... `base`, plus rules to prevent errors or unintended behavior. - - `"plugin:vue/vue3-strongly-recommended"` ... Above, plus rules to considerably improve code readability and/or dev experience. - - `"plugin:vue/vue3-recommended"` ... Above, plus rules to enforce subjective community defaults to ensure consistency. -- Configurations for using Vue.js 2.x: - `"plugin:vue/essential"` ... `base`, plus rules to prevent errors or unintended behavior. - `"plugin:vue/strongly-recommended"` ... Above, plus rules to considerably improve code readability and/or dev experience. - - `"plugin:vue/recommended"` ... Above, plus rules to enforce subjective community defaults to ensure consistency + - `"plugin:vue/recommended"` ... Above, plus rules to enforce subjective community defaults to ensure consistency. +- Configurations for using Vue.js 2.x: + - `"plugin:vue/vue2-essential"` ... `base`, plus rules to prevent errors or unintended behavior. + - `"plugin:vue/vue2-strongly-recommended"` ... Above, plus rules to considerably improve code readability and/or dev experience. + - `"plugin:vue/vue2-recommended"` ... Above, plus rules to enforce subjective community defaults to ensure consistency. :::warning Reporting rules By default, all rules from **base** and **essential** categories report ESLint errors. Other rules - because they're not covering potential bugs in the application - report warnings. What does it mean? By default - nothing, but if you want - you can set up a threshold and break the build after a certain amount of warnings, instead of any. More information [here](https://eslint.org/docs/user-guide/command-line-interface#handling-warnings). @@ -264,7 +264,7 @@ Full example: "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", - "plugin:vue/vue3-recommended" + "plugin:vue/recommended" ], "parser": "vue-eslint-parser", "parserOptions": { @@ -436,7 +436,7 @@ Most `eslint-plugin-vue` rules require `vue-eslint-parser` to check `