Skip to content

Filter linted files

If you need to lint only a folder or exclude some files from linting, you can use the optional environment parameters FILTER_REGEX_INCLUDE and FILTER_REGEX_EXCLUDE. You can apply filters to a single linter by defining the variables <LINTER_KEY>_FILTER_REGEX_INCLUDE and <LINTER_KEY>_FILTER_REGEX_EXCLUDE.

Examples:

  • Lint only src folder: FILTER_REGEX_INCLUDE: (src/)
  • Don't lint files inside test and example folders: FILTER_REGEX_EXCLUDE: (test/|examples/)
  • Don't lint javascript files inside test folder: FILTER_REGEX_EXCLUDE: (test/.*\.js)

Warning: Not applicable with linters using CLI lint mode project (see details).