npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@devetry/eslint-config

v1.0.1

Published

Starting point eslint-config for Devetry projects

Downloads

16

Readme

@devetry-eslint-config

Installation

# First, install eslint
npm install eslint --save-dev

# then set up an eslint configuration file
npx eslint --init # follow the prompts about your project

Now, add our config

npm install @devetry/eslint-config --save-dev

Add the config to your .eslintrc file:

    "extends": [
        "eslint:recommended",
        "plugin:@typescript-eslint/recommended",
+       "@devetry/eslint-config",
    ],

Rule Philosophy

Our guideline for choosing rules asks that we consider three questions:

  1. If this rule changes formatting, does it ever make it worse?
  2. Could this rule potentially prevent a bug?
  3. Is ESLint the to best place to warn about this error?

That third rule exists to remind us that other tools have our back. Following ESLint's default recommendations would sometimes break our bundler, or add redundant code when typescript was gonna catch the problem anyway. For example, consistent-return and array-callback-return can't recognize an exhaustive switch, and will yell about the function failing to return a value in all cases. But typescript knows more about our code and can tell that it's fine. typescript is better at checking for that type of error, so we turn those rules off.

Similarly, import/no-unresolved would be a redundant check. Running a build (babel or webpack or typescript or whatever) is already going to tell me if an import is bad. With this eslint rule on, all we've done is add work to make sure ESLint understands all our imports without any actual gain.

If you're not using typescript in your project, consider using a different set of eslint rules.

Editor integration

You'll experience less pain from eslint if you know about it's complaints before CI fails because of them. I reccommend setting up your editor to report what ESLint is complaining about and to apply auto-fixes on each save.

VSCode

Install the ESLint extension: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint

Add the following settings to your project's .vscode/settings.json:

{
  "editor.defaultFormatter": "dbaeumer.vscode-eslint",
  "editor.formatOnSave": true
}

Protip: If you want these settings to apply globally to every project you work on, you can set them in ~/.config/Code/User/settings.json instead.

Build tool integration

It's possible to integrate eslint with webpack, so a build will fail in the presence of any linting errors. This, IMO, is a mistake. Sometimes I want to try something out and I'll clean it up later. Sometimes I want a debugger in my local build and I don't want to fight my tools to get it there. Run them as separate tools.