Comments (9)
@alubbe Nice find!
The current logic utilizes pattern matching to find imports and exports. It should of course ignore commented out lines.
from destiny.
Okay so then ignoring lines with a preceding //
is simple, but I'm not sure what the most economic/effient way would be to find out whether you're in a (possible nested) /* ... */
block - how would you resolve that with pattern matching?
from destiny.
Ok so JavaScript does not have nested comments, so it suffices to find the last */
and then scan if there are any /*
between that and your current position
from destiny.
or, more economically, find the nearest preceding /*
and the see if it has been closed by a */
before your current position - but you probably want to keep track of all of this per file because otherwise you're doing this per line with an import statement
from destiny.
anyways, thanks for this tool - I hope to try it again once it ignores comments (atm our code base is just too large and littered with comments for me to clean up by hand)
from destiny.
@alubbe There are plenty of ways to solve this problem. I'll ping you once it is done. Cheers for the input. 👍
from destiny.
@alubbe This should now be fixed on the next release of destiny
.
from destiny.
amazing, thanks!
from destiny.
@alubbe This is now released.
from destiny.
Related Issues (20)
- Different folder structure results in Windows vs Linux: missing src folder HOT 3
- Wrong shared file location HOT 1
- Documentation on best/common way to integrate into a project HOT 1
- Incompatible with TypeScript projects HOT 6
- Markdown support
- remote.require() HOT 1
- Benchmarking Destiny on CI
- collapse top level index folder HOT 10
- Why use this project over webpack? HOT 4
- Dynamic Import Problem HOT 1
- Cannot find import .yml file in svelte import HOT 3
- Tests are failing in Windows HOT 3
- Support for Dart
- bug: file movement HOT 6
- Module with its leaf dependencies in same folder HOT 1
- Destiny folder depth limit
- Error in dynamic path imports HOT 1
- Feature request - Allow placing files being fractalized _inside_ the folder
- Alternatives to destiny (project seems abandoned) HOT 3
- Would this eslint rule help destiny? `single-export-per-file`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from destiny.