mysticatea / eslint-plugin-node

Additional ESLint's rules for Node.js
MIT License
958 stars 167 forks source link

Support `ignorePackages` option #289

Open brettz9 opened 3 years ago

brettz9 commented 3 years ago

Native ESM is not very friendly to using extensions for packages.

Though one can whitelist use of ".js" for an explicit path per https://nodejs.org/api/packages.html#packages_package_entry_points , I see no way to use wildcards to support extensions--they seem to only support lack of extensions, at least for nested wildcard paths.

One might therefore be tempted to avoid the "always" option. However, extensions are mandatory for relative/absolute paths in native ESM for both the browser as well as in Node (see https://nodejs.org/api/esm.html#esm_mandatory_file_extensions )

I would therefore suggest adopting a ignorePackages option in node/file-extension-in-import as with https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md .