id = "jshint" name = "JSHint" homepage = "https://jshint.com" description = "A community-driven tool that detects errors and potential problems in JavaScript code." # The JSHint mark, from the jshint organisation's avatar. icon = "https://github.com/jshint.png" executables = ["jshint"] [dotfiles] # https://jshint.com/docs/cli/ lists where the CLI looks for its configuration, # "stopping at the first positive match": # # 1. The location specified with the --config flag # 2. A file named package.json located in the current directory or any parent # 3. A file named .jshintrc located in the current directory or any parent # 4. A file named .jshintrc located in the current user's "home" directory # (where defined) # # The first three are per project. The fourth is the only user-level file # JSHint reads, and it is a plain ~/.jshintrc — no XDG or %APPDATA% spelling, # so there is no base directory to name here. paths = ["~/.jshintrc"] exclude = [] # A .jshintrc is enforcing/relaxing option flags, the environment options # (browser, node, esversion) and the globals list. Nothing in it is a # credential. secret = [] # jshint is a one-shot command that re-reads the file on every run, so a # rewrite while the user is working cannot land mid-session. side_effect = false # No machine_lines: option flags and the globals list are exactly what a user # wants on their other machine, and the file names no paths of its own. [commands] format = 1 label = "Lint JavaScript" description = "Lint files or directories with JSHint. Inline linting options and custom reporter files are left out." quality = "ai-draft" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "docs" kind = "manual" url = "https://jshint.com/docs/cli/" revision = "2026-10-27" evidence = """ The jshint executable accepts file system paths as command-line arguments. If a file path is a dash (-) then JSHint will read from standard input. --config Explicitly sets the location on the file system from which jshint should load linting options. --reporter This flag also supports two pre-defined reporters: jslint, to make output compatible with JSLint, and checkstyle, to make output compatible with CheckStyle XML. $ jshint --reporter=checkstyle myfile.js --verbose Adds message codes to the JSHint output. --show-non-errors Shows additional data generated by JSHint. --extra-ext Allows you to specify additional file extensions to check (default is .js). --extract=[auto|always|never] --exclude Allows you to specify directories which you DON'T want to be linted. --exclude-path Allows you to provide your own .jshintignore file. """ [[commands.field]] id = "paths" label = "Files or directories" description = "Directories are traversed recursively. Use - for standard input." type = "path" path = { kind = "any", role = "input" } position = 0 multiple = true sources = ["docs"] [[commands.field]] id = "config" label = "Config file" type = "path" path = { kind = "file", role = "input" } option = ["--config"] sources = ["docs"] [[commands.field]] id = "reporter" label = "Reporter" type = "string" option = ["--reporter"] suggestions = [{ value = "jslint", label = "JSLint" }, { value = "checkstyle", label = "CheckStyle XML" }] sources = ["docs"] [[commands.field]] id = "verbose" label = "Show message codes" type = "boolean" option = ["--verbose"] sources = ["docs"] [[commands.field]] id = "show_non_errors" label = "Show additional data" type = "boolean" option = ["--show-non-errors"] sources = ["docs"] [[commands.field]] id = "extract" label = "Extract JavaScript from HTML" type = "enum" option = ["--extract"] choices = [{ value = "auto", label = "Auto" }, { value = "always", label = "Always" }, { value = "never", label = "Never" }] sources = ["docs"] [[commands.field]] id = "extra_ext" label = "Extra file extensions" type = "string" option = ["--extra-ext"] sources = ["docs"] [[commands.field]] id = "exclude" label = "Exclude directories" type = "string" option = ["--exclude"] sources = ["docs"] [[commands.field]] id = "exclude_path" label = "Ignore file" type = "path" path = { kind = "file", role = "input" } option = ["--exclude-path"] sources = ["docs"] [[commands.task]] id = "lint" label = "Lint files" fields = ["paths", "config"] required = ["paths"] [[commands.task]] id = "lint_html" label = "Lint scripts inside HTML" fields = ["paths", "extract"] required = ["paths"] set = { extract = ["always"] } [[commands.group]] id = "basic" label = "Basic" fields = ["paths", "config", "reporter", "verbose"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["show_non_errors", "extract", "extra_ext", "exclude", "exclude_path"]