1.1.3 • Published 4 years ago
eslint-config-roy-law v1.1.3
eslint-config-roy-law
ESLint config utilizing TypeScript, Prettier, Jest, React and React Native.
Plugins and configs used:
- Default config (w/ React and React Native):
- Node config:
- eslint-config-prettier
- eslint-plugin-prettier
- eslint-plugin-jest
(applied for tests only, based on Jest's
testMatch
config) - eslint-plugin-import
- eslint-plugin-promise
- @typescript-eslint/eslint-plugin
Additionally, it sets these environments:
Default config:
{
"env": {
"es6": true,
"node": true,
"react-native/react-native": true
}
}
Node config:
{
"env": {
"es6": true,
"node": true
}
}
Installation
npm install --save-dev eslint-config-roy-law
Usage
Add to your ESLint config (.eslintrc
, or eslintConfig
field in
package.json
):
{
"extends": "eslint-config-roy-law"
}
or for Node.js projects:
{
"extends": "eslint-config-roy-law"
}
Example of extending the configuration
{
"extends": "eslint-config-roy-law",
"rules": {
"global-require": 0,
"prefer-destructuring": 0
}
}
TypeScript
In order to use this config in TypeScript project make sure you have installed following dependencies:
Then when running ESLint add --ext '.js,.ts'
(you might need also
.jsx, .tsx
) option, for example:
eslint --ext '.js,.ts' ./src
1.1.3
4 years ago