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

@bcw-research/eslint-config

v0.0.3

Published

ESLint Config for BCW Repositories

Downloads

2

Readme

@bcw-research/eslint-config

ESLint Config for BCW Repositories

Usage

With the CLI tool

npx @bcw-research/create-config
# or
npm init @bcw-research/config

Note: The CLI currently only supports initializing a project. If you want to add to an existing ESLint config file, follow the manual steps below.

Manually

Install the shared config and dependencies as devDependencies:

npm install -D @bcw-research/eslint-config eslint eslint-plugin-import eslint-plugin-simple-import-sort

If your project also uses Typescript, React and/or Prettier, be sure to install the appropriate dependencies:

# typescript
npm install -D @typescript-eslint/eslint-plugin @typescript-eslint/parser
# react
npm install -D eslint-plugin-react eslint-plugin-react-hooks
# prettier
npm install -D eslint-config-prettier prettier

After installing all the dependencies, create a .eslintrc.cjs file at the root of your directory. Add the plugin to the extends property of the default export:

module.exports = {
  extends: ["@bcw-research/eslint-config"],
};

The base @bcw-reserach/eslint-config shared config also contains configurations for React, Typescript, and Prettier. They are available within the eslint-config directory. In the .eslintrc.cjs file, simply replace @bcw-research/eslint-config with any of the following:

  • @bcw-research/eslint-config/prettier
  • @bcw-research/eslint-config/typescript
  • @bcw-research/eslint-config/typescript-prettier
  • @bcw-research/eslint-config/react-typescript
  • @bcw-research/eslint-config/react-typescript-prettier

Overriding Rules

Override rules by adding to the .eslintrc.cjs file:

module.exports = {
  extends: ["@bcw-research/eslint-config/react-typescript"],
  rules: {
    quotes: ["error", "single"],
  },
};

Integration with VS Code

If using VS code, don't forget to install the VS Code ESLint Extension

Troubleshooting

  • If using React with Typescript and the "React is a UMD module…" error shows up, double check the following:
    • Make sure typescript is installed as a devDependency
    • Use a pattern that includes the file you are trying to lint in your tsconfig.json:
      • include: ['**/*.ts', '**/*.tsx']
    • Make sure you've installed react >= 17 and set "jsx": "react-jsx" in the compileOptions of your tsconfig.json.
  • It is not recommended to use ESLint formatting rules with the Prettier formatter. If you are unsure which rules format and which ones enforce code style, refer to the eslint-config-prettier plugin. It disables all rules that might conflict with prettier.