-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
What problem does this feature solve?
Port https://www.npmjs.com/package/eslint-plugin-import
What does the proposed API of configuration look like?
Rules
Helpful warnings
- export: Forbid any invalid exports, i.e. re-export of the same name
- no-deprecated: Forbid imported names marked with
@deprecateddocumentation tag - no-empty-named-blocks: Forbid empty named import blocks
- no-extraneous-dependencies: Forbid the use of extraneous packages
- no-mutable-exports: Forbid the use of mutable exports with
varorlet - no-named-as-default: Forbid use of exported name as identifier of default export
- no-named-as-default-member: Forbid use of exported name as property of default export
- no-unused-modules: Forbid modules without exports, or exports without matching import in another module
Module systems
- no-amd: Forbid AMD
requireanddefinecalls - no-commonjs: Forbid CommonJS
requirecalls andmodule.exportsorexports.* - no-import-module-exports: Forbid import statements with CommonJS module.exports
- no-nodejs-modules: Forbid Node.js builtin modules
- unambiguous: Forbid potentially ambiguous parse goal (
scriptvs.module)
Static analysis
- default: Ensure a default export is present, given a default import
- enforce-node-protocol-usage: Enforce either using, or omitting, the
node:protocol when importing Node.js builtin modules - named: Ensure named imports correspond to a named export in the remote file
- namespace: Ensure imported namespaces contain dereferenced properties as they are dereferenced
- no-absolute-path: Forbid import of modules using absolute paths
- no-cycle: Forbid a module from importing a module with a dependency path back to itself
- no-dynamic-require: Forbid
require()calls with expressions - no-internal-modules: Forbid importing the submodules of other modules
- no-relative-packages: Forbid importing packages through relative paths
- no-relative-parent-imports: Forbid importing modules from parent directories
- no-restricted-paths: Enforce which files can be imported in a given folder
- no-self-import: Forbid a module from importing itself
- no-unresolved: Ensure imports point to a file/module that can be resolved
- no-useless-path-segments: Forbid unnecessary path segments in import and require statements
- no-webpack-loader-syntax: Forbid webpack loader syntax in imports
Style guide
- consistent-type-specifier-style: Enforce or ban the use of inline type-only markers for named imports
- dynamic-import-chunkname: Enforce a leading comment with the webpackChunkName for dynamic imports
- exports-last: Ensure all exports appear after other statements
- extensions: Ensure consistent use of file extension within the import path
- first: Ensure all imports appear before other statements
- group-exports: Prefer named exports to be grouped together in a single export declaration
- imports-first: Replaced by
import/first(deprecated) - max-dependencies: Enforce the maximum number of dependencies a module can have
- newline-after-import: Enforce a newline after import statements
- no-anonymous-default-export: Forbid anonymous values as default exports
- no-default-export: Forbid default exports
- no-duplicates: Forbid repeated import of the same module in multiple places
- no-named-default: Forbid named default exports
- no-named-export: Forbid named exports
- no-namespace: Forbid namespace (a.k.a. "wildcard"
*) imports - no-unassigned-import: Forbid unassigned imports
- order: Enforce a convention in module import order
- prefer-default-export: Prefer a default export if module exports a single name or multiple names
Metadata
Metadata
Assignees
Labels
No labels