Installing, enabling, and configuring ESLint in AppCode
Optionally, install additional plugins, for example, eslint-plugin-react to lint React applications.
- Choose the configuration to use.
With Automatic search, AppCode looks for a
.eslintrcfile or tries to detect a configuration defined under
package.json. AppCode first looks for a
package.jsonin the folder with the file to be linted, then in its parent folder, and so on up to the project root. If the search fails, ESLint uses its default embedded configuration file.
Choose Configuration File to use a custom file and specify the file location in the Path field.
In the Extra ESLint Options field, specify additional command line options to run ESLint with, use spaces as separators.
In the Additional Rules Directory field, specify the location of the files with additional code verification rules. These rules will be applied after the rules from
.eslintrcor the above specified custom configuration file and accordingly will override them.
Importing code style from ESLint
To import ESLint code style rules
.eslintrc JSON file or a
package.json with the
eslintConfig field. AppCode shows the question Apply code style from ESLint? at the top of the editor. Click Yes to apply the matched rules to the Project code style scheme.
Please note that only the rules that have matching code style settings in AppCode are applied, for example,
no-trailing-spaces. Complex object options for these rules are not always applied. Also note that AppCode does not apply rules from the configuration files listed in the
extends field or rules from plugins.
Open the built-in AppCode Terminal (N/A) and type
To enable linting with Standard via ESLint