Skip to main content

ESLint

Set up workflow to run ESLint check on your code for every Pull Request.

Learn more about ESLint: eslint.org

Usage​

npx setup-ci --preset --lint

Detailed behavior​

Below you can find detailed information about what the script does with your project when generating ESLint workflow.

Installed dependencies​

  • eslint (dev)
  • typescript (dev)
  • @react-native/eslint-config (dev)
  • eslint-plugin-prettier (dev) (if Prettier is selected or already installed)
  • eslint-config-prettier (dev) (if Prettier is selected or already installed)

Modified and created files​

FileChanges
.github/workflows/lint.ymlContains the CI workflow
package.json
  • Missing dependencies are added
  • New script: lint: eslint "**/*.{js,jsx,ts,tsx}"
.eslintrc.jsonCreated if no existing ESLint configuration was detected (contains configuration compatible with Prettier if it is already installed or Prettier workflow was selected)

Workflow details​

The following diagram represents the flow of the ESLint CI workflow:

Known issues and limitations​

  • Sometimes dependencies cannot be installed automatically due to peer dependencies conflicts with already installed packages. In such cases, you will need to resolve the conflicts manually.
  • The .eslintrc.json configuration file generated by SCI might not be well tailored to your project. You will have to adjust it manually if needed.