JSHint

A tool that helps to detect errors and potential problems in your JavaScript code.

Version

2.9.5

Runtime

Node.js Versions

Supported Languages

JavaScript HTML

Official Documentation

http://jshint.com/

YAML Configuration

jshint:

  • input:

    Patterns to include in execution and reports.

  • ignore:

    Patterns to exclude from execution and reports.

  • auto-fix:

    N/A

  • config-file:

    Alias of --config option.

  • machine:

    • cpu:

      Amount of CPU. The default machine has 0.25 CPU with 960 MiB RAM.

  • options:

    Below is the list of options that are supported:

    -c, --config STRING    Custom configuration file
        --prereq STRING    Comma-separate list of prerequisite (paths). E.g.
                           files which includedefinitions of global variabls
                           used throughout your project
        --exclude STRING   Exclude files matching the given filename pattern
                           (same as .jshintignore)
        --exclude-path STRINGPass in a custom jshintignore file path
    -e, --extra-ext STRING Comma-separated list of file extensions to use
                           (default is .js)
        --extract [STRING] Extract inline scripts contained in HTML
                           (auto|always|never, default to never)  (Default is never)
  • experimental:

    • incremental:

      true/false

      Note: The incremental analysis is disabled if any kinds of configuration files are changed. The files recognized as configuration files are as follows:

      • Configuration files:
        • Files specified in config-file field
        • Files specified to -c, --config options
        • If none of the above configuration files are found:
          • **/package.json, **/.jshintrc, **/jshintrc
      • Prerequisite files:

        • Files specified to --prereq option
      • Ignore files:

        • Files specified to --exclude-path option
        • If none of the above ignore files are found:
          • .jshintignore at the repository root

YAML Examples

  • With default options:

    inspecode:
      jshint: default
  • With custom machine:

    inspecode:
      jshint:
        machine:
          cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
  • With custom options:

    inspecode:
      jshint:
        options:
          --extra-ext: html
          --extract: auto
  • With a configuration file:

    inspecode:
      jshint:
        config-file: ./my-jshint.json

    The above configuration is equivalent to:

    inspecode:
      jshint:
        options:
          --config: ./my-jshint.json

Configuration File Detection

If no configuration files are specified via config-file or options field, Inspecode first lets JSHint to find configuration files in your repository. See http://jshint.com/docs/ about how JSHint looks for configuration files.

In addition, if JSHint cannot find any configuration files, Inspecode also walks the file tree in lexical order in your repository to find a configuration file named jshintrc and specifies the file first found to JSHint automatically via --config option.

Note: Inspecode ignores specific configuration files while searching. See Configuration > Tool Configuration > Field: config-file for detail.

If the configuration file detected by Inspecode is not the one you want to use or you do not want to use any configuration files, you can disable Inspecode from detecting configuration files by explicitly setting an empty string to config-file field like below:

inspecode:
  jshint:
    config-file: ""

results matching ""

    No results matching ""