Closed manojkiraneda closed 6 months ago
Hi @manojkiraneda
- using eslint-disable constructs.
- using ignore in the flat configs.
eslint-disable
is not available because it only works with JSON files that can be parsed. This is a limitation of ESLint.
Please select option 2.
sure, thanks for your suggestion @ota-meshi.
hi there, I am new to javascript language & eslint as well, just trying to explore how i could leverage
eslint
along witheslint-plugin-jsonc
in my project(c++ project with lot of JSON files with comments) CI infrastructure to lint and catch JSON errors.here is my config file in CI:
when i try to test my repository:
The json file which was marked as error - was intentionally written as a malformed JSON for unit testing purposes, so i figured that we have two ways to ignore the file.
ignore
in the flat configs.I don't prefer option 2 , since my CI runs on multiple repositories and each of them can have malformed JSON's checked in at various places & i don't like developers of the repositories to add their ignore patterns in the config file(global one for all repositories).
So, i am left with option 1 , but when i try using the eslint-diable construct in the JSON file as mentioned in the readme , it does not seem to have any effect on the result, what am i missing here ?