Eslint-plugin-import: import/extensions cannot understand .htaccess file name

Created on 27 Nov 2016  路  5Comments  路  Source: benmosher/eslint-plugin-import

import 'file?name=[name].[ext]!./.htaccess'; gives me this-

Missing file extension for "file?name=[name].[ext]!./.htaccess" import/extensions

bug help wanted resolvewebpack semver-minor

Most helpful comment

ah yeah, so two issues here:

  • import/extensions rule should probably ignore .-prefixed file names (such as .htaccess)
  • import/extensions needs the new resolver goodness for path sanitizing (circa #479)

All 5 comments

Is that a custom webpack syntax?

@ljharb Yes, file?name=[name].[ext]! is a custom webpack syntax. You can ignore that. I can also turn this into a simpler form- import './.htaccess';

Either way, eslint throws the aforementioned error :confused: Since, .htaccess does not have a file name, I thought import/extensions couldn't understand it. Please correct me if it's not a valid issue.

ah yeah, so two issues here:

  • import/extensions rule should probably ignore .-prefixed file names (such as .htaccess)
  • import/extensions needs the new resolver goodness for path sanitizing (circa #479)

Any update on this? Annoying when trying to import dotfiles, for example .eslintrc

Fixed by #1572, i believe, which will be in the next release.

Was this page helpful?
0 / 5 - 0 ratings