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'; 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() { public render() {
return ( return (
<div>Placeholder</div> <div>Placeholder</div>

View file

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

View file

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

View file

@ -7,7 +7,8 @@
"jsRules": {}, "jsRules": {},
"rules": { "rules": {
"quotemark": [true, "single", "jsx-double", "avoid-template", "avoid-escape"], "quotemark": [true, "single", "jsx-double", "avoid-template", "avoid-escape"],
"no-consecutive-blank-lines": [true, 2] "no-consecutive-blank-lines": [true, 2],
"interface-name": [true, "never-prefix"]
}, },
"rulesDirectory": [] "rulesDirectory": []
} }