Giter Club home page Giter Club logo

eslint-config-pretty-standard's Introduction

eslint-config-pretty-standard

A shareable eslint+prettier config based on standard.

This eslint config contains all the standard rules that is not about code style. The idea is that you use this config together with prettier.

Usage

Shareable configs are designed to work with the extends feature of .eslintrc files. You can learn more about Shareable Configs on the official ESLint website.

Here's how to install everything you need:

npm install --save-dev eslint-config-pretty-standard eslint prettier

Then, add this to your .eslintrc file:

{
  "extends": ["pretty-standard"]
}

Note: We omitted the eslint-config- prefix since it is automatically assumed by ESLint.

You can override settings from the shareable config by adding them directly into your .eslintrc file.

eslint-config-pretty-standard's People

Contributors

albertfdp avatar alexjeffburke avatar gustavnikolaj avatar papandreou avatar sebdeckers avatar sunesimonsen avatar yara-simargil avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

eslint-config-pretty-standard's Issues

Simplify and extend

Now that eslint-config-prettier explicitly turns style rules off, it's possible to combine standard rules and prettier rules without explicitly listing all the rules. Like this:

{
   "extends": ["standard", "standard-jsx", "prettier"],
   "plugins": ["prettier"],
   "rules": {
     "prettier/prettier": "error"
   }
}

(https://github.com/KidkArolis/pretty-standard/blob/master/eslintrc.json)

Plus, adding the prettier plugin means you can run eslint --fix.

Would you be open to update this package to use the above config? Or is there some other special rules specified in this package? The primary reason I ask is that I was gonna publish eslint-config-pretty-standard to match my cli tool (based on standard-engine), but then realised the name is taken. I think the projects are trying to achieve the same thing, so maybe there's a way to collaborate here?

Trimming plugins.

I got tired of seeing complaints about the missing peer dependencies in my projects :-) We have a peer dep on 4 plugins: react, promise, flowtype and standard - but only rules from the first two are actually referenced in the rules section of the configuration. I sent a PR for removing the two unused plugins in the configuration. #9

I want to axe the other two aswell - but they are actually used, so I thought I'd try to bring it up instead :-) So that leaves to two questions:

  1. eslint-plugin-promise is providing only 1 used rule: promise/param-names. It is poorly documented but it seems to just force you to name the args to the Promise-constructors callback resolve and reject. (source). Is that enough to warrant keeping it around? :-)
  2. Would you be open to split up the react specific parts into a eslint-config-pretty-standard-react and keep this config completely clean?

That I should just stop caring and get over my self is an acceptable answer. I'm happy to do the required work if you want to pursue this.

Inconsistency around for-in loops

If I write a single-line loop:

for (foo in bar) baz(foo);

Prettier transforms it to:

for (foo in bar)
  baz(foo);

which ESLint complains about, because curly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.