@@ -34,8 +34,7 @@ npm i putout @putout/plugin-esm -D
3434
3535## File rules
3636
37- - ✅ [ apply-namespace-import-to-file] ( #apply-namespace-import-file] ) ;
38- - ✅ [ apply-named-import-to-file] ( #apply-named-import-to-file ) ;
37+ - ✅ [ apply-import-by-type-to-file] ( #apply-import-by-type-to-file] ) ;
3938- ✅ [ apply-privately-imported-file] ( #apply-privately-imported-file ) ;
4039- ✅ [ apply-js-imported-file] ( #apply-js-imported-file ) ;
4140- ✅ [ resolve-imported-file] ( #resolve-imported-file ) ;
@@ -62,8 +61,7 @@ npm i putout @putout/plugin-esm -D
6261 "esm/apply-js-imported-file" : " off" ,
6362 "esm/resolve-imported-file" : " off" ,
6463 "esm/shorten-imported-file" : " off" ,
65- "esm/apply-namespace-import-to-file" : " off" ,
66- "esm/apply-named-import-to-file" : " off" ,
64+ "esm/apply-import-by-type-to-file" : " off" ,
6765 "esm/apply-privately-imported-file" : " off" ,
6866 "esm/remove-useless-export-specifiers" : " off"
6967 }
@@ -401,18 +399,22 @@ import('foo.json', {
401399
402400## File Rules
403401
404- ### apply-named- import-to-file
402+ ### apply-import-by-type -to-file
405403
406404The rule fixes:
407405
408406> ` SyntaxError: The requested module './a.js' does not provide an export named 'default' `
409407
410408Check out in 🐊** Putout Editor** :
411409
410+ - ✅ [ ` apply-namespace-import-to-file ` ] ( https://putout.cloudcmd.io/#/gist/1492d584559e5798325047de679222a0/c6a37a803b80823de1b64ab944f2427aecefb51b ) ;
412411- ✅ [ ` get-imports ` ] ( https://putout.cloudcmd.io/#/gist/5d7687215e9fbdf705935c444503dded/75a98d2db9d3847c73017e41637924b1cfd5a598 ) ;
413412- ✅ [ ` has-export-default ` ] ( https://putout.cloudcmd.io/#/gist/b50ccfe5cc8c0c97e2fc98b37903ade4/fbc026e6f1027581f7aa4879dcafcaa7754bf8f4 ) ;
413+ - ✅ [ ` apply-namespace-import ` ] ( https://putout.cloudcmd.io/#/gist/23a6dc6741b772c03fbed95feda2b451/1fbecac6fc40282bcda0593aa666a8c213ef85b7 ) ;
414414- ✅ [ ` is-esm ` ] ( https://putout.cloudcmd.io/#/gist/fa080be2bf3a6560e289d84b5873c2bc/2601091f6bf97148843767968c3afcb36dde31de ) ;
415415
416+ #### named import
417+
416418Let's consider file structure:
417419
418420```
@@ -424,31 +426,19 @@ Let's consider file structure:
424426
425427In this case ` index.js ` can be fixed:
426428
427- #### ❌ Example of incorrect code
429+ ##### ❌ Example of incorrect code
428430
429431``` js
430432import a from ' ./a.js' ;
431433```
432434
433- #### ✅ Example of correct code
435+ ##### ✅ Example of correct code
434436
435437``` js
436438import {a } from ' ./a.js' ;
437439```
438440
439- ### apply-namespace-import-to-file
440-
441- The rule fixes:
442-
443- > ` SyntaxError: The requested module './a.js' does not provide an export named 'default' `
444-
445- Check out in 🐊** Putout Editor** :
446-
447- - ✅ [ ` apply-namespace-import-to-file ` ] ( https://putout.cloudcmd.io/#/gist/1492d584559e5798325047de679222a0/c6a37a803b80823de1b64ab944f2427aecefb51b ) ;
448- - ✅ [ ` get-imports ` ] ( https://putout.cloudcmd.io/#/gist/5d7687215e9fbdf705935c444503dded/75a98d2db9d3847c73017e41637924b1cfd5a598 ) ;
449- - ✅ [ ` has-export-default ` ] ( https://putout.cloudcmd.io/#/gist/b50ccfe5cc8c0c97e2fc98b37903ade4/fbc026e6f1027581f7aa4879dcafcaa7754bf8f4 ) ;
450- - ✅ [ ` apply-namespace-import ` ] ( https://putout.cloudcmd.io/#/gist/23a6dc6741b772c03fbed95feda2b451/1fbecac6fc40282bcda0593aa666a8c213ef85b7 ) ;
451- - ✅ [ ` is-esm ` ] ( https://putout.cloudcmd.io/#/gist/fa080be2bf3a6560e289d84b5873c2bc/2601091f6bf97148843767968c3afcb36dde31de ) ;
441+ #### namespace import
452442
453443Let's consider file structure:
454444
@@ -461,13 +451,13 @@ Let's consider file structure:
461451
462452In this case ` index.js ` can be fixed:
463453
464- #### ❌ Example of incorrect code
454+ ##### ❌ Example of incorrect code
465455
466456``` js
467457import a from ' ./a.js' ;
468458```
469459
470- #### ✅ Example of correct code
460+ ##### ✅ Example of correct code
471461
472462``` js
473463import * as a from ' ./a.js' ;
0 commit comments