Reputation: 301
We have a reducer that has 350 or so lines. Our function limit is 75 (eslint) so we get the too many lines error. We also get too many return statements, but this is a reducer and that is not a problem. How do we ignore these CodeClimate errors in this one file?
Here are the errors:
Upvotes: 1
Views: 1219
Reputation: 96484
You can't ignore the specific checks for specific files.
However (and for others looking for a solution) you can exclude individual files or directories via a .codeclimate.yml file. See https://docs.codeclimate.com/docs/excluding-files-and-folders
The drawback is that it means all rules will be excluded.
If you do this, make sure you have good lint rules that do apply to those files and that can help.
Some files such as reducers and other configuration and mapping files aren't appropriate for the linting that you do want for the rest of the code.
e.g.
.codeclimate.yml
## other configuration excluded from example...
exclude_patterns:
- "imageViewer/reducer.js"
Upvotes: 0
Reputation: 301
I contacted CodeClimate and they said, "We don't yet support the option to ignore specific issues for individual files.". They said to mark the error as invalid and CodeClimate won't bring it up again.
Upvotes: 1