stencil-tslint
v1.0.0
Published
Adds stylistic rules to tslint for Stencil projects synced with stencil-1.15
Downloads
48
Maintainers
Readme
This package is repackaged from stencil-tslint. Only intention to create this package is to be in sync with code organization pattern recommended by stenciljs.
stencil-tslint
Adds stylistic tslint rules for Stencil projects
Getting started
Add the following line to your tslint.json
file to enable the default ruleset (which follows the Stencil Style Guide)
{
"extends": ["stencil-tslint/default"]
}
Alternatively, you can extend the bare package and enable each rule on a individual basis
{
"extends": ["stencil-tslint"],
"rules": {
"host-data-precedes-render": true
}
}
Rules
ban-prefix
Ensures that a Component's tag
does not use any of the given prefixes.
component-member-order
Ensures that Component members are ordered consistently
components-per-file
Allows a maximum number of Components to be placed in a single file
decorated-member-style
Requires decorated class members to follow a consistent style (singleline or multiline)
lifecycle-order
Ensures that Component lifecycle methods are ordered consistently
require-prefix
Ensures that a Component's tag
begins with the given prefix(es).
Contributing
Rules in the src/
directory must be camelCased and end in Rule.
More information on developing custom tslint rules can be found on the tslint site
Before adding your custom rule, be sure to write a test for it. Then, you should be able to verify that it works by running:
npm run verify