How do you handle eslint/prettier configs across multiple repos?

This page summarizes the projects mentioned and recommended in the original post on /r/typescript

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • eslint-config

    Extensible eslint configurations for the punctilious developer. (by exbotanical)

  • I use a [monorepo for my ESLint configs via NPM - each package is a single config (for Vue, React, TypeScript) that extends a set of base settings that I use throughout all of my JS/TS code. I use

  • prettier-config

    Extensible prettier configurations for the punctilious developer. (by exbotanical)

  • For Prettier, I likewise pull in a shared config that I publish on NPM. Both ESLint and Prettier have first-class support for packaged, shared configs i.e. this is the recommended way to consume such configs across many projects.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • husky

    Git hooks made easy 🐶 woof!

  • To answer your next question: I lint and format on save, and I use Git hooks installed by Husky and executed through Lint-Staged (this tool helps ensure your Git hooks only run on modified files, etc) to ensure there are no lint or formatting errors whenever making a commit or pushing code. This is helpful for teams, as some developers tend to forget to run lint tasks, or don't have the Prettier extension installed in their IDE. If there are lint errors, the commit is rejected until fixed. YMMV - you'll need to fine-tune the strictness of this based on the team's needs.

  • lint-staged

    🚫💩 — Run linters on git staged files

  • To answer your next question: I lint and format on save, and I use Git hooks installed by Husky and executed through Lint-Staged (this tool helps ensure your Git hooks only run on modified files, etc) to ensure there are no lint or formatting errors whenever making a commit or pushing code. This is helpful for teams, as some developers tend to forget to run lint tasks, or don't have the Prettier extension installed in their IDE. If there are lint errors, the commit is rejected until fixed. YMMV - you'll need to fine-tune the strictness of this based on the team's needs.

  • rushstack

    Monorepo for tools developed by the Rush Stack community

  • If you're looking to recreate the ease of a monorepo with eslint/prettier, I've used the rushstack eslint patch to ship an eslint package which is almost fully self-contained, not just config, but dependencies as well: https://github.com/microsoft/rushstack/tree/main/eslint/eslint-patch

  • eslint-config

    My personal eslint-config (by switz)

  • prettier

    Prettier is an opinionated code formatter.

  • I believe the prettier maintainers have postponed changing from spaces to tabs. At least it's not in the v3 release plan.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • frame

  • I love this and it's almost exactly what I do. I have a repository called Frame (as in the frame of a car) which has my configurations and developer dependencies. I can then reference @kristiandupont/dev-deps once. The primary upside to this is that I don't have to play Dependabot whack-a-mole for every repository every time there is an update to any of the dependencies I always use, I can combine them into some batches that I then do now and then.

  • sheriff

    A comprehensive and opinionated Typescript-first ESLint configuration. (by AndreaPontrandolfo)

  • I think this is exatly what you are looking for https://github.com/AndreaPontrandolfo/sheriff

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts