From 1a5cfe544cf354b08d0fde1a836f5eabeee2d738 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 20 Oct 2021 10:45:54 +0800 Subject: [PATCH 1/9] Update eslint to v8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ddcaf3b..9d9efbf 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "c8": "^7.7.3", "chalk": "^4.1.1", "del": "^6.0.0", - "eslint": "^7.32.0", + "eslint": "^8.0.1", "eslint-ava-rule-tester": "^4.0.0", "eslint-plugin-eslint-plugin": "^3.5.3", "execa": "^5.1.1", From 84497522d6ea9472a84bfb2e70718683155a393f Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 20 Oct 2021 10:47:49 +0800 Subject: [PATCH 2/9] Add `meta.hasSuggestions` --- rules/no-only-test.js | 1 + rules/no-skip-test.js | 1 + 2 files changed, 2 insertions(+) diff --git a/rules/no-only-test.js b/rules/no-only-test.js index a711e8a..1f2615a 100644 --- a/rules/no-only-test.js +++ b/rules/no-only-test.js @@ -37,6 +37,7 @@ module.exports = { url: util.getDocsUrl(__filename), }, fixable: 'code', + hasSuggestions: true, schema: [], }, }; diff --git a/rules/no-skip-test.js b/rules/no-skip-test.js index c839bdd..42421e6 100644 --- a/rules/no-skip-test.js +++ b/rules/no-skip-test.js @@ -37,6 +37,7 @@ module.exports = { url: util.getDocsUrl(__filename), }, fixable: 'code', + hasSuggestions: true, schema: [], }, }; From d6b995c9ebdb3fb208fb40e8a5f04ff9d368d569 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 20 Oct 2021 10:50:38 +0800 Subject: [PATCH 3/9] Fix CI --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 790aa71..71c55ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,10 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm install --no-audit - - run: npm test + - run: npx c8 ava - uses: codecov/codecov-action@v1 + # `xo` can't work on ESLint 8 yet + - run: npm install eslint@7 && npx xo # FIXME: https://github.com/avajs/eslint-plugin-ava/issues/333 # integration: From 3b956026c8ad3e3a5eacdee3b73b15aa39827132 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 20 Oct 2021 10:55:58 +0800 Subject: [PATCH 4/9] Disable `eslint-plugin/require-meta-has-suggestions` --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 9d9efbf..697fb91 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "ava/no-ignored-test-files": "off", "eslint-plugin/prefer-message-ids": "off", "eslint-plugin/require-meta-docs-description": "off", + "eslint-plugin/require-meta-has-suggestions": "off", "import/extensions": "off", "unicorn/prefer-module": "off" } From 4501e2250a89f74a36f6cdab865db7bf55bdf074 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 20 Oct 2021 10:58:41 +0800 Subject: [PATCH 5/9] Update `eslint-plugin-eslint-plugin` --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 697fb91..f0aef02 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "del": "^6.0.0", "eslint": "^8.0.1", "eslint-ava-rule-tester": "^4.0.0", - "eslint-plugin-eslint-plugin": "^3.5.3", + "eslint-plugin-eslint-plugin": "^4.0.1", "execa": "^5.1.1", "listr": "^0.14.3", "outdent": "^0.8.0", From df436d1b88f67bdabe2ad0e7850d7bfae143c142 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 20 Oct 2021 11:02:17 +0800 Subject: [PATCH 6/9] Linting --- create-ava-rule.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create-ava-rule.js b/create-ava-rule.js index f6d3a6a..44ab3a8 100644 --- a/create-ava-rule.js +++ b/create-ava-rule.js @@ -180,7 +180,7 @@ function getTestModifierNames(node) { return util.getTestModifiers(node).map(property => property.name); } -module.exports = () => { // eslint-disable-line eslint-plugin/prefer-object-rule +module.exports = () => { let isTestFile = false; let currentTestNode; From 41eafccf81f04b0cb21352ae59a1d76c6cf8eeb1 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 20 Oct 2021 11:05:27 +0800 Subject: [PATCH 7/9] Disable `xo` --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71c55ec..2bd4704 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,10 +22,10 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm install --no-audit + # `xo` can't work on ESLint 8 yet + # - run: npm test - run: npx c8 ava - uses: codecov/codecov-action@v1 - # `xo` can't work on ESLint 8 yet - - run: npm install eslint@7 && npx xo # FIXME: https://github.com/avajs/eslint-plugin-ava/issues/333 # integration: From 56ba858c01ebb8a5bd1fe09480c6ac7cfa923e0e Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 20 Oct 2021 11:10:12 +0800 Subject: [PATCH 8/9] Only run `xo` on Node.js 14 --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2bd4704..65c6989 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,10 +22,11 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm install --no-audit - # `xo` can't work on ESLint 8 yet - # - run: npm test - run: npx c8 ava - uses: codecov/codecov-action@v1 + # `xo` can't work on ESLint 8 and Node.js 16 yet + - if: ${{ matrix.node-version == '^14.17' }} + run: npm install eslint@7 && npx xo # FIXME: https://github.com/avajs/eslint-plugin-ava/issues/333 # integration: From 14231fd93dfec9147ec86431b98c44f46eebe486 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 20 Oct 2021 11:34:20 +0800 Subject: [PATCH 9/9] Update branch name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 046c9ec..11f53b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: Install and test eslint-plugin-ava on: push: branches: - - master + - main pull_request: paths-ignore: - '*.md'