This repository was archived by the owner on May 29, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
packages/eslint-config-airbnb-base/rules Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1242,6 +1242,21 @@ Other Style Guides
12421242 } from ' path' ;
12431243 ```
12441244
1245+ <a name="modules--no-webpack-loader-syntax"></a>
1246+ - [10.9](#modules--no-webpack-loader-syntax) Disallow Webpack loader syntax in module import statements.
1247+ eslint: [`import/no-webpack-loader-syntax`](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md)
1248+ > Why? Since using Webpack syntax in the imports couples the code to a module bundler. Prefer using the loader syntax in `webpack.config.js`.
1249+
1250+ ```javascript
1251+ // bad
1252+ import fooSass from ' css! sass! foo .scss ' ;
1253+ import barCss from ' style! css! bar .css ' ;
1254+
1255+ // good
1256+ import fooSass from ' foo .scss ' ;
1257+ import barCss from ' bar .css ' ;
1258+ ```
1259+
12451260**[⬆ back to top](#table-of-contents)**
12461261
12471262## Iterators and Generators
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ module.exports = {
162162
163163 // Forbid Webpack loader syntax in imports
164164 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md
165- 'import/no-webpack-loader-syntax' : 'off ' ,
165+ 'import/no-webpack-loader-syntax' : 'error ' ,
166166
167167 // Prevent unassigned imports
168168 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unassigned-import.md
You can’t perform that action at this time.
0 commit comments