Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/JoshuaKGoldberg/linting-typescript-in-2023

Code samples for linting React and TypeScript in 2023. ✨
https://github.com/JoshuaKGoldberg/linting-typescript-in-2023

Last synced: 18 days ago
JSON representation

Code samples for linting React and TypeScript in 2023. ✨

Awesome Lists containing this project

README

        

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](https://nodejs.org/en/download) and [Yarn installed](https://yarnpkg.com/getting-started/install).
Then, after [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo):

```shell
git clone https://github.com//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`](https://typescript-eslint.io/rules/await-thenable)
2. _"Violate no-floating-promises"_: Shows what happens when code violates [`@typescript-eslint/no-floating-promises`](https://typescript-eslint.io/rules/no-floating-promises)
3. _"Violate no-misused-promises"_: Shows what happens when code violates [`@typescript-eslint/no-misused-promises`](https://typescript-eslint.io/rules/no-misused-promises)
4. _"This may fail, safely"_: It works, no issues!

Each of those lint rules are disabled in [`.eslintrc.cjs`](./.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`](./.github/CONTRIBUTING.md).
Thanks! 💖

## Contributors



Vim
Vim

📖
János Orcsik
János Orcsik

📖