Open davidnghk01 opened 4 years ago
Use Case: i want to use that plugin for linting and auto-fix my json config file
Example Input:
{ "command": { "publish": { "conventionalCommits": true, "ignoreChanges": [ "**/__fixtures__/**", "**/__mocks__/**", "**/__tests__/**", "yarn.lock", "CHANGELOG.md" ], "message": "chore(release): publish" } }, "npmClient": "yarn", "packages": ["packages/*"], "version": "independent" }
Result:
6:12 error Parsing error: '{' expected
Root case: My Json file contain '*/' which make that plugin consider end of comment
Work around: Manually escape */
*/
{ "command": { "publish": { "conventionalCommits": true, "ignoreChanges": [ "\/fixtures/", "\/mocks/", "\/tests/*", "yarn.lock", "CHANGELOG.md" ], "message": "chore(release): publish" } }, "npmClient": "yarn", "packages": ["packages/"], "version": "independent" }
Thanks @davidnghk01 , will take a look into this, and get back to you 😄
jsonc plugin
FYI, turn out I find another plugin already done the json sorting feature
So I make use of that for my case ~
Use Case: i want to use that plugin for linting and auto-fix my json config file
Example Input:
Result:
Root case: My Json file contain '*/' which make that plugin consider end of comment
Work around: Manually escape
*/
{ "command": { "publish": { "conventionalCommits": true, "ignoreChanges": [ "\/fixtures/", "\/mocks/", "\/tests/*", "yarn.lock", "CHANGELOG.md" ], "message": "chore(release): publish" } }, "npmClient": "yarn", "packages": ["packages/"], "version": "independent" }