Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable more rules from the import plugin #947

Open
LinusU opened this issue Jul 6, 2017 · 9 comments
Open

Enable more rules from the import plugin #947

LinusU opened this issue Jul 6, 2017 · 9 comments

Comments

@LinusU
Copy link
Member

LinusU commented Jul 6, 2017

There seems to be a lot of rules from the import plugin that aren't enable, I think that we should consider enabling them.

Currently the ones enabled are:

"import/export": "error",
"import/first": "error",
"import/no-duplicates": "error",
"import/no-webpack-loader-syntax": "error",

which leaves a lot of rules not enabled:

Rules

Static analysis:

  • Ensure imports point to a file/module that can be resolved. (no-unresolved)
  • Ensure named imports correspond to a named export in the remote file. (named)
  • Ensure a default export is present, given a default import. (default)
  • Ensure imported namespaces contain dereferenced properties as they are dereferenced. (namespace)
  • Restrict which files can be imported in a given folder (no-restricted-paths)
  • Forbid import of modules using absolute paths (no-absolute-path)
  • Forbid require() calls with expressions (no-dynamic-require)
  • Prevent importing the submodules of other modules (no-internal-modules)
  • Forbid Webpack loader syntax in imports (no-webpack-loader-syntax)

Helpful warnings:

Module systems:

  • Report potentially ambiguous parse goal (script vs. module) (unambiguous)
  • Report CommonJS require calls and module.exports or exports.*. (no-commonjs)
  • Report AMD require and define calls. (no-amd)
  • No Node.js builtin modules. (no-nodejs-modules)

Style guide:

@feross
Copy link
Member

feross commented Feb 17, 2018

no-absolute-path was enabled in the past, but we had to remove it because it was too slow. See: #861

Fortunately, it appears to have been sped up. If we benchmark it we can consider re-enabling it. import-js/eslint-plugin-import#803 (comment)

@stale
Copy link

stale bot commented May 18, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label May 18, 2018
@stale stale bot removed the stale label May 18, 2018
@brodybits
Copy link
Contributor

Add this to the list for Standard 14 (#1321)?

@feross feross added this to the standard v14 milestone Jul 28, 2019
@feross
Copy link
Member

feross commented Jul 28, 2019

I just re-enabled no-absolute-path. Which other rules are folks interested in seeing enabled?

@sonicdoe
Copy link
Contributor

I’d be interested in import/order.

@feross feross modified the milestones: standard 14, standard 15 Aug 15, 2019
@Nomeasmo
Copy link

Nomeasmo commented Nov 5, 2019

I find named and default pretty important. Are there any concerns?

@LinusU
Copy link
Member Author

LinusU commented Mar 4, 2020

Issue for import/order: #1490

@mightyiam
Copy link
Member

@feross feross modified the milestones: standard 15, standard 16 Oct 22, 2020
@feross feross modified the milestones: standard 16, standard 17 Oct 29, 2020
@dziku86
Copy link

dziku86 commented Dec 31, 2020

What about Dynamic import() ? https://v8.dev/features/dynamic-import
Is it possible to enable new ECMAScript features without a custom parser?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

7 participants