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

@rezolveai/eslint-config

v1.0.0-beta

Published

eslint config for mixed ts/js projects at Rezolve.ai. For node (server) config, use @rezolveai/eslint-config. For react (client), use @rezolveai/eslint-config/react

Downloads

1

Readme

Eslint Style Guide

Eslint config for mixed js/ts projects. Will work just fine if project is pure js or pure ts.

This config is meant to be used along with prettier. It disables all the formatting rules that is meant for prettier to handle. We do this because we don't want to clutter the eslint report with formatting issues.

Usage

First install the peer and dev dependencies:

npm install eslint prettier @typescript-eslint/eslint-plugin eslint-plugin-import @rezolveai/eslint-config -D

Then setup your .eslintrc.js file if your project is node/server based (no React)

module.exports = {
	extends: ['@rezolveai/eslint-config'],
	parserOptions: {
		ecmaVersion: 'latest',
		sourceType: 'module',
		project: './tsconfig.json', // Only if you have a TS project
	},
}

For react projects, use

module.exports = {
	extends: ['@rezolveai/eslint-config/react'],
	parserOptions: {
		ecmaVersion: 'latest',
		sourceType: 'module',
		project: './tsconfig.json', // Only if you have a TS project
	},
}

If you're setting this up for an existing project with a lot of formatting and eslint issues, it's worth it to submit a style-only PR and get all the auto-fixable issues out of the way. This way subsequent PRs aren't littered with style fixes that makes it hard to review substantive code change. Use the following commands to either check for errors across the entire project or autoformat/autofix them.

To check only:

npx prettier --check .

npx eslint .

To actually carry out autofix:

npx prettier --write .

npx eslint --fix .

Additional Setup for vsCode

Be sure you have the prettier (esbenp.prettier-vscode) and eslint (dbaeumer.vscode-eslint) plugins installed. Setup the plugins to autoformat/autofix on save. You can do this via the UI or add the following to your settings.json

  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,

  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
    "source.organizeImports": true,
    "source.addMissingImports": true
  }

If you don't already have a prettier configuration, you can create .prettierrc.json at your project root with the following content. Alternatively, you can add a "prettier" key in your package.json file with this same content as well.

{
  "printWidth": 100,
  "singleQuote": true,
  "semi": false,
  "bracketSameLine": true,
  "arrowParens": "always"
}

Project with existing eslint installation

After following this setup, if you run into errors saying that eslint cannot find certain configurations to extend from, you may have existing installation of older eslint and eslint-related packages. Use npm outdated to find out what they are and install the latest versions.