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

Missing rule to ensure file extension in module imports #69

Open
chkpnt opened this issue Feb 22, 2022 · 0 comments
Open

Missing rule to ensure file extension in module imports #69

chkpnt opened this issue Feb 22, 2022 · 0 comments

Comments

@chkpnt
Copy link

chkpnt commented Feb 22, 2022

According to 3.4.1.1.1 File extensions in import paths, "the .js file extension is not optional in import paths and must always be included."

I guess this rule shouldn't be limited to '.js' but to all imported modules. Nevertheless, eslint-config-google should be able to enforce 3.4.1.1.1.

Currently, I'm using import/extension from eslint-plugin-import with this config:

rules: {
   // ...
   "import/extensions": ["error", "always"],
  // ...
}

In order to enforce 3.4.1.1.1 one-to-one, "import/extensions": ["error", { js: "always" }] is the corresponding configuration.

I suggest to include (copy?) import/extension into eslint-config-google.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant