Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit 71c2baa

Browse files
Drop support for Node.js v16 (#5)
* Update Node.js to v18 * Update `engines.node` * Enable `unicorn/prefer-top-level-await` rule * Update `engines.node` * Remove `16` from `node-version` * Update config --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Munieru <[email protected]>
1 parent 092b49a commit 71c2baa

File tree

6 files changed

+32
-9
lines changed

6 files changed

+32
-9
lines changed

.eslintrc.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1-
module.exports = {
1+
// @ts-check
2+
3+
// eslint-disable-next-line jsdoc/valid-types -- https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html
4+
/** @typedef {import('eslint').ESLint.ConfigData} ConfigData */
5+
6+
/**
7+
* @type {ConfigData}
8+
* @see https://eslint.org/docs/latest/use/configure/configuration-files
9+
*/
10+
const config = {
211
extends: './index.js'
312
}
13+
14+
// eslint-disable-next-line unicorn/prefer-module
15+
module.exports = config

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
matrix:
88
# https://nodejs.org/en/about/releases/
9-
node-version: ['16', '18', '20']
9+
node-version: ['18', '20']
1010
steps:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16.20.0
1+
18.16.0

index.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1+
// @ts-check
2+
3+
// eslint-disable-next-line jsdoc/valid-types -- https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html
4+
/** @typedef {import('eslint').ESLint.ConfigData} ConfigData */
5+
6+
/** @type {ConfigData['rules']} */
17
const unicornRules = {
28
'unicorn/filename-case': 'off',
39
'unicorn/no-array-for-each': 'off',
410
'unicorn/no-useless-undefined': 'off',
511
'unicorn/numeric-separators-style': 'off',
6-
'unicorn/prefer-module': 'off',
712
'unicorn/prefer-query-selector': 'off',
813
'unicorn/prefer-spread': 'off',
9-
// TODO [engine:node@>=18]: Enable this when the minimum supported Node.js version becomes v18 or later.
10-
'unicorn/prefer-top-level-await': 'off',
1114
'unicorn/prevent-abbreviations': 'off',
1215
'unicorn/switch-case-braces': ['error', 'avoid']
1316
}
1417

18+
/** @type {ConfigData['rules']} */
1519
const importRules = {
1620
'sort-imports': 'off',
1721
'import/order': ['error', {
@@ -26,7 +30,11 @@ const importRules = {
2630
}]
2731
}
2832

29-
module.exports = {
33+
/**
34+
* @type {ConfigData}
35+
* @see https://eslint.org/docs/latest/use/configure/configuration-files
36+
*/
37+
const config = {
3038
extends: [
3139
'@eslint-recommended/eslint-config-typescript'
3240
],
@@ -38,3 +46,6 @@ module.exports = {
3846
...importRules
3947
}
4048
}
49+
50+
// eslint-disable-next-line unicorn/prefer-module
51+
module.exports = config

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"index.js"
1111
],
1212
"engines": {
13-
"node": ">=16"
13+
"node": ">=18"
1414
},
1515
"peerDependencies": {
1616
"@eslint-recommended/eslint-config-typescript": "^22.0.0",

0 commit comments

Comments
 (0)