https://github.com/teambit/custom-eslint-config
An example of how to customize eslint config
https://github.com/teambit/custom-eslint-config
Last synced: 4 months ago
JSON representation
An example of how to customize eslint config
- Host: GitHub
- URL: https://github.com/teambit/custom-eslint-config
- Owner: teambit
- Created: 2021-07-14T12:52:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-14T13:05:42.000Z (over 4 years ago)
- Last Synced: 2025-03-04T05:29:40.680Z (10 months ago)
- Language: TypeScript
- Size: 10.7 KB
- Stars: 1
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# custom-eslint-config
An example repo for customizing eslint config in a custom env
## Structure
In this repo we created a new custom-env using `bit create react-env custom-env` and a simple react component using `bit create react-component ui/button`;
The `ui/button` component is configured to use the `custom-env` (see in the workspace.jsonc file).
## custom-env
The custom env is using the new API of `useEslint` (see more details in (this pr)[https://github.com/teambit/bit/pull/4575])
It's mutating the default react env eslint config, and changing the no-console rule to show error for `console.log` instead of warning
## Run this project
```
git clone https://github.com/teambit/custom-eslint-config.git
bit install
bit compile
bit lint
```
The `bit lint` will show an error in the button files, for the console.log in the `button.tsx` file.
Removing the `config.setRule('no-console', ['error']);` in the `custom-env.extension.ts` file (followed by `bit compile`) will show the `console.log` as warning in `bit lint`.