0.9.0 • Published 2 years ago

collation v0.9.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

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

0.9.0

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago