Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vizeat/eslint-config-vizeat
Shareable ESLint config desgined by the VizEat Team
https://github.com/vizeat/eslint-config-vizeat
eslint eslint-config eslint-shareable-configs
Last synced: about 2 months ago
JSON representation
Shareable ESLint config desgined by the VizEat Team
- Host: GitHub
- URL: https://github.com/vizeat/eslint-config-vizeat
- Owner: vizeat
- License: mit
- Created: 2017-08-16T12:45:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-11-14T10:03:16.000Z (about 2 years ago)
- Last Synced: 2024-11-20T14:49:20.050Z (2 months ago)
- Topics: eslint, eslint-config, eslint-shareable-configs
- Language: JavaScript
- Size: 520 KB
- Stars: 3
- Watchers: 8
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Shareable Eslint Config by the VizEat Team
[Shared ESLint config](http://eslint.org/docs/developer-guide/shareable-configs) for JavaScript code produced by VizEat's Team.
Most of the rules are fixable and this config also make use of `eslint-plug-prettier` to configure & pilote `prettier` through eslint.
For everything to work well, **we recommend that you don't use a prettier plugin in your editor** alongside this configuration. Using `eslint --fix` will do it all, combined with *format on save* and *format on paste* you will get the most reliable formatting.
### `vizeat` config
it contains generic rules for all JS projects (back & front)
### `vizeat/react` config
it extends `vizeat` config and add JSX / React specific rules
### `vizeat/typescript` config
it extends `vizeat` config and add Typescript specific rules as well as overrides for incompatible rules
## Usage
The configuration requires a number of peer dependencies to be installed. This is due to how eslint plugin system works and how those dependencies are found in your file system.
#### Installing all (peer) dependencies for a project using any combination of configs
This is the easiest way of getting it working, but you may not need everything.
```sh
yarn add --dev @typescript-eslint/eslint-plugin @typescript-eslint/parser babel-eslint eslint eslint-plugin-import eslint-plugin-node eslint-plugin-prettier eslint-plugin-promise eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-standard prettier
```#### Installing (peer) dependencies for a project using the `vizeat` config
If you primarily use Node.js & vanilla JS, then this is likely enough
```sh
yarn add --dev eslint eslint-plugin-import eslint-plugin-node eslint-plugin-prettier eslint-plugin-promise eslint-plugin-standard prettier
```#### Installing (peer) dependencies for a project using the `vizeat/react` config
For your React app
```sh
yarn add --dev babel-eslint eslint eslint-plugin-import eslint-plugin-node eslint-plugin-prettier eslint-plugin-promise eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-standard prettier
```#### Installing (peer) dependencies for a project using the `vizeat/typescript` config
For your TS project
```sh
yarn add --dev eslint eslint-plugin-import eslint-plugin-node eslint-plugin-prettier eslint-plugin-promise eslint-plugin-standard prettier @typescript-eslint/eslint-plugin @typescript-eslint/parser
```### Configuration
Then, extend `vizeat` or `vizeat/react` or `vizeat/typescript` in your `.eslintrc` depending on the kind of projects you're working on.
`vizeat/react` and `vizeat/typescript` extend `vizeat` config so for mixed projects (React + SSR) `vizeat/react` is enough.```json
{ "extends": ["vizeat"] }
```or
```json
{ "extends": ["vizeat/react"] }
```or
```json
{
"extends": ["vizeat/typescript"],
"parserOptions": {
"project": "./tsconfig.json"
}
}
```
(see [typescript-eslint/parserOptions.project](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/README.md#parseroptionsproject))Happy hacking !