Skip to content

Commit 8247e33

Browse files
remcohaszingljharb
authored andcommitted
[eslint config] [base] [patch] Set import/extensions to ignorePackages
This allows to import non-JavaScript files through the main export of a dependency's package.json. The following would trigger an error before, but is fine with the new configuration: ```js import 'roboto-fontface'; ```
1 parent a100a39 commit 8247e33

File tree

1 file changed

+1
-1
lines changed
  • packages/eslint-config-airbnb-base/rules

1 file changed

+1
-1
lines changed

packages/eslint-config-airbnb-base/rules/imports.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ module.exports = {
132132

133133
// Ensure consistent use of file extension within the import path
134134
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
135-
'import/extensions': ['error', 'always', {
135+
'import/extensions': ['error', 'ignorePackages', {
136136
js: 'never',
137137
mjs: 'never',
138138
jsx: 'never',

0 commit comments

Comments
 (0)