GithubHelp home page GithubHelp logo

eslint-config-thehelp's People

Contributors

giodamelio avatar scottnonnenberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

giodamelio

eslint-config-thehelp's Issues

Consider allowing ++ inside loops

I like the no-plusplus rule, but it is a bit annoying not being able to use it in for loops. The whole reason the rule exists isn't really valid in that case anyways. There is already an option to allow ++ only in the last part of loops.

Consider removing all dependencies and not "relying" on npm flattening.

Absolutely fantastic post at https://blog.scottnonnenberg.com/eslint-part-1-exploration/ Scott!

One thing that caught my eye was: https://blog.scottnonnenberg.com/eslint-part-1-exploration/#one-install

I wanted to make it a single install, so my configuration includes ESLint and all needed plugins. And this means, given ESLint plugin resolution rules, that you need npm version 3 and its flat node_modules directory structure. It seems like a reasonable tradeoff. peerDependencies are messy.

You are most certainly correct that peerDependencies are messy. But a bigger issue is making sure to never ever allow folks to "rely" on npm to flatten a dependency to any reasonable location.

Let's look at our dependencies here:

  "dependencies": {
    "eslint": "2.11.1",
    "eslint-plugin-bdd": "2.1.0",
    "eslint-plugin-chai-expect": "1.1.1",
    "eslint-plugin-filenames": "1.0.0",
    "eslint-plugin-immutable": "1.0.0",
    "eslint-plugin-import": "1.8.0",
    "eslint-plugin-jsx-a11y": "1.2.3",
    "eslint-plugin-no-loops": "0.2.0",
    "eslint-plugin-react": "5.1.1",
    "eslint-plugin-security": "1.2.0",
    "@scottnonnenberg/eslint-plugin-thehelp": "0.3.2"
  },

So as a thought experiment, where can the [email protected] script end up as a top level dependency? the answer is any of:

<root>/node_modules/.bin/eslint
<root>/node_modules/@scottnonnenberg/eslint-plugin-thehelp/node_modules/.bin/eslint

The other deps are likely reliable due to the way node require resolution works. (Unless eslint requires them to be at <root>/node_modules/<right-here>. If so, then you similarly can't guarantee that with the structure here -- you need root project deps to guarantee root location).

But here's the next thing with the extra non-eslint dependencies: are all the uses of this package going to use all those plugins?

For instance, if I have a vanilla js / node project, I take the hit of unused plugins: eslint-plugin-react, eslint-plugin-immutable and other things I'm not using.

This is a long way of saying most of the projects I've seen and helped with either do use peerDependencies, or instead document, but don't enforce deps (like https://github.com/walmartlabs/eslint-config-defaults)

Thoughts?

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.