@urbandoor/eslint-plugin-urbandoor

UrbanDoor's eslint configuration(s)

Usage no npm install needed!

<script type="module">
  import urbandoorEslintPluginUrbandoor from 'https://cdn.skypack.dev/@urbandoor/eslint-plugin-urbandoor';
</script>

README

@urbandoor/eslint-plugin-urbandoor

license standard-readme compliant npm (scoped) npm

Dependabot badge semantic-release

CircleCI

UrbanDoor's eslint configuration(s)

Table of Contents

Install

npm install @urbandoor/eslint-plugin-urbandoor

ESLint doesn't support plugins in plugins, so you'll need to run the following script (borrowed from airbnb) to install the requisite peerDependencies.

(
  export PKG=@urbandoor/eslint-plugin-urbandoor
  npm info "$PKG@latest" peerDependencies --json \
    | command sed 's/[\{\},]//g ; s/: /@/g' \
    | xargs npm install --save-dev "$PKG@latest"
)

Usage

At UrbanDoor, we use JavaScript in a few different ways, so this plugin exports several different configurations:

  • node: node scripts

    extends:
      - 'plugin:@urbandoor/urbandoor/node'
    
  • modern: in browsers via transpilation (be it webpack, webpacker, babel, or typescript)

    extends:
      - 'plugin:@urbandoor/urbandoor/modern'
    
  • legacy: in browsers via the rails asset pipeline

    extends:
      - 'plugin:@urbandoor/urbandoor/legacy'
    
  • common: use as a base when none of the others will do

    extends:
      - 'plugin:@urbandoor/urbandoor/common'
    

This project includes eslint-plugin-prettier and eslint-config-prettier but does not provide a prettier config. We ran into a number of inconsistencies when trying to configure eslint/prettier but still needing to include .prettierrc in the consuming repo. If your repo includes a .prettierrc, everything should "just work".

Maintainer

Ian Remmel

Contribute

PRs generally welcome, but ruleset changes will require a detailed justification. Please open issues before proposing changes of more than a line or two.

License

MIT © Urbandoor Inc. 2018 until at least now