Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@floydspace/eslint-plugin-rules

floydspace142MIT0.3.0

ESLint rules plugin

eslint, tslint, eslintplugin, eslint plugin, eslint-plugin, typescript, shorthand-grouping, shorthand grouping, object-shorthand-grouping, object shorthand grouping

readme

Build Status Coverage Status npm version npm

Installation

Make sure you have TypeScript and @typescript-eslint/parser installed, then install the plugin:

npm i @floydspace/eslint-plugin-rules --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install @floydspace/eslint-plugin-rules globally.

Usage

Add @typescript-eslint/parser to the parser field and @floydspace/rules to the plugins section of your .eslintrc configuration file:

{
  "parser": "@typescript-eslint/parser",
  "plugins": ["@floydspace/rules"]
}

Then configure the rules you want to use under the rules section.

{
  "parser": "@typescript-eslint/parser",
  "plugins": ["@floydspace/rules"],
  "rules": {
    "@floydspace/rules/object-shorthand-grouping": "error"
  }
}

You can also enable all the rules for our plugin. Add plugin:@floydspace/rules/all in extends:

{
  "extends": ["plugin:@floydspace/rules/all"]
}

Note: Make sure to use eslint --ext .js,.ts since by default eslint will only search for .js files.

Rules

Name Description
@floydspace/rules/object-shorthand-grouping Group your shorthand properties at the beginning of your object declaration