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

@financial-times/eslint-config-reliability-engineering

v6.2.7

Published

Shared eslint config for reliability-engineering projects

Downloads

18

Readme

eslint-config-reliability-engineering

This is an ESLint configuration which aims to ensure all reliability-engineering applications' source code is consistent in style.

This config extends airbnbs base config along with extra rules provided by eslint-plugin-unicorn, and language/framework specific config

Usage

Install this package together with your application:

npm install --save-dev @financial-times/eslint-config-reliability-engineering

It's recommended to avoid global installs where possible, as eslint in particular can be volatile with dependency locations.

Extend the config using an eslint config file. For example in an .eslintrc.js file:

// .eslintrc.js

const config = require('@financial-times/reliability-engineering')({
    prettier: true, // use prettier, defaults to true
    esModules: true, // use esModules, defaults to false
});

module.exports = Object.assign({}, config, {
    rules: Object.assign({}, config.rules, {
        // Override any settings from the "parent" extended configuration
    }),
});

This root export detects your dependencies from package.json and loads the relevant eslint configs that follow in this list, including prettier.

This is configured using JS to allow for options to be passed in (prettier/esModules) for hard to detect features - esModules can vary per file, and prettier is often installed as a subdependency rather than a direct dependency.

The following configs are also exposed, which allow more granular configuration depending on your choice of tooling, these can be consumed using the standard eslint extends syntax:

// .eslintrc.js

module.exports = {
    extends: ['@financial-times/reliability-engineering/base'],
    rules: {
        // override any rules
    },
};
  • @financial-times/reliability-engineering/base - base (non-react) configuration. Extends the main airbnb rules
  • @financial-times/reliability-engineering/cypress - cypress configuration
  • @financial-times/reliability-engineering/mocha - mocha configuration
  • @financial-times/reliability-engineering/jest - jest configuration. Also reads package.json to determine whether to override file extension rules
  • @financial-times/reliability-engineering/react - react configuration. Extends the main airbnb rules
  • @financial-times/reliability-engineering/prettier - enables formatting with prettier

Dependencies

This package requires certain dependencies as peerDependencies. This is a decision consistent with eslint (see https://github.com/eslint/eslint/issues/2518, https://github.com/eslint/eslint/issues/3458). There is an RFC to address this and allow a package to ship its dependencies: https://github.com/eslint/rfcs/pull/5. This means they should be installed wherever this package is consumed, with matching version ranges:

It's possible to automatically install these by adapting the steps from eslint-config-airbnb-base, e.g. for Linux/OSX:

(
  export PKG=@financial-times/eslint-config-reliability-engineering;
  npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
)