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

@axa-ch/easy-config

v1.3.0

Published

Modern and strict configuration files to build consistently web applications.

Downloads

834

Readme

easy-config

Build Status MIT License NPM version NPM downloads

Modern and strict configuration files to build consistently web applications.

Installation

npm i @axa-ch/easy-config

Notice that all the easy-config peer dependencies should be installed manually. For this reason we need to explicitly define their major version.

# Install the linting tools
npm i -D eslint@8 prettier@3

# Install the plugins used in easy-config
npm i -D eslint-config-airbnb-base@15 eslint-plugin-prettier@5 eslint-config-prettier@9 eslint-plugin-import@2

# Install this package from npm
npm i -D axa-ch/easy-config

For Typescript support

npm i -D typescript@5 @typescript-eslint/eslint-plugin@6 @typescript-eslint/parser@6

These plugins assume a tsconfig.json file in your project root (Docs). See also our typescript setup

Optional IDE Configuration

Eslint Setup

Set up your eslint config (.eslintrc.js) file as follows to enable the easy-config eslint rules in your project

const { eslint } = require('@axa-ch/easy-config');

module.exports = {
  extends: [eslint.base],
};

To enable Typescript support, simply add the eslint.typescript settings to the extension list

const { eslint } = require('@axa-ch/easy-config');

module.exports = {
  extends: [eslint.base, eslint.typescript],
};

Prettier Setup

Set up your prettier config (.prettierrc.js) file as follows to enable the easy-config prettier rules in your project

const { prettier } = require('@axa-ch/easy-config');

module.exports = prettier.base;

React Setup

Installation

For React projects we need to install the following two dependencies:

npm i -D eslint-plugin-react@7 eslint-plugin-react-hooks@4

Eslint Setup

To enable linting for React/JSX files, you should add the following extension to your eslint config (.eslintrc.js) file:

const { eslint } = require('@axa-ch/easy-config')

module.exports = {
-  extends: [eslint.base],
+  extends: [eslint.base, eslint.react],
}

You don't need any specific plugins for Typescript support with React, just enable both configs in your .eslintrc.js.

const { eslint } = require('@axa-ch/easy-config')

module.exports = {
-  extends: [eslint.base],
+  extends: [eslint.base, eslint.react, eslint.typescript],
}

Typescript Setup

Make sure to have Typescript installed in your project before proceeding with the following steps

npm i -D typescript@5

Typescript Basic Config

To use the basic easy-config typescript config in your project you can set up your .tsconfig.json file as follows

{
  "extends": "@axa-ch/easy-config/ts-config/base"
}

Stylelint Setup

Stylelint Installation

Make sure to have Stylelint installed in your project before proceeding with the following steps

npm i -D stylelint@15 stylelint-config-standard@34

Stylelint Basic Rules Config

To use only the basic easy-config stylelint rules in your project you can set up your .stylelintrc.js file as follows

const { stylelint } = require('@axa-ch/easy-config');

module.exports = {
  extends: [stylelint.base],
};

Stylelint SCSS Config

Does your project use SCSS files? No problems... you can enable the easy-config stylelint rules for scss. First you need to install the stylelint-config-standard-scss dependency

npm i -D stylelint-config-standard-scss@10

You can then update your .stylelintrc.js file as follows

const { stylelint } = require('@axa-ch/easy-config');

module.exports = {
  extends: [
    stylelint.base,
+   stylelint.scss,
  ],
};

Stylelint BEM Patterns Config

To make sure your classes will be properly named according to BEM, you might enable the easy-config bem pattern plugin. First you need to install stylelint-selector-bem-pattern

npm i -D stylelint-selector-bem-pattern@3

You can then update your .stylelintrc.js file as follows

const { stylelint } = require('@axa-ch/easy-config');

module.exports = {
  extends: [
    stylelint.base,
    stylelint.scss,
+   stylelint.bemPattern,
  ],
};

Stylelint Order Config

Do you care about the order of your css properties? In that case the easy-config stylelint/config-order is what you are looking for. First install stylelint-order

npm i -D stylelint-order@6

Then update your .stylelintrc.js file as follows

const { stylelint } = require('@axa-ch/easy-config');

module.exports = {
  extends: [
    stylelint.base,
    stylelint.scss,
    stylelint.bemPattern,
+   stylelint.order,
  ],
};

Release new Version of easy-config

npm version patch && git push --tags

If you want to release a specific version of this package read the docs.