prettier VS JSHint

Compare prettier vs JSHint and see what are their differences.

JSHint

JSHint is a tool that helps to detect errors and potential problems in your JavaScript code (by jshint)
Our great sponsors
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • OPS - Build and Run Open Source Unikernels
  • Scout APM - Less time debugging, more time building
prettier JSHint
160 6
41,691 8,680
1.0% 0.3%
9.8 6.4
2 days ago 7 days ago
JavaScript JavaScript
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

prettier

Posts with mentions or reviews of prettier. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-01-24.
  • How do you typically write your code?
    3 projects | reddit.com/r/webdev | 24 Jan 2022
    Generally, just use a formatter and linter and do whatever those suggest. For web stuff https://prettier.io/ is a good formatter to use and eslint https://eslint.org/ a good linter. Though eslint does try to enforce style as well which conflict with prettier, but they can be configured to work together: https://www.benmvp.com/blog/prettier-eslint/
  • The best Angular 13 Starter Project
    12 projects | dev.to | 22 Jan 2022
    ✅ Angular 13 ✅ Angular Material ✅ Unit Testing with Jest ✅ End-to-End Testing with [TestCafé](https://testcafe.io/ ✅ Internationalization with Transloco ✅ Auto documentation with Compodoc ✅ Analyse your project with webpack-bundle-analyzer ✅ Docker ✅ ESLint ✅ Prettier ✅ Commit Linting ✅ AuditJS Audit this application using Sonatype OSS Index ✅ Auto-generate a CHANGELOG with auto-changelog
  • Set your project up for success
    5 projects | dev.to | 17 Jan 2022
    It would be best if you didn't argue about code formatting. Use a tool like prettier and never speak about the topic again. I don't put any effort whatsoever into formatting my code anymore. When I save, and nothing happens, this is a sign that there is a syntax error somewhere.
  • Angular 13 + NestJs + NX
    9 projects | dev.to | 15 Jan 2022
    ✅ Angular 13 ✅ Ngx-admin ✅ NestJS 8 ✅ Next generation build system with Nx ✅ Unit Testing with Jest ✅ End-to-End Testing with Cypress ✅ ESLint ✅ Prettier
  • Angular 13 Starter with ESLint, Material, Transloco, Jest, TestCafe, Docker & Prettier 🚀
    5 projects | dev.to | 15 Jan 2022
    ✅ Angular 13 ✅ Angular Material ✅ Unit Testing with Jest ✅ End-to-End Testing with TestCafé ✅ Internationalization with Transloco ✅ Auto documentation with Compodoc ✅ Analyse your project with webpack-bundle-analyzer ✅ Docker ✅ ESLint ✅ Prettier ✅ Commit Linting
  • Generate JHipster + Svelte/Kit web applications
    8 projects | dev.to | 14 Jan 2022
    Prettier - Opinionated code formatter
  • Turn Visual Studio Code Into A Top-Notch JavaScript IDE With These 25 Extensions
    8 projects | dev.to | 9 Jan 2022
    Formatting code manually is very time-consuming and error-prone. With Prettier, the de-facto standard code formatter of the JavaScript world, you can format your code automatically. You can even configure the Prettier VS Code extension to format the source code when you save it.
  • What does "senior" mean as a React developer?
    5 projects | reddit.com/r/reactjs | 8 Jan 2022
    This is what I use in my projects: Prettier to format the code. Eslint (for react) and Stylelint (for styles). You can additionally use husky to run the above linters and formaters before committing the code, you can also run some tests automatically before every commit, although depending on the number of tests, this can take some time and can be a bit annoying. In GitHub/GitLab, we also have a set of actions on our pipeline to run all of these linters and tests every time we create a merge request or deploy some new code (CI/CD).
  • 🚀 Angular 13 Starter with ESLint, Material, Transloco, Jest, TestCafe, Docker & Prettier 🚀
    9 projects | reddit.com/r/githubprojects | 7 Jan 2022
    ✅ Prettier
  • 6+ Next JS Template Tailwind CSS for 2022
    6 projects | dev.to | 4 Jan 2022
    🛠 Code Formatter with Prettier

JSHint

Posts with mentions or reviews of JSHint. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-10-22.
  • NPM package ‘ua-parser-JS’ with more than 7M weekly download is compromised
    13 projects | news.ycombinator.com | 22 Oct 2021
    > check out the Web X-Ray repo <https://github.com/mozilla/goggles.mozilla.org/>.

    Thanks for example. Peeking a bit under the hood, it appears to be due to transitive dependencies referencing github urls (and transient ones at that) instead of semver, which admittedly is neither standard nor good practice...

    FWIW, simply removing `"grunt-contrib-jshint": "~0.4.3",` from package.json and related jshint-related code from Gruntfile was sufficient to get `npm install` to complete successfully. The debugging just took me a few minutes grepping package-lock.json for the 404 URL in question (https://github.com/ariya/esprima/tarball/master) and tracing that back to a top-level dependency via recursively grepping for dependent packages. I imagine that upgrading relevant dependencies might also do the trick, seeing as jshint no longer depends on esprima[0].

    I'm not sure how representative this particular case is to the sort of issues you run into, but I'll tell that reproducibility issues can get a lot worse in ways that committing deps doesn't help (for example, issues like this one[1] are nasty to narrow down).

    But assuming that installation in your link just happens to have a simple fix and that others are not as forgiving, how is committing node_modules supposed to help here if you're saying you can't even get it to a working state in the first place? DO you own the repo in order to be able to make the change? Or are you mostly just saying that hindsight is 20-20?

    [0] https://github.com/jshint/jshint/blob/master/package.json#L4...

    [1] https://github.com/node-ffi-napi/node-ffi-napi/issues/143

  • Cyclomatic complexity: Why QAs (and Devs) should worry about it
    1 project | dev.to | 17 Oct 2021
    And another 50 warnings, measured in JSHint. Some words were removed and/or modified to not identify the product and translated to English.
  • Javascript Security Checklist
    5 projects | dev.to | 29 Sep 2021
    JSHint.
  • Script-loading script fails on a particular script
    1 project | reddit.com/r/learnjavascript | 17 Aug 2021
    As expected, that code is never executed (neither memsq nor cachedsq exist), so as you point out, the script is not being loaded. I ran both scripts through JSHint, but only got warnings about using the ES6 flag in the site (which I don't know how to do); no errors. The unloaded script works quite well on Node, and when pasting it directly into the console, as I already mentioned, so this script has no errors that prevents it from running. :/
  • Design an Effective Build Stage for Continuous Integration
    12 projects | dev.to | 8 Apr 2021
    As you can imagine, the language changed a lot over time, and not all its parts are good. Using a linter will help us stay away from the bad parts of JavaScript. In my experience, the ESlint and JSHint linters integrate very well into the CI environment. Any of these can be installed with npm install --save-dev.
  • JavaScript Course — Part 3/
    1 project | dev.to | 11 Feb 2021

What are some alternatives?

When comparing prettier and JSHint you can also consider the following projects:

black - The uncompromising Python code formatter

JS-Beautifier - Beautifier for javascript

Standard - 🌟 JavaScript Style Guide, with linter & automatic code fixer

ESLint - Find and fix problems in your JavaScript code.

prettier-plugin-organize-imports - Make Prettier organize your imports using the TypeScript language service API.

Drawflow - Simple flow library 🖥️🖱️

pretty-quick - ⚡ Get Pretty Quick

clojure-style-guide - A community coding style guide for the Clojure programming language

husky - Git hooks made easy 🐶 woof!

PostCSS - Transforming styles with JS plugins

dprint - Pluggable and configurable code formatting platform written in Rust.