Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-config-buildo

buildo45MIT0.2.2

buildo's ESLint config, following our styleguide

eslint, eslintconfig, config, buildo, javascript, styleguide

readme

eslint-config-buildo

buildo's eslint shared config

Usage

In your project's .eslintrc

{
  "extends": "buildo"
}

If you need to override or turn off rules:

{
  "extends": "buildo",
  "rules": {
    "comma-dangle": 0, // disable trailing commas
    "jsx-quotes": "prefer-double" // change
  }
}

You will need the following npm packages:

npm i --save-dev babel-eslint\
                 eslint\
                 eslint-config-buildo

If you'd rather install them globally, you need to explictly require some plugins as well:

npm i -g babel-eslint\
         eslint\
         eslint-config-buildo\
         eslint-plugin-no-copy-paste-default-export\
         eslint-plugin-no-loops\
         eslint-plugin-react

Proposing a new rule

If you are proposing a new rule, you can use linto to pre-check whether it will cause new errors or warnings in the existing projects.

First, get the latest version of linto:

yarn global add linto
# or if you have time
npm install -g linto

Then you can use the configuration you'll find in this repo as a base.

Example

Suppose you want to propose the addition of guard-for-in. Edit the linto-config.yml by adding the rule under test to the eslintConfig section:

repos:
  // ...
eslintConfig:
  // ...
  rules:
    guard-for-in: 2
}

Then run linto

linto run -c linto-config.yml

This will generate a report that you can copy-paste on a GitHub issue.

NOTE

linto purposely ignores the project-specific configurations, so you may run into errors not directly related to the rule under test. If that's the case, simply turn off the offending rules in the configuration, to get more precise results. For instance, if you get a lot of max-len errors, just do:

repos:
  // ...
eslintConfig:
  // ...
  rules:
    max-len: 0
    guard-for-in: 2

You can also do the same for a single repo. For example, this turns off the semi rule only for the 'buildo/foo' repo:

repos:
  - owner: buildo
    name: foo
    eslintConfig:
      rules:
        semi: 0
  // ...
eslintConfig:
  // ...
  rules:
    guard-for-in: 2

Proposing a new plugin

Similarly to rules, you can test new plugins (and their rules). If you add any entries to the plugins section of the ESLint configuration, they will get installed and made available while linto runs.

Example

Suppose you want to propose the addition of eslint-plugin-import. Proceed like before, using a configuration like:

repos:
  // ...
eslintConfig:
  // ...,
  plugins:
    - import
  rules:
    import/named: 2

changelog

Change Log

v0.2.2 (2017-07-24)

Full Changelog

v0.3.0 (2017-01-16)

Full Changelog

New features:

  • Create test project to test our rules against #92
  • upgrade eslint-plugin-no-loops #85
  • curly #72
  • comma dangle #69
  • consider more plugins to include #6

Breaking:

  • upgrade eslint-plugin-react #82

v0.2.1 (2017-06-09)

Full Changelog

New features:

  • Enfore space before '/>' in self-closing tags #113
  • Disallow Use of undefined Variable (no-undefined) #111
  • pin eslint-plugin-react to <6.10.1 #108
  • Add gdsm to linto config #102
  • Add spaced-comment and no-multi-spaces #101
  • Add array-bracket-spacing #98

v0.2.0 (2016-11-10)

Full Changelog

New features:

  • update eslint peer dep #76
  • max-len should ignore URLs, strings and imports #74
  • List npm modules #70
  • dot-notation #66
  • want: dot-location #65
  • want: no-magic-numbers #64
  • new rules proposal #63
  • plugin idea: eslint-plugin-tcomb #62
  • [Rules] Add max-len rule #60
  • remove no-extra-parens (revert #53) #58
  • Disable global find #56
  • re-enable no-use-before-define #51
  • consider adding no-extra-parens #39
  • why are we repeating some rules from eslint:recommended? #19

Fixes (bugs & defects):

  • default rule config is not supported anymore by eslint 2.0 #52
  • react/jsx-equals-spacing doesn't work #47

v0.1.0 (2016-03-09)

New features:

  • Update eslint to v2 #49
  • Dependency on eslint? #41
  • add wrap-iife: [2, "inside"] #34
  • require space after keywords #31
  • kill the comments #27
  • add object-shorthand #21
  • Implicit return and arrow functions #18
  • some established rules have disappeared! #15
  • Add eqeqeq #12
  • add more rules to default config #7
  • fix dependencies #4
  • remove production rules #3
  • jsx-quotes: 'prefer-single' #2
  • let's define our base sets of eslint rules! #1