This package has been deprecated

Author message:

collation has been converted to an ESLint plugin, see https://github.com/brandongregoryscott/eslint-plugin-collation/issues/50 for more info

collation

0.9.0 • Public • Published


build status code style: prettier TypeScript

Code linting/manipulation tools to make your TypeScript code easier to read

Usage

Currently, collation ships with a CLI that can be run manually or plugged into your git hooks to run when files are changed.

npm install --save-dev collation

# Verify installation and show help menu
npx collation --help

# Run on specific file
npx collation --files button.tsx

# Run on list of files
npx collation --files button.tsx dialog.tsx

See .husky/pre-commit for an example of usage in a git hook.

Rules

This project implements various different rules to make your code more consistent and easier to read - similar to tools like ESLint, with the idea that all rules should be fixable without intervention.

For documentation on the available rules, see Rules

Notes

  • This package does not do any additional formatting/processing on the code that's emitted from the TS compiler. For example, multi-line props for a component may be lifted up to a single line once they are alphabetized with alphabetize-jsx-props. It is recommended that you use a tool like prettier after your code has been transformed from collation.

Adding a new rule

When adding a new rule, there are a few places that need to be updated:

A small CLI has been created for internally scaffolding out these changes given a rule name: npm run internal-codegen -- --name new-rule-name

Package Sidebar

Install

npm i collation

Weekly Downloads

1

Version

0.9.0

License

Apache-2.0

Unpacked Size

1.36 MB

Total Files

4

Last publish

Collaborators

  • brandongregoryscott