kytta / eslint-plugin-node-import Goto Github PK
View Code? Open in Web Editor NEWA minimal ESLint plugin that requires `node:` imports
License: ISC License
A minimal ESLint plugin that requires `node:` imports
License: ISC License
What is performance difference between your project and eslint-plugin-prefer-node-builtin-import
?
If I had import path from 'path'
the rule will change it to import path from "node:path"
, replacing also quotes from '
to "
.
I got an error
TypeError: Cannot read properties of null (reading 'value')
Occurred while linting /home/ai/Dev/browsersl.ist/client/data/regions.js:4
Rule: "node-import/prefer-node-protocol"
at literalVisitor (/home/ai/Dev/browsersl.ist/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-node-import/lib/rules/prefer-node-protocol.js:24:22)
on the code:
// regions.json is created on `postinstall` step
import { continents, countryCodes } from './regions.json'
export const DEFAULT_REGION = 'alt-ww' // <= here is a problem
I was wondering if and how this plugin would work with bun (https://bun.sh) — which just reached v1.0.0 today.
$ bun repl
Welcome to Bun v1.0.0
Type ".help" for more information.
> const { builtinModules } = require("node:module");
undefined
> builtinModules
[
'_http_agent', '_http_client', '_http_common',
'_http_incoming', '_http_outgoing', '_http_server',
'_stream_duplex', '_stream_passthrough', '_stream_readable',
'_stream_transform', '_stream_wrap', '_stream_writable',
'_tls_common', '_tls_wrap', 'assert',
'assert/strict', 'async_hooks', 'buffer',
'bun', 'bun:ffi', 'bun:jsc',
'bun:sqlite', 'bun:wrap', 'child_process',
'cluster', 'console', 'constants',
'crypto', 'detect-libc', 'dgram',
'diagnostics_channel', 'dns', 'dns/promises',
'domain', 'events', 'fs',
'fs/promises', 'http', 'http2',
'https', 'inspector', 'inspector/promises',
'module', 'net', 'os',
'path', 'path/posix', 'path/win32',
'perf_hooks', 'process', 'punycode',
'querystring', 'readline', 'readline/promises',
'repl', 'stream', 'stream/consumers',
'stream/promises', 'stream/web', 'string_decoder',
'sys', 'timers', 'timers/promises',
'tls', 'trace_events', 'tty',
'undici', 'url', 'util',
'util/types', 'v8', 'vm',
'wasi', 'worker_threads', 'ws',
'zlib'
]
whereas node has this list:
$ node
Welcome to Node.js v20.5.1.
Type ".help" for more information.
> const { builtinModules } = require("node:module");
undefined
> builtinModules
[
'_http_agent', '_http_client', '_http_common',
'_http_incoming', '_http_outgoing', '_http_server',
'_stream_duplex', '_stream_passthrough', '_stream_readable',
'_stream_transform', '_stream_wrap', '_stream_writable',
'_tls_common', '_tls_wrap', 'assert',
'assert/strict', 'async_hooks', 'buffer',
'child_process', 'cluster', 'console',
'constants', 'crypto', 'dgram',
'diagnostics_channel', 'dns', 'dns/promises',
'domain', 'events', 'fs',
'fs/promises', 'http', 'http2',
'https', 'inspector', 'inspector/promises',
'module', 'net', 'os',
'path', 'path/posix', 'path/win32',
'perf_hooks', 'process', 'punycode',
'querystring', 'readline', 'readline/promises',
'repl', 'stream', 'stream/consumers',
'stream/promises', 'stream/web', 'string_decoder',
'sys', 'timers', 'timers/promises',
'tls', 'trace_events', 'tty',
'url', 'util', 'util/types',
'v8', 'vm', 'wasi',
'worker_threads', 'zlib'
]
So it seems that bun's modules are all, either prefixed with bun:
or simply called bun
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.