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

eslint-config-dabapps

v10.0.0

Published

DabApps ESLint Configuration

Downloads

323

Readme

ESLint Config

About

This repository includes a collection of eslint configs that can be combined to lint just about any project, and a default config for all projects that follow our recent patterns.

Install

Install a specific version of the eslint config with NPM. You can see a full list of versions here.

npm install eslint-config-dabapps --save-dev

Configuration

NPM Scripts

Add the following scripts to your package.json

{
  "scripts": {
    "lint": "eslint src/ tests/"
  }
}

Default Config

Create an .eslintrc.json in the route of the project. For most projects you can use the default config like so:

{
  "extends": ["dabapps"]
}

Explanation of the default config below:

Custom Config

But if you want to customise the project because, for example, this project is using a different ECMA version, module system, or framework, you can use a combination of the other configs available in this module. To replicate the default config for example, you could use the following:

{
  "extends": [
    "dabapps/commonjs",
    "dabapps/browser",
    "dabapps/es6",
    "dabapps/react"
  ]
}

There's no need to extend the base config as all other configs extend the base anyway.

React Native

Simply extend the base config, and the react-native config.

{
  "extends": [
    "dabapps",
    "dabapps/react-native"
  ]
}

Test Config

Although it is possible to run eslint with different configs for tests, we have decided to instead use a single config, and globals defined at the top of files for tests.

This decision was made to avoid errors in our apps when accidentally using test globals, and to prevent people's editors from complaining about undefined globals when multiple configs are present (as it'd only use the main one, and not the tests one).

Code of conduct

For guidelines regarding the code of conduct when contributing to this repository please review https://www.dabapps.com/open-source/code-of-conduct/

Import resolvers

If your project uses a custom module resolver (e.g. aliasing ^ to the project root) that is not webpack or the typescript compiler, you will need to define a rule for the import plugin to tell it how to resolve modules.

See https://github.com/benmosher/eslint-plugin-import#resolvers

{
  "import/resolver": "./my-resolver"
}

For instance older projects using webpack should have the following in their .eslintrc.json file:

  "settings": {
    "import/resolver": "webpack"
  },