https://github.com/natemoo-re/tslint-stencil
Contributes some helpful tslint rules for Stencil projects
https://github.com/natemoo-re/tslint-stencil
stencil stencil-component tslint
Last synced: 3 months ago
JSON representation
Contributes some helpful tslint rules for Stencil projects
- Host: GitHub
- URL: https://github.com/natemoo-re/tslint-stencil
- Owner: natemoo-re
- License: mit
- Created: 2018-08-28T11:29:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T14:43:11.000Z (almost 3 years ago)
- Last Synced: 2025-06-28T01:06:17.765Z (4 months ago)
- Topics: stencil, stencil-component, tslint
- Language: TypeScript
- Homepage: https://projects.natemoo.re/tslint-stencil/
- Size: 319 KB
- Stars: 22
- Watchers: 2
- Forks: 4
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tslint-stencil
Adds stylistic [tslint](https://github.com/palantir/tslint) rules for [Stencil](https://github.com/ionic-team/stencil) projects
## Getting started
Add the following line to your `tslint.json` file to enable the default ruleset (which follows the [Stencil Style Guide](https://stenciljs.com/docs/style-guide))
```json
{
"extends": ["tslint-stencil/default"]
}
```Alternatively, you can extend the bare package and enable each [rule](#rules) on a individual basis
```json
{
"extends": ["tslint-stencil"],
"rules": {
"host-data-precedes-render": true
}
}
```## Rules
### [`ban-prefix`](docs/ban-prefix.md)
Ensures that a Component's `tag` does not use any of the given prefixes.
### [`component-member-order`](docs/component-member-order.md)
Ensures that Component members are ordered consistently
### [`components-per-file`](docs/components-per-file.md)
Allows a maximum number of Components to be placed in a single file
### [`decorated-member-style`](docs/decorated-member-style.md)
Requires decorated class members to follow a consistent style (singleline or multiline)
### [`lifecycle-order`](docs/lifecycle-order.md)
Ensures that Component lifecycle methods are ordered consistently
### [`require-prefix`](docs/require-prefix.md)
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](https://palantir.github.io/tslint/develop/custom-rules/)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
```