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-ableneo

v3.0.0

Published

Eslint config with prettier @ableneo/modules

Downloads

34

Readme


menu: eslint-config-ableneo name: Readme

eslint-config-ableneo

npm version node Build Status lerna styled with prettier tested with jest

This package extends eslint-config-react-app with prettier.

support typescript support typescript support typescript

  • One config for vanilla javascript, flow, and TypeScript
  • Use this config if you do not want to setup eslint with all configs and plugins.
  • Install and extend eslint-config-ableneo it works as create-react-app react-scripts but for eslint, linting with prettier.

Origin of this config is in https://github.com/marcelmokos/eslint-config-with-prettier. npm

You can expect

Tools:

Configs:

Plugins:

Usage

Fist time use

  • Commit before installing

  • Install the config

  • Commit all the changes

  • Run yarn lint:fix. All the code will be formatted

  • Commit all the changes again.

After first time

  • Run yarn lint:fix regularly
  • Precommit hook will format the code using yarn lint:fix for committed files

Installation

Automatic

  • config with generator that will setup your environment with testing and linting
yarn add --dev eslint-config-ableneo && npx hygen-add eslint-config-ableneo && npx hygen init-config new

or

npm install --save-dev eslint-config-ableneo react-scripts && npx hygen-add eslint-config-ableneo && npx hygen init-config new

You need to have only one .eslintrc file .eslintrc.yml was automatically generated please remove any other config from the project

After automatic install you do not need to continue with manual install.

Manual install and setup

  • follow these steps only if you want to run

If using npm 5+, use this shortcut for installing minimal peerDependencies

Files to copy or modify

  • Copy following files to your project
.editorcofing
.prettierrc
.eslint.yml

Extend config

To extend config use one of the following methods. Recommended is to use .yaml.

  • package.json
{
  "eslintConfig": {
    "extends": "eslint-config-ableneo"
  }
}
  • .eslintrc.yml
extends:
  - "eslint-config-ableneo"
  • eslintrc.json
{
  "extends": ["eslint-config-ableneo"]
}
  • eslintrc.js
module.exports = {
  extends: ["eslint-config-ableneo"],
};
  • full config you are importing

  • you are able to add or disable rules

  • parts of the config can be disabled, by removing it the config from extends

const merge = require("merge");

module.exports = {
  extends: [
    "eslint-config-ableneo/core",
    "eslint-config-ableneo/flow",
    "eslint-config-ableneo/typescript",
    "eslint-config-ableneo/react",
  ],
  rules: merge(
    require("eslint-config-ableneo/rules/deprecated"),
    require("eslint-config-ableneo/rules/prettier"),
  ),
};

Lint code

  • add to package.json
{
  "scripts": {
    "lint": "eslint . --cache --ext .js,.jsx,.ts,.tsx",
    "lint:fix": "yarn lint --fix"
  }
}
  • run bash script
yarn run lint
yarn run lint:fix

or

npm run test
npm run lint:fix

Adding or overriding rules

support for another plugin like eslint-plugin-dollar-sign

  • helpful for ES6 code that uses jQuery

  • package.json

{
  "eslintConfig": {
    "extends": "eslint-config-ableneo",
    "plugins": ["dollar-sign"],
    "rules": {
      "dollar-sign/dollar-sign": ["error", "ignoreProperties"]
    }
  }
}
extends:
  - eslint-config-ableneo
plugins:
  # https://github.com/erikdesjardins/eslint-plugin-dollar-sign
  - dollar-sign
rules:
  # Require dollar sign for some variables that holds jQuery objects
  dollar-sign/dollar-sign:
    - error
    - ignoreProperties
  • index.ts
module.exports = {
  extends: ["eslint-config-ableneo"],
  plugins: ["dollar-sign"],
  rules: {
    "dollar-sign/dollar-sign": ["error", "ignoreProperties"],
  },
};
  • index.json
{
  "extends": ["eslint-config-ableneo"],
  "plugins": ["dollar-sign"],
  "rules": {
    "dollar-sign/dollar-sign": ["error", "ignoreProperties"]
  }
}