diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 437c2d814..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,142 +0,0 @@ -workflows: - version: 2 - node-multi-build: - jobs: - - eslint-v6 - - eslint-v7 - - ts-eslint-v4 - - node-v14 - - node-v16 - - lint - -version: 2 -jobs: - node-base: &node-base - docker: - - image: node - steps: - - run: - name: Versions - command: npm version - - checkout - # - restore_cache: - # keys: - # - v2-npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }} - - run: - name: Install dependencies - command: npm install --legacy-peer-deps - - run: - name: Test - command: npm test - # - save_cache: - # key: v2-npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }} - # paths: - # - node_modules - - eslint-v6: - docker: - - image: node:14 - steps: - - run: - 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: | - npm install --save-exact eslint@6.8.0 @typescript-eslint/parser@5 - - run: - name: Install dependencies - command: npm install - - run: - name: Test - command: npm test - eslint-v7: - docker: - - image: node:14 - steps: - - run: - 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: | - npm install eslint@7 @typescript-eslint/parser@5 - - run: - name: Install dependencies - command: npm install - - run: - name: Test - command: npm test - ts-eslint-v4: - docker: - - image: node:14 - steps: - - run: - 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: | - npm install @typescript-eslint/parser@4 eslint@7 typescript@4.7 --save-exact - - run: - name: Install dependencies - command: npm install - - run: - name: Test - command: npm test - node-v14: - docker: - - image: node:14 - steps: - - run: - name: Versions - command: npm version - - checkout - - run: - name: Install @typescript-eslint/parser@5 - command: | - npm install @typescript-eslint/parser@5 --save-exact - - run: - name: Install dependencies - command: npm install - - run: - name: Test - command: npm test - node-v16: - <<: *node-base - docker: - - image: node:16 - - lint: - docker: - - image: node:16 - steps: - - run: - name: Versions - command: npm version - - checkout - - restore_cache: - keys: - - v2-npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }} - - run: - name: Install dependencies - command: npm install - - save_cache: - key: v2-npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }} - paths: - - node_modules - - run: - name: Lint - command: npm run lint diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 58878a03e..57aa5876d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,9 +1,13 @@ name: CI on: push: - branches: [master] + branches: + - 'master' pull_request: - branches: [master] + types: + - 'opened' + - 'synchronize' + - 'reopened' permissions: contents: read @@ -14,9 +18,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 - name: Install Packages run: npm install --legacy-peer-deps - name: Lint @@ -26,60 +30,39 @@ jobs: name: Test strategy: matrix: - node: [18, 20] - os: [ubuntu-latest] - eslint: [8, 9] + node: [18, 20, 21, 'lts/*'] + eslint: [9] include: - # On old Node version - - eslint: 8 - node: 17 - os: ubuntu-latest + # On old ESLint version + - node: 18 + eslint: 8 - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Node.js v${{ matrix.node }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - name: Install Packages - run: npm install --legacy-peer-deps + run: npm install -f - name: Install ESLint v${{ matrix.eslint }} - run: npm install --save-dev eslint@${{ matrix.eslint }} --legacy-peer-deps + run: npm install --save-dev eslint@${{ matrix.eslint }} -f - name: Test run: npm test - test-for-ts-eslint-v5: - name: Test + test-without-eslint-stylistic: + name: Test without ESLint Stylistic runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 18 + uses: actions/setup-node@v4 - name: Install Packages - run: npm install --legacy-peer-deps - - name: Install typescript-eslint v5 - 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 + run: npm install -f - 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 diff --git a/.github/workflows/check-for-resources-update.yml b/.github/workflows/check-for-resources-update.yml new file mode 100644 index 000000000..31f881b1d --- /dev/null +++ b/.github/workflows/check-for-resources-update.yml @@ -0,0 +1,31 @@ +name: Check for utils resources update +on: + workflow_dispatch: null + schedule: + - cron: 0 0 * * 0 # At 00:00 on Sunday, see https://crontab.guru/#0_0_*_*_0 + +permissions: + 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 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Install Packages + run: npm install + - name: Update + run: npm run update-resources + - uses: peter-evans/create-pull-request@v7 + with: + commit-message: Updates resources + branch: update-resources + branch-suffix: timestamp + title: Updates resources diff --git a/README.md b/README.md index cacd80209..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 @@ -13,7 +13,14 @@ Please refer to the [official website](https://eslint.vuejs.org). ## :anchor: Versioning Policy -This plugin follows [Semantic Versioning](https://semver.org) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy). +This plugin follows [Semantic Versioning]. +However, please note that we do not follow [ESLint's Semantic Versioning Policy]. +In minor version releases, this plugin may change the sharable configs provided by the plugin or the default behavior of the plugin's rules in order to add features to the plugin. Because we want to add many features to the plugin soon, so that users can easily take advantage of new features in Vue and Nuxt. + +According to our policy, any minor update may report more linting errors than the previous release. As such, we recommend using the [tilde (`~`)](https://semver.npmjs.com/#syntax-examples) in `package.json` to guarantee the results of your builds. + +[Semantic Versioning]: https://semver.org/ +[ESLint's Semantic Versioning Policy]: https://github.com/eslint/eslint#semantic-versioning-policy ## :newspaper: Releases diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 77c052a58..afa635d7e 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -32,7 +32,7 @@ export default async () => { { title: 'Base Rules', categoryIds: ['base'] }, { title: 'Priority A: Essential', - categoryIds: ['vue3-essential', 'essential'] + categoryIds: ['vue3-essential', 'vue2-essential'] }, { title: 'Priority A: Essential for Vue.js 3.x', @@ -40,11 +40,11 @@ export default async () => { }, { title: 'Priority A: Essential for Vue.js 2.x', - categoryIds: ['essential'] + categoryIds: ['vue2-essential'] }, { title: 'Priority B: Strongly Recommended', - categoryIds: ['vue3-strongly-recommended', 'strongly-recommended'] + categoryIds: ['vue3-strongly-recommended', 'vue2-strongly-recommended'] }, { title: 'Priority B: Strongly Recommended for Vue.js 3.x', @@ -52,11 +52,11 @@ export default async () => { }, { title: 'Priority B: Strongly Recommended for Vue.js 2.x', - categoryIds: ['strongly-recommended'] + categoryIds: ['vue2-strongly-recommended'] }, { title: 'Priority C: Recommended', - categoryIds: ['vue3-recommended', 'recommended'] + categoryIds: ['vue3-recommended', 'vue2-recommended'] }, { title: 'Priority C: Recommended for Vue.js 3.x', @@ -64,7 +64,7 @@ export default async () => { }, { title: 'Priority C: Recommended for Vue.js 2.x', - categoryIds: ['recommended'] + categoryIds: ['vue2-recommended'] } ] diff --git a/docs/index.md b/docs/index.md index 3fd2b6d66..9f6ce3192 100644 --- a/docs/index.md +++ b/docs/index.md @@ -16,7 +16,14 @@ ESLint editor integrations are useful to check your code in real-time. ## :traffic_light: Versioning policy -This plugin is following [Semantic Versioning](https://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy). +This plugin follows [Semantic Versioning]. +However, please note that we do not follow [ESLint's Semantic Versioning Policy]. +In minor version releases, this plugin may change the sharable configs provided by the plugin or the default behavior of the plugin's rules in order to add features to the plugin. Because we want to add many features to the plugin soon, so that users can easily take advantage of new features in Vue and Nuxt. + +According to our policy, any minor update may report more linting errors than the previous release. As such, we recommend using the [tilde (`~`)](https://semver.npmjs.com/#syntax-examples) in `package.json` to guarantee the results of your builds. + +[Semantic Versioning]: https://semver.org/ +[ESLint's Semantic Versioning Policy]: https://github.com/eslint/eslint#semantic-versioning-policy ## :newspaper: Changelog diff --git a/docs/rules/array-bracket-newline.md b/docs/rules/array-bracket-newline.md index 10182aeba..550723b5d 100644 --- a/docs/rules/array-bracket-newline.md +++ b/docs/rules/array-bracket-newline.md @@ -10,7 +10,7 @@ since: v7.1.0 > Enforce linebreaks after opening and before closing array brackets in `