Skip to content

JoshuaKGoldberg/linting-typescript-in-2023

Repository files navigation

Linting TypeScript in 2023 Code

Demo app for linting React and TypeScript with typescript-eslint, formed from my template-typescript-node-package. ✨

[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-) Code Style: Prettier Contributor Covenant License: MIT Sponsor: On GitHub TypeScript: Strict

Usage

First make sure you have Node installed and Yarn installed. Then, after forking the repo from GitHub:

git clone https://github.com/<your-name-here>/linting-typescript-in-2023
cd linting-typescript-in-2023
yarn

React Site Demo

To start a Next dev server, yarn dev. It displays a page with four buttons, each of which is meant to set the page background to a random color.

  1. "Violate await-thenable": Shows what happens when code violates @typescript-eslint/await-thenable
  2. "Violate no-floating-promises": Shows what happens when code violates @typescript-eslint/no-floating-promises
  3. "Violate no-misused-promises": Shows what happens when code violates @typescript-eslint/no-misused-promises
  4. "This may fail, safely": It works, no issues!

Each of those lint rules are disabled in .eslintrc.cjs. Uncomment those disables and run yarn lint to enable the rules and see their complaints in source code.

Development

See .github/CONTRIBUTING.md. Thanks! 💖

Contributors

Vim
Vim

📖
János Orcsik
János Orcsik

📖

About

Code samples for linting React and TypeScript in 2023. ✨

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project