New tslint rule: Interfaces must not start with I

This commit is contained in:
Scott Nonnenberg 2018-04-05 12:21:22 -07:00
parent 1052341d79
commit 23293a3c00
No known key found for this signature in database
GPG key ID: 5F82280C35134661
4 changed files with 25 additions and 24 deletions

View file

@ -1,11 +1,11 @@
import React from 'react';
interface IProps { name: string; }
interface Props { name: string; }
interface IState { count: number; }
interface State { count: number; }
export class Reply extends React.Component<IProps, IState> {
export class Reply extends React.Component<Props, State> {
public render() {
return (
<div>Placeholder</div>

View file

@ -1,32 +1,32 @@
import React from 'react';
interface IProps {
interface Props {
/** The View class, which will be instantiated then treated like a Backbone View */
readonly View: IBackboneViewConstructor;
readonly View: BackboneViewConstructor;
/** Options to be passed along to the view when constructed */
readonly options: object;
}
interface IBackboneView {
interface BackboneView {
remove: () => void;
render: () => void;
el: HTMLElement;
}
interface IBackboneViewConstructor {
new (options: object): IBackboneView;
interface BackboneViewConstructor {
new (options: object): BackboneView;
}
/**
* Allows Backbone Views to be rendered inside of React (primarily for the styleguide)
* while we slowly replace the internals of a given Backbone view with React.
*/
export class BackboneWrapper extends React.Component<IProps, {}> {
export class BackboneWrapper extends React.Component<Props, {}> {
protected el: Element | null;
protected view: IBackboneView | null;
protected view: BackboneView | null;
protected setEl: (element: HTMLDivElement | null) => void;
constructor(props: IProps) {
constructor(props: Props) {
super(props);
this.el = null;

View file

@ -1,7 +1,7 @@
import React from 'react';
interface IProps {
interface Props {
/**
* Corresponds to the theme setting in the app, and the class added to the root element.
*/
@ -12,7 +12,7 @@ interface IProps {
* Provides the parent elements necessary to allow the main Signal Desktop stylesheet to
* apply (with no changes) to messages in this context.
*/
export class MessageParents extends React.Component<IProps, {}> {
export class MessageParents extends React.Component<Props, {}> {
public render() {
const { theme } = this.props;

View file

@ -1,13 +1,14 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended",
"tslint-react"
],
"jsRules": {},
"rules": {
"quotemark": [true, "single", "jsx-double", "avoid-template", "avoid-escape"],
"no-consecutive-blank-lines": [true, 2]
},
"rulesDirectory": []
"defaultSeverity": "error",
"extends": [
"tslint:recommended",
"tslint-react"
],
"jsRules": {},
"rules": {
"quotemark": [true, "single", "jsx-double", "avoid-template", "avoid-escape"],
"no-consecutive-blank-lines": [true, 2],
"interface-name": [true, "never-prefix"]
},
"rulesDirectory": []
}