Skip to content

Commit

Permalink
feat: Support node16 for eslint 8 (eslint-community#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
scagood committed May 14, 2024
1 parent cb8ffa6 commit e6fc15b
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/rules/hashbang.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ module.exports = {
start: { line: 1, column: 0 },
end: {
line: 1,
column: sourceCode.lines.at(0)?.length ?? 0,
column: sourceCode.lines[0]?.length ?? 0,
},
}

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/prefer-node-protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
"use strict"

const { isBuiltin } = require("node:module")
const isBuiltin = require("is-builtin-module")
const getConfiguredNodeVersion = require("../util/get-configured-node-version")
const getSemverRange = require("../util/get-semver-range")
const visitImport = require("../util/visit-import")
Expand Down
2 changes: 1 addition & 1 deletion lib/util/extend-trackmap-with-node-prefix.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict"

const { isBuiltin } = require("node:module")
const isBuiltin = require("is-builtin-module")

/**
* Extend traceMap.modules with `node:` prefixed modules
Expand Down
2 changes: 1 addition & 1 deletion lib/util/import-target.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"use strict"

const { resolve } = require("path")
const { isBuiltin } = require("node:module")
const isBuiltin = require("is-builtin-module")
const resolver = require("enhanced-resolve")

const isTypescript = require("./is-typescript")
Expand Down
2 changes: 1 addition & 1 deletion lib/util/map-typescript-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function convertJsExtensionToTs(context, filePath, fallbackExtension) {
const { backward } = getTypescriptExtensionMap(context)
const ext = path.extname(filePath)

if (isTypescript(context) && Object.hasOwn(backward, ext)) {
if (isTypescript(context) && {}.hasOwnProperty.call(backward, ext)) {
return backward[ext]
}

Expand Down
2 changes: 1 addition & 1 deletion lib/util/visit-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"use strict"

const path = require("path")
const { isBuiltin } = require("node:module")
const isBuiltin = require("is-builtin-module")
const getResolvePaths = require("./get-resolve-paths")
const getTryExtensions = require("./get-try-extensions")
const ImportTarget = require("./import-target")
Expand Down
2 changes: 1 addition & 1 deletion lib/util/visit-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const {
ReferenceTracker,
getStringIfConstant,
} = require("@eslint-community/eslint-utils")
const { isBuiltin } = require("node:module")
const isBuiltin = require("is-builtin-module")
const getResolvePaths = require("./get-resolve-paths")
const getTryExtensions = require("./get-try-extensions")
const ImportTarget = require("./import-target")
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "17.6.0",
"description": "Additional ESLint's rules for Node.js",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
"node": ">=16.0.0"
},
"main": "lib/index.js",
"types": "types/index.d.ts",
Expand All @@ -22,6 +22,7 @@
"get-tsconfig": "^4.7.0",
"globals": "^15.0.0",
"ignore": "^5.2.4",
"is-builtin-module": "^3.2.1",
"minimatch": "^9.0.0",
"semver": "^7.5.3"
},
Expand Down

0 comments on commit e6fc15b

Please sign in to comment.