Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/leocode/eslint-config

ESLint configs used in Leocode's projects.
https://github.com/leocode/eslint-config

Last synced: 10 days ago
JSON representation

ESLint configs used in Leocode's projects.

Awesome Lists containing this project

README

        

# LEOCODE's ESLint config

## Installation

1. Install all peer dependencies. You can use your favourite tool or just type:

```
For React:

yarn add --dev eslint@8 @typescript-eslint/eslint-plugin@5 @typescript-eslint/parser@5 [email protected] [email protected] typescript@4

For Node:

yarn add --dev eslint@8 @typescript-eslint/eslint-plugin@5 @typescript-eslint/parser@5 typescript@4
```

2. Install package with configuration:

```
yarn add --dev @leocode/eslint-config
```

## Usage

For node put this in `.eslintrc.js` file:

```js
module.exports = {
extends: ['@leocode/eslint-config/node'],
};
```

For React put this in `.eslintrc.js` file:

```js
module.exports = {
extends: ['@leocode/eslint-config/react'],
};
```

## Known issues

If ESLint doesn't work by default in your editor (it cannot find `tsconfig.json` file), you may need to specify in `.eslintrc.js`:

```js
module.exports = {
extends: ['@leocode/eslint-config/node'],
parserOptions: {
tsconfigRootDir: __dirname, // or any other directory relative to `.eslintrc.js` file
},
};
```

## License

MIT