Most linters out there support overrides for specific file patterns.
For instance, eslint has supported this for a long time.
One use case that I currently have is that I want slightly different ruleset for Solidity test files.
It would be awesome if we could have something like:
{
"extends": "solhint:recommended",
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": "warn"
},
"overrides": [
{
"files": "**/*.t.sol",
"rules": {
"max-state-count": "off",
"state-visibility": "off"
}
}
]
}
With the configs above we can reduce the error/warning clutter and also improve the signal-to-noise ratio in test files, so we can write:
RwaUrn urn;
RwaOutputConduit outC;
RwaInputConduit inC;
instead of:
RwaUrn internal urn;
RwaOutputConduit internal outC;
RwaInputConduit internal inC;
without being bothered with errors.
Right now the workaround is to have 2 separate .solhint*.json files and run the 2 tasks separately. It can be a bit tedious to add the required boilerplate every time though.
Most linters out there support overrides for specific file patterns.
For instance,
eslinthas supported this for a long time.One use case that I currently have is that I want slightly different ruleset for Solidity test files.
It would be awesome if we could have something like:
{ "extends": "solhint:recommended", "plugins": [ "prettier" ], "rules": { "prettier/prettier": "warn" }, "overrides": [ { "files": "**/*.t.sol", "rules": { "max-state-count": "off", "state-visibility": "off" } } ] }With the configs above we can reduce the error/warning clutter and also improve the signal-to-noise ratio in test files, so we can write:
RwaUrn urn; RwaOutputConduit outC; RwaInputConduit inC;instead of:
without being bothered with errors.
Right now the workaround is to have 2 separate
.solhint*.jsonfiles and run the 2 tasks separately. It can be a bit tedious to add the required boilerplate every time though.