eslint-config-broilerplate

3.1.0 • Public • Published

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 ."
   },

Package Sidebar

Install

npm i eslint-config-broilerplate

Weekly Downloads

11

Version

3.1.0

License

ISC

Unpacked Size

7.31 kB

Total Files

7

Last publish

Collaborators

  • kiiski