Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

processor fail when json file contain '**' #35

Open
davidnghk01 opened this issue Aug 14, 2020 · 2 comments
Open

processor fail when json file contain '**' #35

davidnghk01 opened this issue Aug 14, 2020 · 2 comments

Comments

@davidnghk01
Copy link

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"
}

@mayank23
Copy link
Contributor

Thanks @davidnghk01 , will take a look into this, and get back to you 😄

@davidnghk01
Copy link
Author

jsonc plugin

FYI, turn out I find another plugin already done the json sorting feature

So I make use of that for my case ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants