@chainsafe/eslint-config
Version:
60 lines (43 loc) • 1.48 kB
Markdown
# @chainsafe/eslint-config
[](https://github.com/ChainSafe/eslint-config/actions/workflows/ci.yaml)
[](https://badge.fury.io/js/@chainsafe%2Feslint-config)
This package provides ChainSafe's .eslintrc as an extensible shared config.
## Usage
The provided configuration contains shared ESLint rules for typescript projects across ChainSafe. To use this configuration you'll need `.eslintrc.js` file in your project root with the following content:
```js
module.exports = {
extends: "@chainsafe",
}
```
### Monorepo
To make eslint work in monorepo's, make sure tsconfig files are relative to the eslint file.
Base eslint file in the root directory should have `root: true` option set.
For example in the package, you would have something like:
```js
const path = require("path")
module.exports = {
extends: "../../.eslintrc.js",
parserOptions: {
project: path.join(__dirname, "tsconfig.json"),
tsconfigRootDir: path.join(__dirname)
},
}
```
### With Mocha and Chai
```js
module.exports = {
extends: "@chainsafe/eslint-config/ts-mocha-chai",
}
```
### Frontend Vanilla
```js
module.exports = {
extends: "@chainsafe/eslint-config/frontend-vanilla"
}
```
### Frontend React
```js
module.exports = {
extends: "@chainsafe/eslint-config/frontend-react"
}
```