Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
github
/
codeql-action
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
0
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security
Insights
Files
9bfb9ba
.github
.vscode
analyze
autobuild
init
lib
node_modules
.bin
@aashutoshrathi
@actions
@ava
@azure
@babel
@chrisgavin
@eslint-community
@eslint
@github
@humanwhocodes
@nodelib
@octokit
@opentelemetry
@pkgr
@schemastore
@sinonjs
@types
@typescript-eslint
abort-controller
acorn-jsx
acorn-walk
acorn
adm-zip
aggregate-error
ajv
ansi-regex
ansi-styles
anymatch
argparse
aria-query
array-buffer-byte-length
array-find-index
array-includes
array-union
array.prototype.findlastindex
array.prototype.flat
array.prototype.flatmap
arraybuffer.prototype.slice
arrgv
ast-types-flow
asynckit
ava
available-typed-arrays
axe-core
axobject-query
balanced-match
before-after-hook
big-integer
binary-extensions
blueimp-md5
bottleneck
bplist-parser
brace-expansion
braces
browserslist
bundle-name
call-bind
callsites
caniuse-lite
cbor
chalk
check-disk-space
chokidar
chunkd
ci-info
ci-parallel-vars
clean-stack
clean-yaml-object
cli-truncate
cliui
code-excerpt
color-convert
color-name
combined-stream
common-path-prefix
concat-map
concordance
console-log-level
convert-to-spaces
cross-spawn
currently-unhandled
damerau-levenshtein
date-time
debug
deep-equal
deep-is
default-browser-id
default-browser
define-lazy-prop
define-properties
del
delayed-stream
deprecation
dequal
diff
dir-glob
doctrine
eastasianwidth
electron-to-chromium
emittery
emoji-regex
enhanced-resolve
es-abstract
es-get-iterator
es-set-tostringtag
es-shim-unscopables
es-to-primitive
escalade
escape-string-regexp
eslint-config-prettier
eslint-import-resolver-node
eslint-import-resolver-typescript
eslint-module-utils
eslint-plugin-escompat
eslint-plugin-eslint-comments
eslint-plugin-filenames
eslint-plugin-github
eslint-plugin-i18n-text
eslint-plugin-import
config
docs/rules
consistent-type-specifier-style.md
default.md
dynamic-import-chunkname.md
export.md
exports-last.md
extensions.md
first.md
group-exports.md
imports-first.md
max-dependencies.md
named.md
namespace.md
newline-after-import.md
no-absolute-path.md
no-amd.md
no-anonymous-default-export.md
no-commonjs.md
no-cycle.md
no-default-export.md
no-deprecated.md
no-duplicates.md
no-dynamic-require.md
no-empty-named-blocks.md
no-extraneous-dependencies.md
no-import-module-exports.md
no-internal-modules.md
no-mutable-exports.md
no-named-as-default-member.md
no-named-as-default.md
no-named-default.md
no-named-export.md
no-namespace.md
no-nodejs-modules.md
no-relative-packages.md
no-relative-parent-imports.md
no-restricted-paths.md
no-self-import.md
no-unassigned-import.md
no-unresolved.md
no-unused-modules.md
no-useless-path-segments.md
no-webpack-loader-syntax.md
order.md
prefer-default-export.md
unambiguous.md
lib
memo-parser
node_modules
CHANGELOG.md
CONTRIBUTING.md
LICENSE
README.md
RELEASE.md
SECURITY.md
package.json
eslint-plugin-jsx-a11y
eslint-plugin-no-async-foreach
eslint-plugin-no-only-tests
eslint-plugin-prettier
eslint-rule-documentation
eslint-scope
eslint-visitor-keys
eslint
espree
esprima
esquery
esrecurse
estraverse
esutils
event-target-shim
events
execa
fast-deep-equal
fast-diff
fast-glob
fast-json-stable-stringify
fast-levenshtein
fastq
figures
file-entry-cache
file-url
fill-range
find-up
flat-cache
flatted
for-each
form-data
fs.realpath
fs
fsevents
function-bind
function.prototype.name
functions-have-names
gar
get-caller-file
get-folder-size
get-intrinsic
get-stream
get-symbol-description
get-tsconfig
glob-parent
globals
globalthis
globby
gopd
graceful-fs
graphemer
has-bigints
has-property-descriptors
has-proto
has-symbols
has-tostringtag
has
human-signals
ignore-by-default
ignore
import-fresh
imurmurhash
indent-string
inflight
inherits
internal-slot
irregular-plurals
is-arguments
is-array-buffer
is-bigint
is-binary-path
is-boolean-object
is-callable
is-core-module
is-date-object
is-docker
is-error
is-extglob
is-fullwidth-code-point
is-glob
is-inside-container
is-map
is-negative-zero
is-number-object
is-number
is-path-cwd
is-path-inside
is-plain-object
is-promise
is-regex
is-set
is-shared-array-buffer
is-stream
is-string
is-symbol
is-typed-array
is-unicode-supported
is-weakmap
is-weakref
is-weakset
is-wsl
isarray
isexe
js-string-escape
js-yaml
json-schema-traverse
json-stable-stringify-without-jsonify
json-stringify-safe
json5
jsonschema
jsx-ast-utils
just-extend
language-subtag-registry
language-tags
levn
load-json-file
locate-path
lodash.camelcase
lodash.get
lodash.kebabcase
lodash.merge
lodash.snakecase
lodash.upperfirst
lodash
long
lru-cache
map-age-cleaner
matcher
md5-hex
mem
merge-stream
merge2
micromatch
mime-db
mime-types
mimic-fn
minimatch
minimist
ms
natural-compare
nise
nock
node-fetch
node-releases
nofilter
normalize-path
npm-run-path
object-inspect
object-is
object-keys
object.assign
object.entries
object.fromentries
object.groupby
object.values
once
onetime
open
optionator
p-defer
p-event
p-limit
p-locate
p-map
p-timeout
parent-module
parse-ms
path-exists
path-is-absolute
path-key
path-parse
path-to-regexp
path-type
path
picocolors
picomatch
pkg-conf
plur
prelude-ls
prettier-linter-helpers
prettier
pretty-ms
process
propagate
punycode
queue-microtask
readdirp
regenerator-runtime
regexp.prototype.flags
removeNPMAbsolutePaths
require-directory
requireindex
resolve-cwd
resolve-from
resolve-pkg-maps
resolve
reusify
rimraf
run-applescript
run-parallel
safe-array-concat
safe-regex-test
sax
semver
serialize-error
shebang-command
shebang-regex
side-channel
signal-exit
sinon
slash
slice-ansi
sprintf-js
stack-utils
stop-iteration-iterator
string-width
string.prototype.trim
string.prototype.trimend
string.prototype.trimstart
strip-ansi
strip-bom
strip-final-newline
strip-json-comments
supertap
supports-preserve-symlinks-flag
svg-element-attributes
synckit
tapable
temp-dir
text-table
time-zone
tiny-each-async
titleize
tmp-promise
tmp
to-regex-range
tr46
ts-api-utils
tsconfig-paths
tslib
tunnel
type-check
type-detect
type-fest
typed-array-buffer
typed-array-byte-length
typed-array-byte-offset
typed-array-length
typescript
unbox-primitive
universal-user-agent
untildify
update-browserslist-db
uri-js
util
uuid
webidl-conversions
well-known-symbols
whatwg-url
which-boxed-primitive
which-collection
which-typed-array
which
wrap-ansi
wrappy
write-file-atomic
xml2js
xmlbuilder
y18n
yallist
yargs-parser
yargs
yocto-queue
zlib
.package-lock.json
pr-checks
python-setup
queries
resolve-environment
src
tests
upload-sarif
.editorconfig
.eslintignore
.eslintrc.json
.git-blame-ignore-revs
.gitattributes
.gitignore
.npmrc
CHANGELOG.md
CODEOWNERS
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
package-lock.json
package.json
tsconfig.json
Breadcrumbs
codeql-action
/
node_modules
/
eslint-plugin-import
/
docs
/
rules
/
no-nodejs-modules.md
Blame
Blame
Latest commit
github-actions[bot]
Update checked-in dependencies
Aug 21, 2023
02c4574
·
Aug 21, 2023
History
History
42 lines (27 loc) · 829 Bytes
Breadcrumbs
codeql-action
/
node_modules
/
eslint-plugin-import
/
docs
/
rules
/
no-nodejs-modules.md
Top
File metadata and controls
Preview
Code
Blame
42 lines (27 loc) · 829 Bytes
Raw
# import/no-nodejs-modules <!-- end auto-generated rule header --> Forbid the use of Node.js builtin modules. Can be useful for client-side web projects that do not have access to those modules. ## Options This rule supports the following options: - `allow`: Array of names of allowed modules. Defaults to an empty array. ## Rule Details ### Fail ```js import fs from 'fs'; import path from 'path'; var fs = require('fs'); var path = require('path'); ``` ### Pass ```js import _ from 'lodash'; import foo from 'foo'; import foo from './foo'; var _ = require('lodash'); var foo = require('foo'); var foo = require('./foo'); /* eslint import/no-nodejs-modules: ["error", {"allow": ["path"]}] */ import path from 'path'; ``` ## When Not To Use It If you have a project that is run mainly or partially using Node.js.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
You can’t perform that action at this time.