AriPerkkio/eslint-remote-tester

doesn't work as expected

Closed this issue · 5 comments

testing on this repo https://github.com/staeco/iris-ql

rules works by installing them directly on project

image

but i don't have any errors with eslint-remote-tester

image

repo: https://github.com/andriyor/eslint-remote-tester-example/blob/main/eslint-remote-tester.config.js

Does adding rulesUnderTesting: (ruleId: string) => true help?

| `rulesUnderTesting` | Array of rules or a filter method used to filter out results. Use `undefined` or empty array when ESLint crashes are the only interest. Filter method is called with `ruleId` and `options`. | `string[] \| (ruleId, { repository }) => boolean` | :x: | `[]` | `['no-empty', 'react/sort-prop-types']` `(ruleId, options) => ruleId === 'no-undef' && options.repository === 'owner/repo'` |

By default only ESLint rule crashes are reported. Using rulesUnderTesting you can filter which rule errors should be reported as well.

thanks, it helped
now i see how many errors have each repo, but how can i see error logs to understand which rule failed and file path?

There should be ./eslint-remote-tester-results written after run.

### Execution
Run `npm run lint:remote`. Results are written into `./eslint-remote-tester-results` folder.

Ohh, thank you, sorry for bothering
Do you have some kind of API to use this tool programmatically?

There's onComplete that can be used to get access to the results after run is finished. Does this work for you?

| `onComplete` | Callback invoked once scan is completed. Asynchronous functions are supported. Ideal for extending the process with custom features. | `(results, comparisonResults, repositoryCount) => void`\|`Promise<void>`. See [onComplete example]. | :x: | :x: | `async (results, comparisonResults, repositoryCount) => {}` |

Example arguments that are passed there:

"results": [
{
"repository": "jira_clone",
"repositoryOwner": "oldboyxx",
"rule": "no-empty-function",
"message": "Unexpected empty arrow function 'onClick'.",
"path": "oldboyxx/jira_clone/client/src/shared/components/Button/index.jsx",
"link": "https://github.com/oldboyxx/jira_clone/blob/HEAD/client/src/shared/components/Button/index.jsx#L28-L28",
"extension": "jsx",
"source": " 26 | disabled: false,\n 27 | isWorking: false,\n> 28 | onClick: () => {},\n | ^^\n 29 | };\n 30 | \n 31 | const Button = forwardRef("
},
{
"repository": "jira_clone",
"repositoryOwner": "oldboyxx",
"rule": "no-empty-function",
"message": "Unexpected empty arrow function 'onChange'.",
"path": "oldboyxx/jira_clone/client/src/shared/components/Input/index.jsx",
"link": "https://github.com/oldboyxx/jira_clone/blob/HEAD/client/src/shared/components/Input/index.jsx#L21-L21",
"extension": "jsx",
"source": " 19 | invalid: false,\n 20 | filter: undefined,\n> 21 | onChange: () => {},\n | ^^\n 22 | };\n 23 | \n 24 | const Input = forwardRef(({ icon, className, filter, onChange, ...inputProps }, ref) => {"
}
],