Fix new lint failures (#31553)

This commit is contained in:
Nathan Shively-Sanders 2018-12-19 13:39:59 -08:00 committed by GitHub
parent 996c4a2f1f
commit 444ae0e622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 20 additions and 22 deletions

View File

@ -246,9 +246,7 @@ declare namespace acorn {
let LooseParser: ILooseParserClass | undefined;
let pluginsLoose: PluginsObject | undefined;
interface ILooseParserClass {
new (input: string, options?: Options): ILooseParser;
}
type ILooseParserClass = new (input: string, options?: Options) => ILooseParser;
interface ILooseParser {}

View File

@ -438,10 +438,10 @@ test("simple tracer built on contexts", function (t) {
this.harvester = harvester;
}
runHandler(callback: any) {
const wrapped = tracer.bind(function () {
const wrapped = tracer.bind(() => {
callback();
this.harvester.emit('finished', tracer.get('transaction'));
}.bind(this));
});
wrapped();
}
}

View File

@ -6,7 +6,7 @@ if (fns["Array.prototype.includes"]) {
}
const syntax = es.syntax();
if (syntax["Arrow function"]) {
new Function("() => {}");
// new Function("() => {}");
}
if (fns.es2017.__all && syntax.es2017.__all) {

View File

@ -37,7 +37,7 @@ import * as prefs from "sdk/simple-prefs";
type prefType = {pref1: string};
(prefs.prefs as prefType)["pref1"] = "value";
prefs.on("pref1", () => console.log("pref1 changed"));
prefs.removeListener("pref1", new Function());
prefs.removeListener("pref1", () => {});
import * as storage from "sdk/simple-storage";
storage.storage.value = 10;

View File

@ -121,12 +121,12 @@ sql = mysql.format(sql, inserts);
connection.config.queryFormat = function(query, values) {
if (!values) return query;
return query.replace(/\:(\w+)/g, function(txt: string, key: string) {
return query.replace(/\:(\w+)/g, (txt: string, key: string) => {
if (values.hasOwnProperty(key)) {
return this.escape(values[key]);
}
return txt;
}.bind(this));
});
};
connection.query("UPDATE posts SET title = :title", {title: "Hello MySQL"});

View File

@ -252,11 +252,11 @@ class Example extends React.Component<any, any> {
getColumns() {
var clonedColumns = columns.slice();
clonedColumns[2].events = {
onClick: function (ev:React.SyntheticEvent<any>, args:{idx:number, rowIdx:number}) {
onClick: (ev:React.SyntheticEvent<any>, args:{idx:number, rowIdx:number}) => {
var idx = args.idx;
var rowIdx = args.rowIdx;
this.refs.grid.openCellEditor(rowIdx, idx);
}.bind(this)
(this.refs.grid as ReactDataGrid<{}>).openCellEditor(rowIdx, idx);
}
};
return clonedColumns;

View File

@ -198,11 +198,11 @@ class Example extends React.Component<any, any> {
getColumns() {
var clonedColumns = columns.slice();
clonedColumns[2].events = {
onClick: function (ev:React.SyntheticEvent<any>, args:{idx:number, rowIdx:number}) {
onClick: (ev:React.SyntheticEvent<any>, args:{idx:number, rowIdx:number}) => {
var idx = args.idx;
var rowIdx = args.rowIdx;
this.refs.grid.openCellEditor(rowIdx, idx);
}.bind(this)
(this.refs.grid as ReactDataGrid)
}
};
return clonedColumns;

View File

@ -252,11 +252,11 @@ class Example extends React.Component<any, any> {
getColumns() {
var clonedColumns = columns.slice();
clonedColumns[2].events = {
onClick: function (ev:React.SyntheticEvent<any>, args:{idx:number, rowIdx:number}) {
onClick: (ev:React.SyntheticEvent<any>, args:{idx:number, rowIdx:number}) => {
var idx = args.idx;
var rowIdx = args.rowIdx;
this.refs.grid.openCellEditor(rowIdx, idx);
}.bind(this)
(this.refs.grid as ReactDataGrid).openCellEditor(rowIdx, idx);
}
};
return clonedColumns;

View File

@ -102,17 +102,17 @@ export default class DocViewerExample extends React.Component {
<View>
<Text>Doc Viewer React Native</Text>
<Button
onPress={this.handlePress.bind(this)}
onPress={this.handlePress}
title="Press Me Open Doc Url"
accessibilityLabel="See a Document"
/>
<Button
onPress={this.handlePressBinaryinUrl.bind(this)}
onPress={this.handlePressBinaryinUrl}
title="Press Me Open BinaryinUrl"
accessibilityLabel="See a Document"
/>
<Button
onPress={this.handlePressb64.bind(this)}
onPress={this.handlePressb64}
title="Press Me Open Base64 String"
accessibilityLabel="See a Document"
/>

View File

@ -401,7 +401,7 @@ Page({
this.setData({
animationData:animation.export()
})
}.bind(this), 1000)
}, 1000)
},
rotateAndScale: function () {
// 旋转同时放大