serving entry file with all imports
See original GitHub issueHi @cartant
this looks like a really good solution.
However until the IDEs will support automatic import of rxjs
operators and stuff, this is not really comfortable to use.
What I’d like to propose (and of course to have) is another setting in e.g. tslint.json
that allows to specify the file, let’s call it rxjs-modules.ts
for instance, that contains all rxjs
operators etc. for the particular project.
Of course, this rxjs-modules.ts
should be imported in the beginning of main.ts
so there is no race condition problem.
Is it possible to do so? Just to sum up:
- We have some file e.g.
rxjs-modules.ts
which we set up as another property intslint.json
- This file is used to check every file in the project and it is end-programmer’s responsibility to import this file before all other imports in his entry file.
Then everybody can decide for his project: whether to import everything inside of one single file or import it in each file separately.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Python import: Advanced Techniques and Tips
While it's a good idea to separate scripts and libraries, all Python files can be both executed and imported. In a later section,...
Read more >Is it possible to import modules from all files in a directory ...
However, I like the organization of having one module per file. I end up with imports like this: import ThingA from 'lib/things/ThingA'; ...
Read more >5. The import system — Python 3.11.1 documentation
The first place checked during import search is sys.modules . This mapping serves as a cache of all modules that have been previously...
Read more >Tips for New Importers and Exporters
Entry specialists work closely with import specialists and provide the technical processing expertise required to file the necessary ...
Read more >How to Dynamically Import JavaScript with Import Maps
But by default most build systems will bundle all the code into one large file. The user will load the code regardless of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@smnbbrv I’ve added some new options that are closely related to this issue. The detection of unused imports (mentioned in this issue) is now implemented. See #2.
I’ve published version 1.1.0 which includes the
file
option. See theREADME
for more information.The change was really simple. However, TypeScript’s backslash normalization and file case canonicalization caused the usual headaches.