tslint-steadio
v1.0.0
Published
tslint-steadio ------------
Downloads
6
Readme
tslint-steadio
Lint rules related to React, JSX, and TypeScript for the Steadio development team. Currently all rules have automatic fixes.
Usage
tslint-steadio has peer dependencies on TSLint and TypeScript.
To use these lint rules with the default preset, use configuration inheritance via the extends
keyword.
Here's a sample configuration where tslint.json
lives adjacent to your node_modules
folder:
{
"extends": ["tslint-steadio"],
"rules": {
// override rules here as needed
"no-index-imports": false
}
}
To lint your .ts
and .tsx
files you can simply run tslint -c tslint.json 'src/**/*.{ts,tsx}'
.
Rules
no-index-imports
- Disallows importing JS/TS from paths that end with
/index
.
// Good: import { Component } from '../Component' // Bad: import { Component } from '../Component/index'
- Disallows importing JS/TS from paths that end with
required-fields-first
- When declaring interfaces, all required members must be placed first.
// Good: interface Props { a: string; b: string; c?: number; d?: number; } // Bad: interface Props { a: string; b?: number; c: string; d?: string; }
Development
Quick Start:
yarn
yarn build
yarn test
References for development: