Skip to content

Commit

Permalink
Breaking: update no-unsupported-features/node-builtins rule
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Oct 27, 2018
1 parent 5860795 commit d153b93
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
18 changes: 17 additions & 1 deletion docs/rules/no-unsupported-features/node-builtins.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Editor integrations of ESLint would be useful to know it in real-time.

## Rule Details

This rule reports APIs of Node.js built-in APIs on the basis of [Node.js v10.6.0 Documentation](https://nodejs.org/docs/v10.6.0/api/).
This rule reports APIs of Node.js built-in APIs on the basis of [Node.js v11.0.0 Documentation](https://nodejs.org/docs/v11.0.0/api/).

### Configured Node.js version range

Expand Down Expand Up @@ -62,6 +62,8 @@ The `"ignores"` option accepts an array of the following strings.
- `"Buffer.allocUnsafe"`
- `"Buffer.allocUnsafeSlow"`
- `"Buffer.from"`
- `"TextDecoder"`
- `"TextEncoder"`
- `"URL"`
- `"URLSearchParams"`
- `"console.clear"`
Expand All @@ -76,6 +78,7 @@ The `"ignores"` option accepts an array of the following strings.
- `"console.markTimeline"`
- `"console.profile"`
- `"console.profileEnd"`
- `"console.timeLog"`
- `"console.timeStamp"`
- `"console.timeline"`
- `"console.timelineEnd"`
Expand All @@ -86,11 +89,13 @@ The `"ignores"` option accepts an array of the following strings.
- `"process.getegid"`
- `"process.geteuid"`
- `"process.hasUncaughtExceptionCaptureCallback"`
- `"process.hrtime.bigint"`
- `"process.ppid"`
- `"process.release"`
- `"process.setegid"`
- `"process.seteuid"`
- `"process.setUncaughtExceptionCaptureCallback"`
- `"queueMicrotask"`
- `"require.resolve.paths"`

**`assert` module:**
Expand Down Expand Up @@ -136,6 +141,7 @@ The `"ignores"` option accepts an array of the following strings.
- `"console.markTimeline"`
- `"console.profile"`
- `"console.profileEnd"`
- `"console.timeLog"`
- `"console.timeStamp"`
- `"console.timeline"`
- `"console.timelineEnd"`
Expand All @@ -147,6 +153,8 @@ The `"ignores"` option accepts an array of the following strings.
- `"crypto.Certificate.verifySpkac"`
- `"crypto.constants"`
- `"crypto.fips"`
- `"crypto.generateKeyPair"`
- `"crypto.generateKeyPairSync"`
- `"crypto.getCurves"`
- `"crypto.getFips"`
- `"crypto.privateEncrypt"`
Expand All @@ -166,6 +174,7 @@ The `"ignores"` option accepts an array of the following strings.

**`fs` module:**

- `"fs.Dirent"`
- `"fs.copyFile"`
- `"fs.copyFileSync"`
- `"fs.mkdtemp"`
Expand All @@ -189,7 +198,10 @@ The `"ignores"` option accepts an array of the following strings.
**`os` module:**

- `"os.constants"`
- `"os.constants.priority"`
- `"os.getPriority"`
- `"os.homedir"`
- `"os.setPriority"`
- `"os.userInfo"`

**`path` module:**
Expand All @@ -202,13 +214,15 @@ The `"ignores"` option accepts an array of the following strings.

**`process` module:**

- `"process.allowedNodeEnvironmentFlags"`
- `"process.argv0"`
- `"process.channel"`
- `"process.cpuUsage"`
- `"process.emitWarning"`
- `"process.getegid"`
- `"process.geteuid"`
- `"process.hasUncaughtExceptionCaptureCallback"`
- `"process.hrtime.bigint"`
- `"process.ppid"`
- `"process.release"`
- `"process.setegid"`
Expand Down Expand Up @@ -243,6 +257,7 @@ The `"ignores"` option accepts an array of the following strings.
- `"util.TextDecoder"`
- `"util.TextEncoder"`
- `"util.types"`
- `"util.types.isBoxedPrimitive"`

**`v8` module:**

Expand All @@ -259,6 +274,7 @@ The `"ignores"` option accepts an array of the following strings.
**`vm` module:**

- `"vm.Module"`
- `"vm.compileFunction"`

**`worker_threads` module:**

Expand Down
24 changes: 23 additions & 1 deletion lib/rules/no-unsupported-features/node-builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const enumeratePropertyNames = require("../../util/enumerate-property-names")
/*eslint-disable camelcase */
const trackMap = {
globals: {
queueMicrotask: { [READ]: { supported: "11.0.0" } },
require: {
resolve: {
paths: { [READ]: { supported: "8.9.0" } },
Expand Down Expand Up @@ -60,6 +61,7 @@ const trackMap = {
markTimeline: { [READ]: { supported: "8.0.0" } },
profile: { [READ]: { supported: "8.0.0" } },
profileEnd: { [READ]: { supported: "8.0.0" } },
timeLog: { [READ]: { supported: "10.7.0" } },
timeStamp: { [READ]: { supported: "8.0.0" } },
timeline: { [READ]: { supported: "8.0.0" } },
timelineEnd: { [READ]: { supported: "8.0.0" } },
Expand All @@ -72,6 +74,8 @@ const trackMap = {
},
constants: { [READ]: { supported: "6.3.0" } },
fips: { [READ]: { supported: "6.0.0" } },
generateKeyPair: { [READ]: { supported: "10.12.0" } },
generateKeyPairSync: { [READ]: { supported: "10.12.0" } },
getCurves: { [READ]: { supported: "2.3.0" } },
getFips: { [READ]: { supported: "10.0.0" } },
privateEncrypt: { [READ]: { supported: "1.1.0" } },
Expand All @@ -91,6 +95,7 @@ const trackMap = {
},
},
fs: {
Dirent: { [READ]: { supported: "10.10.0" } },
copyFile: { [READ]: { supported: "8.5.0" } },
copyFileSync: { [READ]: { supported: "8.5.0" } },
mkdtemp: { [READ]: { supported: "5.10.0" } },
Expand All @@ -115,8 +120,13 @@ const trackMap = {
builtinModules: { [READ]: { supported: "9.3.0" } },
},
os: {
constants: { [READ]: { supported: "6.3.0" } },
constants: {
[READ]: { supported: "6.3.0" },
priority: { [READ]: { supported: "10.10.0" } },
},
getPriority: { [READ]: { supported: "10.10.0" } },
homedir: { [READ]: { supported: "2.3.0" } },
setPriority: { [READ]: { supported: "10.10.0" } },
userInfo: { [READ]: { supported: "6.0.0" } },
},
path: {
Expand All @@ -126,6 +136,7 @@ const trackMap = {
[READ]: { supported: "8.5.0" },
},
process: {
allowedNodeEnvironmentFlags: { [READ]: { supported: "10.10.0" } },
argv0: { [READ]: { supported: "6.4.0" } },
channel: { [READ]: { supported: "7.1.0" } },
cpuUsage: { [READ]: { supported: "6.1.0" } },
Expand All @@ -135,6 +146,9 @@ const trackMap = {
hasUncaughtExceptionCaptureCallback: {
[READ]: { supported: "9.3.0" },
},
hrtime: {
bigint: { [READ]: { supported: "10.7.0" } },
},
ppid: { [READ]: { supported: "9.2.0" } },
release: { [READ]: { supported: "3.0.0" } },
setegid: { [READ]: { supported: "2.0.0" } },
Expand Down Expand Up @@ -170,6 +184,7 @@ const trackMap = {
TextEncoder: { [READ]: { supported: "8.3.0" } },
types: {
[READ]: { supported: "10.0.0" },
isBoxedPrimitive: { [READ]: { supported: "10.11.0" } },
},
},
v8: {
Expand All @@ -185,6 +200,7 @@ const trackMap = {
},
vm: {
Module: { [READ]: { supported: "9.6.0" } },
compileFunction: { [READ]: { supported: "10.10.0" } },
},
worker_threads: {
[READ]: { supported: "10.5.0" },
Expand All @@ -193,6 +209,12 @@ const trackMap = {
}
Object.assign(trackMap.globals, {
Buffer: trackMap.modules.buffer.Buffer,
TextDecoder: Object.assign({}, trackMap.modules.util.TextDecoder, {
[READ]: { supported: "11.0.0" },
}),
TextEncoder: Object.assign({}, trackMap.modules.util.TextEncoder, {
[READ]: { supported: "11.0.0" },
}),
URL: Object.assign({}, trackMap.modules.url.URL, {
[READ]: { supported: "10.0.0" },
}),
Expand Down

0 comments on commit d153b93

Please sign in to comment.