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 · 5 comments

Comments

@LinusU
Copy link
Member

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

This comment has been minimized.

Copy link
Member

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. benmosher/eslint-plugin-import#803 (comment)

@stale

This comment has been minimized.

Copy link

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

@feross feross added the enhancement label May 18, 2018

@stale stale bot removed the stale label May 18, 2018

@brodybits

This comment has been minimized.

Copy link
Contributor

commented Jul 18, 2019

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

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

@feross

This comment has been minimized.

Copy link
Member

commented Jul 28, 2019

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

@sonicdoe

This comment has been minimized.

Copy link
Contributor

commented Jul 28, 2019

I’d be interested in import/order.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.