DEV Community

Cover image for What kind of tslint config you use for your React project?
Evaldas Buinauskas
Evaldas Buinauskas

Posted on

6 2

What kind of tslint config you use for your React project?

I've just started looking at TypeScript, React and wanted to prepare a nice working environment for it.

I've began with

create-react-app my-app --scripts-version=react-scripts-ts
Enter fullscreen mode Exit fullscreen mode

Added following dependencies

yarn add -D prettier tslint-config-prettier tslint-plugin-prettier husky pretty-quick
Enter fullscreen mode Exit fullscreen mode

Let Prettier know that I want single quotes, not doubles:

{
  "singleQuote": true
}
Enter fullscreen mode Exit fullscreen mode

Have added the following to my tslint.json:

{
  "extends": [
    "tslint-react",
    "tslint-plugin-prettier",
    "tslint-config-prettier"
  ],
  "rules": {
    ...,
    "prettier": true

  }
}

Enter fullscreen mode Exit fullscreen mode

And then added following line to my package.json:

{
  "scripts": {
    ...,
    "precommit": "pretty-quick staged"
  }
}
Enter fullscreen mode Exit fullscreen mode

It does seem to work nice for myself. Formatting is left for prettier and linting is done by tslint. What kind of setup do you use?

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up