tslint-to-eslint-config icon indicating copy to clipboard operation
tslint-to-eslint-config copied to clipboard

Use a diff writer instead of complete override for CSON editor config conversions

Open JoshuaKGoldberg opened this issue 5 years ago • 1 comments

🚀 Feature Request

Forking off of #744: I can't find any kind of CSON diff writer equivalent to jsondiffpatch... does such a thing exist?

Existing Behavior

Atom config file writes completely rewrite the target file.

Change Proposal

Take in the benefits of a diff patch: basically #744 but for JSON files.

One of two possible cases is possible:

  • A CSON diff patcher exists and is available on npm, and tslint-to-eslint-config should use it
  • ☝ does not exist, and could be written to resolve this issue (note: please write it as a separate npm package, not a part of this repo -- separation of concerns!).

JoshuaKGoldberg avatar Oct 18 '20 00:10 JoshuaKGoldberg

I have an idea based on cson documentation:

  • Convert the CSON file into JSON.
  • Do whatever change on the converted json file.
  • Use the jsondiffdispatch and then convert the result back to CSON.
  • Profit (?)

KingDarBoja avatar Oct 18 '20 16:10 KingDarBoja