benjamn / benjamn/recast

Can object 's be preserved after modifying value?

Open
#174 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.3k
Forks
363
Avg merge
3d 8h
Merged PRs (30d)
3

Description

I set up [a little tool](https://github.com/antwarjs/cli) using recast to install a package and write its name to a configuration file (lib/install.js, lib/ast.js). The problem is that it doesn't seem to retain formatting of the value. Ie. instead of `name: 'antwar-minimal-theme'` I end up with `name: "antwar-minimal-theme"` even if the old value used '.

It is possible it is some kind of an user error so I just thought to ask directly. I tried setting `quote` option to `auto` but that didn't seem to work in this case.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the reported integration points in lib/install.js and lib/ast.js, then reproduce the rewrite with the existing quote option. Compare the generated configuration with the original source; done means the modified value preserves the original single-quote style when that style was present.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.