Closed mahammedzkhan closed 4 years ago
Hello @mahammedzkhan - it looks like you just enabled that custom test selector for the onChange
handler rule. There's currently no way to turn on that custom selector for all rules unfortunately. If you want to enable that custom attribute for all rules, your ESLint config will look something like this:
{
"rules": {
"test-selectors/anchor": ["warn", "always", { "testAttribute": "data-testid" }],
"test-selectors/button": ["warn", "always", { "testAttribute": "data-testid" }],
"test-selectors/input": ["warn", "always", { "testAttribute": "data-testid" }],
"test-selectors/onChange": ["warn", "always", { "testAttribute": "data-testid" }],
"test-selectors/onClick": ["warn", "always", { "testAttribute": "data-testid" }],
"test-selectors/onKeyDown": ["warn", "always", { "testAttribute": "data-testid" }],
"test-selectors/onKeyUp": ["warn", "always", { "testAttribute": "data-testid" }]
}
}
I've added this plugin to our projects with the following settings:
Is it possible to set the
testAttribute
for all rules? Because I don't think there's a scenario where you use a differenttestAttribute
foronChange
and forbutton
.