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

@seattletimes/st-eslint-config

v1.1.9

Published

shared eslint config

Downloads

97

Readme

Install eslint extension in VScode

  1. Open VScode
  2. Settings -> Extensions
  3. Look under the "RECOMMENDED" tab, find ESLint (dbaeumer.vscode-eslint)
  4. Install ESLint extension and switch to the ESLint "Pre-release" setting -> Restart extension
  5. Make sure it's enabled

Migrating new repo to use this eslint config

  1. Create an eslint.config.mjs file at the root, c/p the following into it:
// eslint.config.mjs
import { reactEslintConfig, vanillaEslintConfig } from '@seattletimes/st-eslint-config';

export default [
  ...reactEslintConfig,
  {
    // overrides
    rules: {},
    // add file paths that make sense in the repo
    files: [
      "src/**/*.js",
      "src/**/*.ts",
      "src/**/*.jsx",
      "src/**/*.tsx",
      "*.js",
      "*.mjs",
    ],
  },
];
  1. Delete .eslintrc.js
  2. npm install --save-dev @seattletimes/st-eslint-config
  3. Update “lint” script in package.json
"lint": "./node_modules/.bin/eslint --quiet"

Auto-formatting

  1. if .vscode doesn't exist in the repo already, symlink it from the project root. For example, from inside st-spruce-deuce I would run ln -s ../../.vscode .vscode

Why "--quiet"?

Prettier rules (spacing, style-related stuff) are set to "warn" so that VScode will format-on-save using those rules. However, we don't want those rules to fail our builds. "--quiet" tell eslint to ignore rules set to "warn", so that the build will only fail on errors.

Strategy for transitioning repos to new eslint config

First priority is to improve dev experience moving forward, not necessarily to retroactively fix coding style differences. When you first introduce this eslint config there will be LOTS of errors. Rather than fixing all of these, I recommend using eslint exceptions to grandfather them in. This way we can gradually clean up the codebase at our own pace. We can do this by using "eslint-disable-next-line", like this:

// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line react/no-unused-prop-types
// eslint-disable-next-line react/function-component-definition  

What are the eslint rules?

Recommended rules for eslint, react, typescript, and prettier

Updating the npm package

  1. Run npm run build
  2. Run npm version patch
  3. Push to github,
  4. Run npm publish