eslint-suggestion-action
v4.1.9
Published
[](https://github.com/CatChen/eslint-suggestion-action/actions/workflows/build.yml) [. It gets to know your project's location from this value.
targets
The default value is "."
. For example, it could be "src"
or "src/**/*.ts"
for a typical TypeScript project with source code files in the src
directory. Use glob pattern to match multiple directories if necessary, for example "{src,lib}"
instead of "src lib"
or "{src, lib}"
to match both the src
directory and the lib
directory.
eslint-lib-path
The default value is "./node_modules/eslint/lib/api.js"
. This action uses the ESLint installed in your project. This makes sure that it's using your project's ESLint version. It gets to know your project's ESLint library location from this value.
eslint-bin-path
(deprecated)
The default value is "node_modules/.bin/eslint"
. This action uses the ESLint installed in your project. This makes sure that it's using your project's ESLint version. It gets to know your project's ESLint binary location from this value.
config-path
The default value is an empty string. This action uses ESLint's default config file when this value is empty. That means .eslintrc.json
or .eslintrc.js
for ESLint up to 8.56.0, and eslint.config.json
for ESLint 8.57.0 or 9+. If you name your config file differently you can set it here.
FAQ
What is the difference between a fix and a suggestion in ESLint?
ESLint documentation defines a fix as a change that wouldn't change the runtime behavior of code and cause it to stop working. In constrast, when fixes aren't appropriate to be automatically applied, for example, if a fix potentially changes functionality or if there are multiple valid ways to fix a rule depending on the implementation intent a rule will provide one or multiple suggestions. We have to review and decide if any one of them is appropriate.
Can I have GitHub suggestions outside of the scope?
No. To be precise, it's mostly no. GitHub only allows comments within diff hunks. That means the lines that are changed and up to three adjacent lines before and after. There's no way to comment outside of diff hunks, in GitHub's interface or through API. For better consistency, this action doesn't create GitHub suggestions outside of the scope, even if it's within diff hunk.
How can I avoid having annotation in generated code inside a project?
Please follow GitHub's documentation and use .gitattributes
to mark those files and directories correctly. GitHub will hide those files in Pull Request.