{"id":13623833,"url":"https://github.com/gruntjs/grunt-contrib-jshint","last_synced_at":"2025-05-14T08:07:27.153Z","repository":{"id":4902694,"uuid":"6058744","full_name":"gruntjs/grunt-contrib-jshint","owner":"gruntjs","description":"Validate files with JSHint.","archived":false,"fork":false,"pushed_at":"2024-07-02T05:09:17.000Z","size":772,"stargazers_count":708,"open_issues_count":22,"forks_count":192,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-04-27T20:03:23.914Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"http://gruntjs.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"xetorthio/jedis","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gruntjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-10-03T11:00:14.000Z","updated_at":"2025-04-09T13:41:52.000Z","dependencies_parsed_at":"2024-06-18T11:09:34.898Z","dependency_job_id":"266ccb21-0e78-4326-8e96-f150791e2ff8","html_url":"https://github.com/gruntjs/grunt-contrib-jshint","commit_stats":{"total_commits":200,"total_committers":48,"mean_commits":4.166666666666667,"dds":0.745,"last_synced_commit":"335381c5f892f87703981dfd8ff22b16207a0f20"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-contrib-jshint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-contrib-jshint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-contrib-jshint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-contrib-jshint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gruntjs","download_url":"https://codeload.github.com/gruntjs/grunt-contrib-jshint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252320961,"owners_count":21729237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2024-08-01T21:01:36.169Z","updated_at":"2025-05-14T08:07:22.124Z","avatar_url":"https://github.com/gruntjs.png","language":"JavaScript","funding_links":[],"categories":["hacktoberfest"],"sub_categories":[],"readme":"# grunt-contrib-jshint v3.2.0 [![Build Status](https://github.com/gruntjs/grunt-contrib-jshint/workflows/Tests/badge.svg)](https://github.com/gruntjs/grunt-contrib-jshint/actions?workflow=Tests)\n\n\u003e Validate files with JSHint\n\n\n\n## Getting Started\n\nIf you haven't used [Grunt](https://gruntjs.com/) before, be sure to check out the [Getting Started](https://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](https://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-contrib-jshint --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-contrib-jshint');\n```\n\n\n\n\n## Jshint task\n_Run this task with the `grunt jshint` command._\n\nTask targets, files and options may be specified according to the grunt [Configuring tasks](https://gruntjs.com/configuring-tasks) guide.\n\n### Options\n\nAny specified option will be passed through directly to [JSHint][], thus you can specify any option that JSHint supports. See the [JSHint documentation][] for a list of supported options.\n\n[JSHint]: http://jshint.com/\n[JSHint documentation]: http://jshint.com/docs/\n\nA few additional options are supported:\n\n\n#### globals\n\nType: `Object`  \nDefault: `null`\n\nA map of global variables, with keys as names and a boolean value to determine if they are assignable. This is not a standard JSHint option, but is passed into the `JSHINT` function as its third argument. See the [JSHint documentation][] for more information.\n\n\n#### jshintrc\n\nType: `String` or `true`  \nDefault: `null`\n\nIf set to `true`, no config will be sent to JSHint and JSHint will search for `.jshintrc` files relative to the files being linted.\n\nIf a filename is specified, options and globals defined therein will be used. The `jshintrc` file must be valid JSON and looks something like this:\n\n```json\n{\n  \"curly\": true,\n  \"eqnull\": true,\n  \"eqeqeq\": true,\n  \"undef\": true,\n  \"globals\": {\n    \"jQuery\": true\n  }\n}\n```\n\n*Be aware that `jshintrc` settings are not merged with your Grunt options.*\n\n\n#### extensions\n\nType: `String`  \nDefault: `''`\n\nA list of non-dot-js extensions to check.\n\n\n#### ignores\n\nType: `Array`  \nDefault: `null`\n\nA list of files and dirs to ignore. This will override your `.jshintignore` file if set and does not merge.\n\n\n#### force\n\nType: `Boolean`  \nDefault: `false`\n\nSet `force` to `true` to report JSHint errors but not fail the task.\n\n\n#### reporter\n\nType: `String`  \nDefault: `null`\n\nAllows you to modify this plugins output. By default it will use a built-in Grunt reporter. Set the path to your own custom reporter or to one of the built-in JSHint reporters: `jslint` or `checkstyle`.\n\nSee also: [Writing your own JSHint reporter.](http://jshint.com/docs/reporters/)\n\nYou can also use an external reporter. For example [jshint-stylish](https://github.com/sindresorhus/jshint-stylish):\n\n```\n$ npm install --save-dev jshint-stylish\n```\n\n```js\noptions: {\n    reporter: require('jshint-stylish')\n}\n```\n\n#### reporterOutput\n\nType: `String`  \nDefault: `null`\n\nSpecify a filepath  to output the results of a reporter. If `reporterOutput` is specified then all output will be written to the given filepath instead of printed to stdout.\n\n###### reporterOutputRelative\n\nType: `Boolean`  \nDefault: `true`\n\nResults of a reporter will use a relative filepath to `reporterOutput`.  If set to `false` then filepaths will appear relative to the current folder.  Unless `reporterOutput` is not set this option will not have any effect.\n\n### Usage examples\n\n#### Wildcards\nIn this example, running `grunt jshint:all` (or `grunt jshint` because `jshint` is a [multi task](https://gruntjs.com/configuring-tasks#task-configuration-and-targets)) will lint the project's Gruntfile as well as all JavaScript files in the `lib` and `test` directories and their subdirectories, using the default JSHint options.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n  jshint: {\n    all: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js']\n  }\n});\n```\n\n#### Linting before and after concatenating\nIn this example, running `grunt jshint` will lint both the \"beforeconcat\" set and \"afterconcat\" sets of files. This is not ideal, because `dist/output.js` may get linted before it gets created via the [grunt-contrib-concat plugin](https://github.com/gruntjs/grunt-contrib-concat) `concat` task.\n\nIn this case, you should lint the \"beforeconcat\" files first, then concat, then lint the \"afterconcat\" files, by running `grunt jshint:beforeconcat concat jshint:afterconcat`.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n  concat: {\n    dist: {\n      src: ['src/foo.js', 'src/bar.js'],\n      dest: 'dist/output.js'\n    }\n  },\n  jshint: {\n    beforeconcat: ['src/foo.js', 'src/bar.js'],\n    afterconcat: ['dist/output.js']\n  }\n});\n```\n\n#### Specifying JSHint options and globals\n\nIn this example, custom JSHint options are specified. Note that when `grunt jshint:uses_defaults` is run, those files are linted using the default options, but when `grunt jshint:with_overrides` is run, those files are linted using _merged_ task/target options.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n  jshint: {\n    options: {\n      curly: true,\n      eqeqeq: true,\n      eqnull: true,\n      browser: true,\n      globals: {\n        jQuery: true\n      },\n    },\n    uses_defaults: ['dir1/**/*.js', 'dir2/**/*.js'],\n    with_overrides: {\n      options: {\n        curly: false,\n        undef: true,\n      },\n      files: {\n        src: ['dir3/**/*.js', 'dir4/**/*.js']\n      },\n    }\n  },\n});\n```\n\n#### Ignoring specific warnings\n\nIf you would like to ignore a specific warning:\n\n```shell\n[L24:C9] W015: Expected '}' to have an indentation at 11 instead at 9.\n```\n\nYou can toggle it by prepending `-` to the warning id as an option:\n\n```js\ngrunt.initConfig({\n  jshint: {\n    ignore_warning: {\n      options: {\n        '-W015': true,\n      },\n      src: ['**/*.js'],\n    },\n  },\n});\n```\n\n\n## Release History\n\n * 2022-02-17   v3.2.0   Bump dependencies, including jshint.\n * 2020-10-20   v3.0.0   Bump dependencies. Switch to GitHub actions. Ensures errors in stdoutEqual callback are logged. Requires Node 10+.\n * 2019-03-18   v2.1.0   Bump dependencies. Update to latest JSHint\n * 2018-09-22   v2.0.0   Bump devDependencies. Drop Node.js \u003c 6 support.\n * 2016-11-23   v1.1.0   Fix relative output Bump minor version\n * 2016-02-16   v1.0.0   Replace String prototype colors with chalk. Update Grunt peerDep to `\u003e=0.4.0`.\n * 2016-01-17   v0.12.0   Update to JSHint ~2.9.0.\n * 2015-09-03   v0.11.3   Update to JSHint ~2.8.0.\n * 2015-04-16   v0.11.2   Fix default value of the `reporter` option.\n * 2015-03-20   v0.11.1   Fix io.js compatibility issues. Other fixes to pathing.\n * 2015-01-22   v0.11.0   Update to JSHint ~2.6.0.\n * 2014-04-02   v0.10.0   Update to JSHint 2.5.0.\n * 2014-03-12   v0.9.2   Fixes a bug where `reporterOutput` was still passed to JSHint.\n * 2014-03-12   v0.9.1   Don't pass `reporterOutput` option to JSHint.\n * 2014-03-12   v0.9.0   Replace deprecated `grunt.util._.clone` with `Object.create()`. Replace deprecated `grunt.util.hooker` with hooker lib. Enhancing the readability of the output. Reporter output is relative to the output file. Pass JSHint options to the external reporter.\n * 2013-12-25   v0.8.0   Update to JSHint 2.4.0.\n * 2013-11-16   v0.7.2   Only print file name once per error.\n * 2013-10-31   v0.7.1   Ability to set jshintrc option to true to use JSHint's native ability for finding .jshintrc files relative to the linted files.\n * 2013-10-23   v0.7.0   Update to JSHint 2.3.0.\n * 2013-10-23   v0.6.5   Fix output when `maxerr` is low.\n * 2013-08-29   v0.6.4   jshintrc now loaded by JSHint allowing comments.\n * 2013-08-15   v0.6.3   Fix module location for JSHint 2.1.10.\n * 2013-07-29   v0.6.2   Update to JSHint 2.1.7.\n * 2013-07-27   v0.6.1   Peg JSHint to 2.1.4 until breaking changes in 2.1.5 are fixed.\n * 2013-06-02   v0.6.0   Don't always succeed the task when using a custom reporter. Bump JSHint to 2.1.3.\n * 2013-05-22   v0.5.4   Fix default reporter to show offending file.\n * 2013-05-19   v0.5.3   Performance: Execute the reporter once rather than per file.\n * 2013-05-18   v0.5.2   Fix printing too many erroneous ignored file errors.\n * 2013-05-17   v0.5.1   Fix for when only 1 file is lint free.\n * 2013-05-17   v0.5.0   Bump to JSHint 2.0. Add support for .jshintignore files and ignores option. Add support for `extensions` option. Add support for custom reporters and output report to a file.\n * 2013-04-08   v0.4.3   Fix evaluation of `predef` option when it's an object.\n * 2013-04-08   v0.4.2   Avoid wiping `force` option when jshintrc is used.\n * 2013-04-06   v0.4.1   Fix to allow object type for deprecated predef.\n * 2013-04-04   v0.4.0   Revert task level options to override jshintrc files.\n * 2013-03-13   v0.3.0   Bump to JSHint 1.1.0. Add force option to report JSHint errors but not fail the task. Add error/warning code to message. Allow task level options to override jshintrc file.\n * 2013-02-26   v0.2.0   Bump to JSHint 1.0.\n * 2013-02-15   v0.1.1   First official release for Grunt 0.4.0.\n * 2013-01-18   v0.1.1rc6   Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.\n * 2013-01-09   v0.1.1rc5   Updating to work with grunt v0.4.0rc5. Switching to `this.filesSrc` API.\n * 2012-10-18   v0.1.0   Work in progress, not yet officially released.\n\n---\n\nTask submitted by [\"Cowboy\" Ben Alman](http://benalman.com/)\n\n*This file was generated on Thu Feb 17 2022 21:24:56.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruntjs%2Fgrunt-contrib-jshint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgruntjs%2Fgrunt-contrib-jshint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruntjs%2Fgrunt-contrib-jshint/lists"}