@bjervis/eslint-plugin-redundant-stack

0.0.8 • Public • Published

eslint-plugin-redundant-stack

Designed to work with projects using braid-design-system, this plugin detects when a Stack element is redundant.

Braid Stacks are used to manage the vertical spacing between elements. If you have one a single element inside a Stack (or none), there's nothing for it to be spaced from, and so you don't need to include a Stack.

Usually this comes about because you did need a Stack originally, but refactored away the other child elements, not realising there was only one left.

Usage

yarn add -D @bjervis/eslint-plugin-redundant-stack

Then in your eslint config

plugins: ['@bjervis/redundant-stack'],
rules: {
  '@bjervis/redundant-stack/no-redundant-stack': 2,
},

If you're using Braid, you're probably also using sku, so:

// sku.config.js
module.exports = {
  ...,
  dangerouslySetESLintConfig: (skuConfig) => ({
    ...skuConfig,
    plugins: ['@bjervis/redundant-stack'],
    rules: {
      '@bjervis/redundant-stack/no-redundant-stack': 2,
    },
  }),
}

Readme

Keywords

none

Package Sidebar

Install

npm i @bjervis/eslint-plugin-redundant-stack

Weekly Downloads

172

Version

0.0.8

License

MIT

Unpacked Size

8.84 kB

Total Files

7

Last publish

Collaborators

  • bjervis