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

Package detail

eslint-plugin-collation

brandongregoryscott8.4kApache-2.01.5.0

ESLint plugin for making your code easier to read

lint, code-style, typescript, eslint, react, react-hooks, hooks, eslint-plugin, eslintplugin

readme


build status smoke test status code style: prettier TypeScript Commitizen friendly semantic-release: angular

ESLint plugin for making your code easier to read, with autofix and TypeScript support

Installation

npm install eslint eslint-plugin-collation @typescript-eslint/parser --save-dev

Usage

Add collation to the plugins and rules section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "parser": "@typescript-eslint/parser",
    "plugins": ["collation"],
    "rules": {
        "collation/group-exports": "warn",
        "collation/no-default-export": "warn",
        "collation/no-inline-export": "warn",
        "collation/sort-dependency-list": "warn",
        "collation/sort-exports": "warn"
    }
}

:warning: You will need to specify @typescript-eslint/parser in your .eslintrc file even if you aren't using TypeScript.

Rules

Rule Description Fixable
collation/group-exports Consolidates multiple export statements :wrench:
collation/no-default-export Enforces exports to be named :wrench:
collation/no-inline-export Enforces exports to appear at the end of the file :wrench:
collation/prefer-import Enforces imports from a preferred module over another, such as for tree-shaking purposes or wrapping a library. :wrench:
collation/sort-dependency-list Sorts React dependency lists :wrench:
collation/sort-exports Sorts specifiers in an export statement :wrench:

For documentation and examples for the available rules, see Rules