eslint-plugin-collation
v1.7.0
Published
ESLint plugin for making your code easier to read
Downloads
8,801
Maintainers
Readme
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-devUsage
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/parserin your.eslintrcfile 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
