Skip to content

venturehacks/eslint-config-angellist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-config-angellist

This package provides AngelList's .eslintrc.js as an extensible shared config.

Usage

Our default export contains all of our ESLint rules, including ECMAScript 6+, React, presets inherited, etc. Thus, there are a ton of peer dependencies to satisfy.

1. Install config as dependency

yarn add --dev 'git+https://github.com/venturehacks/eslint-config-angellist#1.1.2'

2. Install all peer dependencies

If this were a public repository on the npm registry, we could abstract peer dependency installation to one command. Unfortunately, it's private. The dependency list is crudely maintained in this README:

3. Modify your ESLint config

Add "extends": "angellist" to your .eslintrc.js


Example Config

module.exports = {
  extends: ['angellist'],

  // TypeScript: you must specify where your tsconfig(s) are located
  parserOptions: {
    project: ['./tsconfig.json', './tsconfig.server.json'],
  },

  // rule overrides
  rules: {
    // warning: has dangerous autofix;
    // ok to set to 'warn' w/o husky autofix hook
    'react-hooks/exhaustive-deps': 'off',
  },

  // declare which API's are polyfilled (and thus ignored)
  settings: {
    polyfills: [
      'Promise',
      'Object.values',
      'window.scrollTo',
      'window.scrollY',
      'URLSearchParams',
    ],
  },
};

Useful package scripts

Place these in package.json

{
  "scripts": {
    "eslint": "eslint '**/*.ts*'",
    "eslint:fix": "eslint '**/*.ts*' --fix",
  }
}