Comments (3)
We do use Prettier, but unfortunately Prettier cannot account for self-made white spaces such as line breaks to delimit parts in the code. This renders the usage of this tool not possible for us unfortunately, but thanks anyway for a good tool.
from cjstoesm.
In addition it removed comments, such as:
log4js.addLayout('json', () => (logEvent) => {
const generalFields = {
// Mandatory fields
foo: '1.0', // Current version of foo
The Current version of foo
was removed by the tool.
from cjstoesm.
Hi there,
cjstoesm
leverages TypeScript to parse your source code into Abstract Syntax Trees grouped together as Source Files in a Program, and as with many other ASTs, TypeScript doesn't treat whitespace as nodes in the tree, but rather has its own opinionated printer that doesn't know about or care about the original structure of the source code. So by design, it is not possible to guarantee the same structure as the original code in terms of whitespace. I would generally recommend using a tool such as Prettier in a way that ensures that your code is auto-formatted according to a set of rules you define internally in your team for each commit.
Unfortunately, the same can be said about comments, but this should be fixable. So I'll close this issue and create another one for tracking the preservation of comments. Thanks for your feedback
from cjstoesm.
Related Issues (20)
- Cannot run with npx HOT 2
- Preserve Comments HOT 5
- Doesn't work: missing outdir HOT 2
- Programmatic usage produces empty output HOT 3
- Does cjstoesm get dependent sources from node_modules (am I using it correctly)?
- Provide API method to transform a source code string HOT 3
- Improper transform on module.exports = { a: require('./b') }
- Option to convert exported objects into individual exports
- Support for direct in-place replacement? HOT 2
- Cannot read property 'text' of undefined HOT 10
- Support import assertions HOT 1
- Usage documentation is unclear HOT 2
- Issue when trying to transform module.exports with object
- package creates variable names starting with numbers
- Hi HOT 1
- feature request: move requires at bottom of file to top
- CategoryInfo : ObjectNotFound: (cjstoesm:String) [], CommandNotFoundException
- Error: Debug Failure. Unhandled SyntaxKind: ImportClause. HOT 4
- Doesn't work with newer TypeScript versions HOT 3
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 cjstoesm.