3.1.0 • Published 2 years ago

eslint-config-broilerplate v3.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
2 years ago

Broilerplate ESLint configuration

An opinionated ESLint configuration for projects using TypeScript and optionally React + React hooks. This is a mashup of Airbnb JavaScript code style conventions + TypeScript enhancement on Airbnb ESlint config + Prettier + some opionated ESLint rule adjustements.

Usage

Install to your project:

npm i --save-dev eslint-config-broilerplate

Note that ESLint itself is a peer dependency and needs to be installed separately:

npm i --save-dev eslint

Configure your .eslintrc in your project:

{
  "root": true,
  "extends": "broilerplate"
}

If you are using React, then add this configuration instead:

{
  "root": true,
  "extends": "broilerplate/react"
}

Also add the following line to your package.json to use the recommended Prettier configuration, included in this package:

 {
   "name": "my-app",
+  "prettier": "eslint-config-broilerplate/prettier.config",
   "dependencies": {}
 }

Run the linter:

npx eslint . --ext .ts,.tsx

You might want to add these scripts to your project's package.json:

   "scripts": {
+    "lint": "eslint . --ext .ts,.tsx && prettier --check .",
+    "lint:fix": "eslint . --ext .ts,.tsx --fix && prettier --write ."
   },