fishbrain/eslint-config-fishbrain


ESLint config for Fishbrain TypeScript projects

License: Apache-2.0

Language: JavaScript


ESLint config for Fishbrain TypeScript React projects

npm version Build Status

Rule set based on Airbnb JavaScript style guide with some extra rules for Jest tests from eslint-plugin-jest.

For non-react TypeScript projects, see eslint-config-fishbrain-base

Usage

npm install -D eslint-config-fishbrain

In .eslintrc (or whatver your ESLint config file is)

{
  "extends": ["eslint-config-fishbrain"]
}

Recommended tsconfig.json settings

In addition to setting target, module, moduleResolution etc, these strictness settings are recommended.

{
  "compilerOptions": {
    "strict": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitReturns": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true
  }
}

Recommended Prettier settings

Add this to package.json to get correct config for prettier

  "prettier": {
    "singleQuote": true,
    "trailingComma": "all"
  }

Browser compatibility settings

If you want to target certain browsers you can also set them in package.json.

  "browserslist": ["chrome 70", "last 1 versions", "not ie <= 8"]

You can also add exceptions for polyfills in .eslintrc. See eslint-plugin-compat for more info.

{
  "settings": {
    "polyfills": [
      // Example of marking entire API and all methods and properties as polyfilled
      "Promise",
      // Example of marking specific method of an API as polyfilled
      "WebAssembly.compile",
      // Example of API with no property (i.e. a function)
      "fetch",
      // Example of instance method, must add `.prototype.`
      "Array.prototype.push"
    ]
  }
}

Editor settings

To enable ESLint in VS Code add the following to your settings.json:

{
  "tslint.enable": false,
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact"
  ]
}

Project Statistics

Sourcerank 4
Repository Size 218 KB
Stars 1
Forks 0
Watchers 18
Open issues 0
Dependencies 226
Contributors 4
Tags 0
Created
Last updated
Last pushed

Top Contributors See all

dependabot-preview[bot] Luke Hansford dependabot-bot Erik Dalén

Packages Referencing this Repo

eslint-config-fishbrain
ESLint config for Fishbrain TypeScript projects
Latest release 0.14.2 - Updated - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2019-08-19 11:24:44 UTC

Login to resync this repository