From 42ce833a6c52d65f23102ac20601fe7dc5cdaf2e Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Sun, 23 Apr 2023 10:27:04 +0800 Subject: [PATCH] Drop support for Node.js v14, enable `prefer-event-target` `prefer-string-replace-all` in recommended config --- .github/workflows/main.yml | 7 +++---- configs/recommended.js | 6 ++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cad5bf647f..1a4a040133 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,15 +15,14 @@ jobs: fail-fast: false matrix: node-version: - - 18 + - 20 - 16 - - 14 os: - ubuntu-latest - windows-latest - exclude: + include: - os: ubuntu-latest - node-version: 16 + node-version: 18 steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 diff --git a/configs/recommended.js b/configs/recommended.js index cb8559549c..e699fea1b7 100644 --- a/configs/recommended.js +++ b/configs/recommended.js @@ -83,8 +83,7 @@ module.exports = { 'unicorn/prefer-dom-node-dataset': 'error', 'unicorn/prefer-dom-node-remove': 'error', 'unicorn/prefer-dom-node-text-content': 'error', - // TODO: Enable this by default when targeting Node.js 16. - 'unicorn/prefer-event-target': 'off', + 'unicorn/prefer-event-target': 'error', 'unicorn/prefer-export-from': 'error', 'unicorn/prefer-includes': 'error', 'unicorn/prefer-json-parse-buffer': 'off', @@ -107,8 +106,7 @@ module.exports = { 'unicorn/prefer-set-has': 'error', 'unicorn/prefer-set-size': 'error', 'unicorn/prefer-spread': 'error', - // TODO: Enable this by default when targeting Node.js 16. - 'unicorn/prefer-string-replace-all': 'off', + 'unicorn/prefer-string-replace-all': 'error', 'unicorn/prefer-string-slice': 'error', 'unicorn/prefer-string-starts-ends-with': 'error', 'unicorn/prefer-string-trim-start-end': 'error',