Giter Site home page Giter Site logo

Comments (7)

dougwilson avatar dougwilson commented on April 19, 2024 1

We're using Standard JS !

from discussions.

LinusU avatar LinusU commented on April 19, 2024

I think it's a very good idea to move to standardjs, pretty much for the same two reasons that @dougwilson mentioned. I've started using them in all my projects since it helps to enforce a consistent coding style which absolutely helps when reading the code.

It also catches some programmer errors, such as accidentally leaking global variables, which is very good with many people contributing patches.

As already said, it's extremely easy to install and maintain, since there is no configuration and all upgrades are tested on the entire eco system.

Having standard as part of npm test helps eliminates unnecessary discussions about following the existing coding style on pull requests.

I'm all for implementing it, and would be happy to submit pull requests to do it 🙌

from discussions.

hacksparrow avatar hacksparrow commented on April 19, 2024

+1 for standardjs.

from discussions.

blakeembrey avatar blakeembrey commented on April 19, 2024

Sounds great. I've been using it for a year or so now, including on path-to-regexp (since I was deviating from the jshttp style accidentally at that point).

I'll need to update it to use the ESLint style configuration from our call today.

from discussions.

dougwilson avatar dougwilson commented on April 19, 2024

So here is an example of a commit I've made that sound help: expressjs/morgan@1533cdc

Of note are the following changes:

  • Added a .eslintignore file, mainly to keep eslint from linting any generated coverage/ directory.
  • Added a .eslintrc file, just specifying the standard style.
  • Added npm run lint to the CI commands to run, specifically after the actual tests, such that it is easy to tell if a PR, even though it fails linting, passes the actual tests.
  • Added devDependencies and a simple eslint command to package.json.
  • Added a test/.eslintrc file for the mocha tests. Technically this can be a comment in the file, but ¯\_(ツ)_/¯

from discussions.

jonathanong avatar jonathanong commented on April 19, 2024

why not just run "lint": "eslint lib test" and forget about the .eslintignore file?

or eslint index.js test in this case

from discussions.

dougwilson avatar dougwilson commented on April 19, 2024

I tired that, but it mostly came down to editors. I had an editor that would let you run a report on your project and fix with eslint automatically, but as soon as I did the test coverage, it of course tried to do all this on those JS files from Istanbul output :(

from discussions.

Related Issues (20)

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.