{"id":15010635,"url":"https://github.com/vbauer/lein-jshint","last_synced_at":"2025-04-09T18:34:06.479Z","repository":{"id":16935420,"uuid":"19697234","full_name":"vbauer/lein-jshint","owner":"vbauer","description":"A Leiningen plugin for running javascript code through JSHint","archived":false,"fork":false,"pushed_at":"2018-11-17T17:10:24.000Z","size":496,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-23T20:37:13.060Z","etag":null,"topics":["clj","clojure","jshint","lein","leiningen"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vbauer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-12T12:08:02.000Z","updated_at":"2018-11-17T17:10:26.000Z","dependencies_parsed_at":"2022-09-11T09:01:51.011Z","dependency_job_id":null,"html_url":"https://github.com/vbauer/lein-jshint","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbauer%2Flein-jshint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbauer%2Flein-jshint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbauer%2Flein-jshint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbauer%2Flein-jshint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vbauer","download_url":"https://codeload.github.com/vbauer/lein-jshint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248088203,"owners_count":21045665,"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":["clj","clojure","jshint","lein","leiningen"],"created_at":"2024-09-24T19:35:10.302Z","updated_at":"2025-04-09T18:34:06.458Z","avatar_url":"https://github.com/vbauer.png","language":"Clojure","readme":"lein-jshint\n===========\n\n[JSHint](https://github.com/jshint/jshint) is a community-driven tool to detect errors and potential problems in JavaScript code. It is very flexible so you can easily adjust it to your particular coding guidelines and the environment you expect your code to execute in.\n\n[lein-jshint](https://github.com/vbauer/lein-jshint) is a Leiningen plugin that allows to do static analysis for JavaScript files using JSHint.\n\n[![Build Status](https://travis-ci.org/vbauer/lein-jshint.svg?branch=master)](https://travis-ci.org/vbauer/lein-jshint)\n[![Clojars Project](https://img.shields.io/clojars/v/lein-jshint.svg)](https://clojars.org/lein-jshint)\n\n\nPre-requirements\n================\n\nInstall [NodeJS](http://nodejs.org/) and [NPM](https://github.com/npm/npm) (package manager for Node) to install JSHint:\n\n- On Ubuntu: `sudo apt-get install nodejs`\n- On Mac OS X: `brew install node`\n\n\nInstallation\n============\n\nInstall [JSHint](https://www.npmjs.org/package/jshint) to use lein-jshint plugin. It could be done in few ways:\n\n- Use NPM to install JSHint globally: `npm install jshint -g`\n- You can also install JSHint in the current directory: `npm install jshint`\n- Use [lein-npm](https://github.com/bodil/lein-npm) plugin: `lein npm install`\n- Use just Leiningen: `lein deps`\n\nSetup\n-----\n\nTo enable lein-jshint for your project, put the following in the :plugins vector of your project.clj file:\n\n```clojure\n; Use latest version instead of \"X.X.X\"\n:plugins [[lein-jshint \"X.X.X\"]]\n```\n\n\nConfiguration\n=============\n\nlien-jshint will create two files in runtime to setup configuration:\n- [.jshintrc](https://github.com/jshint/jshint/blob/2.x/examples/.jshintrc) - main JSHint configuration\n- [.jshintignore](https://github.com/jshint/jshint/blob/2.x/examples/.jshintignore) - list of files for ignoring\n\nYou can specify place, where JS files will be located with:\n```clojure\n:jshint {\n  :includes [\"resources/public/js/*.js\"\n             \"resources/js/*.js\"]\n}\n```\n\nYou can also specify JS files that should be excluded from checking:\n```clojure\n:jshint { :excludes [\"resources/public/lib/*.js\"] }\n```\n\nTo specify *:includes* and *:excludes* options, it is possible to use \u003ca href=\"http://en.wikipedia.org/wiki/Glob_(programming)\"\u003eGlob Patterns\u003c/a\u003e.\n\nJSHint rules could be configured with *:config* parameter:\n```clojure\n; It specifies which JSHint options to turn on or off\n:config {:globals {:angular true\n                   :console true\n                   \"$\" true}\n         :node true\n         :eqeqeq true\n         ...}\n```\n\nYou can use both variants to specify keys: string values or keywords.\n\nAll available parameters are described in the official documentation here: http://www.jshint.com/docs/options/\n\n\nHooks\n-----\n\nTo enable this plugin in compile stage, use the following hook:\n```clojure\n:hooks [lein-jshint.plugin]\n```\n\n\nExamples\n========\n\nDetailed example\n----------------\n\n```clojure\n:jshint {\n  :includes [\"resources/public/js/*.js\"]\n  :excludes [\"resources/public/js/directives.js\"]\n\n  ; This configuration is used by default\n  :config {:bitwise    true    ; Prohibit bitwise operators (\u0026, |, ^, etc.)\n           :curly      true    ; Require {} for every new block or scope\n           :eqeqeq     true    ; Require triple equals i.e. ===\n           :forin      true    ; Tolerate \"for in\" loops without hasOwnPrototype\n           :latedef    true    ; Prohibit variable use before definition\n           :noarg      true    ; Prohibit use of arguments.caller and arguments.callee\n           :nonew      true    ; Prohibit use of constructors for side-effects\n           :plusplus   true    ; Prohibit use of \"++\" \u0026 \"--\"\n           :undef      true    ; Require all non-global vars be declared before usage\n           :strict     true    ; Require \"use strict\" pragma in every file\n           }}\n```\nJust for Code Maniacs: [JSHint Configuration, Strict Edition](https://gist.github.com/haschek/2595796)\n\n\nExample project\n---------------\n\nJust clone the current repository and try to play with [example project](https://github.com/vbauer/lein-jshint/tree/master/example) for better understanding how to use lein-jshint.\n\n\nInvoking JSHint\n===============\n\nIt is also possible to invoke JSHint directly using \"jshint\" task:\n```\nlein jshint \"resources/js/*.js\"\nlein jshint -verbose\nlein jshint --reporter=checkstyle resources/public/js/controllers.js\n```\nSee all CLI commands here: http://www.jshint.com/docs/cli/\n\n\nUnit testing\n============\n\nTo run unit tests:\n\n```bash\nlein test\n```\n\n\nThanks to\n=========\n\nJSHint author [Anton Kovalyov](http://anton.kovalyov.net) and other developers who worked on this [great project](https://github.com/jshint/jshint/graphs/contributors).\n\n\nMight also like\n===============\n\n* [lein-asciidoctor](https://github.com/asciidoctor/asciidoctor-lein-plugin) - A Leiningen plugin for generating documentation using Asciidoctor.\n* [lein-plantuml](https://github.com/vbauer/lein-plantuml) - a Leiningen plugin for generating UML diagrams using PlantUML.\n* [lein-coffeescript](https://github.com/vbauer/lein-coffeescript) - a Leiningen plugin for running CoffeeScript compiler.\n* [lein-typescript](https://github.com/vbauer/lein-typescript) - a Leiningen plugin for running TypeScript compiler.\n* [lein-jslint](https://github.com/vbauer/lein-jslint) - a Leiningen plugin for running javascript code through JSLint.\n* [jabberjay](https://github.com/vbauer/jabberjay) - a simple framework for creating Jabber bots.\n* [coderwall-clj](https://github.com/vbauer/coderwall-clj) - a tiny CoderWall client for Clojure.\n\n\nLicense\n=======\n\nCopyright © 2014 Vladislav Bauer\n\nDistributed under the Eclipse Public License, the same as Clojure.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbauer%2Flein-jshint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvbauer%2Flein-jshint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbauer%2Flein-jshint/lists"}