diff --git a/abs/abs-tests.ts b/abs/abs-tests.ts index 0ec03e877d..3c749eb278 100644 --- a/abs/abs-tests.ts +++ b/abs/abs-tests.ts @@ -2,6 +2,3 @@ import Abs = require('abs'); // $ExpectType string Abs('/foo'); - -// $ExpectType "three" -"three"; diff --git a/later/later-tests.ts b/later/later-tests.ts index 1d8c272f1b..1ba355f08c 100644 --- a/later/later-tests.ts +++ b/later/later-tests.ts @@ -6,7 +6,7 @@ namespace LaterTest_DefineSchedule { var textSched = later.parse.text('at 10:15am every weekday'); var cronSched = later.parse.cron('0 0/5 14,18 * * ?'); var recurSched = later.parse.recur().last().dayOfMonth(); - var manualSched = { schedules: [ { M: [ 3 ], D: [ 21 ] } ] }; + var manualSched = { schedules: [ { M: [ 3 ], D: [ 21 ] } ] }; // this schedule will fire on the closest weekday to the 15th // every month at 2:00 am except in March @@ -406,13 +406,13 @@ namespace LaterTest_TimePeriods { // 'Mon, 31 Dec 2012 23:59:59 GMT' } - export interface IPartOfDayLater extends later.Static { + export interface PartOfDayLater extends later.Static { partOfDay: later.TimePeriod; } export function custom() { - var customLater = later; + var customLater = later; customLater.partOfDay = { @@ -578,7 +578,7 @@ namespace LaterTest_GenerateRecurences { var sched = later.parse.recur() .every(2).hour().first().dayOfMonth() .and() - .on(8, 20).hour().last().dayOfMonth() + .on(8, 20).hour().last().dayOfMonth(); } export function except_method() { diff --git a/leaflet-label/leaflet-label-tests.ts b/leaflet-label/leaflet-label-tests.ts index bdfee67e62..eba8c5907b 100644 --- a/leaflet-label/leaflet-label-tests.ts +++ b/leaflet-label/leaflet-label-tests.ts @@ -23,7 +23,7 @@ circleMarker.showLabel(); circleMarker.hideLabel(); circleMarker.setLabelNoHide(true); circleMarker.updateLabelContent('test2'); -label = circleMarker.getLabel() +label = circleMarker.getLabel(); circleMarker = circleMarker.unbindLabel(); // Marker @@ -43,7 +43,7 @@ marker.showLabel(); marker.hideLabel(); marker.setLabelNoHide(true); marker.updateLabelContent('test2'); -label = marker.getLabel() +label = marker.getLabel(); marker = marker.unbindLabel(); marker.setOpacity(0.5); marker.setOpacity(0.5, true); diff --git a/leaflet-markercluster/leaflet-markercluster-tests.ts b/leaflet-markercluster/leaflet-markercluster-tests.ts index 346239f836..7488a4e132 100644 --- a/leaflet-markercluster/leaflet-markercluster-tests.ts +++ b/leaflet-markercluster/leaflet-markercluster-tests.ts @@ -26,7 +26,7 @@ markerClusterGroupOptions = { }, chunkedLoading: false, chunkDelay: 100 -} +}; let markerClusterGroup: L.MarkerClusterGroup; markerClusterGroup = L.markerClusterGroup(); diff --git a/leaflet/leaflet-tests.ts b/leaflet/leaflet-tests.ts index bce7afdab6..210e639a5d 100644 --- a/leaflet/leaflet-tests.ts +++ b/leaflet/leaflet-tests.ts @@ -65,7 +65,7 @@ bounds = new L.Bounds(pointTuple, pointTuple); bounds = new L.Bounds([point, point]); bounds = new L.Bounds(boundsLiteral); -let points: Array; +let points: L.Point[]; points = L.LineUtil.simplify([point, point], 1); points = L.LineUtil.simplify([pointTuple, pointTuple], 2); @@ -175,7 +175,7 @@ doesItHaveLayer = map.hasLayer(L.tileLayer('')); let html: HTMLElement; html = map.createPane('foo'); -html = map.createPane('foo', htmlElement) +html = map.createPane('foo', htmlElement); html = map.getPane('foo'); html = map.getPane(htmlElement); html = map.getContainer(); @@ -266,10 +266,10 @@ L.DomEvent .addListener(htmlElement, 'click', eventHandler) .off(htmlElement, 'click', eventHandler) .removeListener(htmlElement, 'click', eventHandler) - .on(htmlElement, {'click': eventHandler}) - .addListener(htmlElement, {'click': eventHandler}) - .off(htmlElement, {'click': eventHandler}, eventHandler) - .removeListener(htmlElement, {'click': eventHandler}, eventHandler) + .on(htmlElement, {click: eventHandler}) + .addListener(htmlElement, {click: eventHandler}) + .off(htmlElement, {click: eventHandler}, eventHandler) + .removeListener(htmlElement, {click: eventHandler}, eventHandler) .stopPropagation(domEvent) .disableScrollPropagation(htmlElement) .disableClickPropagation(htmlElement) diff --git a/libpq/libpq-tests.ts b/libpq/libpq-tests.ts index dda341a4bb..76e133f384 100644 --- a/libpq/libpq-tests.ts +++ b/libpq/libpq-tests.ts @@ -12,13 +12,13 @@ declare const ok: Function; const createTable = (pq: PQ) => { pq.exec('CREATE TEMP TABLE test_data(name text, age int)'); console.log(pq.resultErrorMessage()); - pq.exec("INSERT INTO test_data(name, age) VALUES ('brian', 32), ('aaron', 30), ('', null);") + pq.exec("INSERT INTO test_data(name, age) VALUES ('brian', 32), ('aaron', 30), ('', null);"); }; const blink = (n: number, cb: Function) => { const connections: PQ[] = []; for (let i = 0; i < 30; i++) { - connections.push(new PQ()) + connections.push(new PQ()); } const connect = (con: PQ, cb: (err?: Error) => void) => { con.connect(cb); @@ -28,7 +28,7 @@ const blink = (n: number, cb: Function) => { con.finish(); }); cb(); - })) + })); }; const queryText = "SELECT * FROM generate_series(1, 1000)"; @@ -54,7 +54,7 @@ const query = (pq: PQ, cb: Function) => { return readError('Only one result at a time is accepted'); } cleanup(); - return cb(null, []) + return cb(null, []); }; const sent = pq.sendQuery(queryText); @@ -156,7 +156,7 @@ describe('async simple query', () => { assert.strictEqual(pq.ntuples(), 1); assert.equal(pq.getvalue(0, 0), 'Brian'); done(); - }) + }); }); it('dispatches named query', (done: Function) => { @@ -395,7 +395,7 @@ describe('error info', () => { assert.equal(err.dataTypeName, undefined); assert.equal(err.constraintName, undefined); assert.equal(err.sourceFile, "parse_target.c"); - assert(parseInt(err.sourceLine)); + assert(parseInt(err.sourceLine, 10)); assert.equal(err.sourceFunction, "transformAssignedExpr"); }); }); @@ -449,8 +449,8 @@ describe('connecting', () => { describe('many connections', () => { it('works', (done) => { - async.timesSeries(10, blink, done) - }) + async.timesSeries(10, blink, done); + }); }); describe('connectSync', () => { @@ -477,7 +477,7 @@ describe('connect async', () => { assert.ifError(err); count++; pq.startReader(); - if (count == total) { + if (count === total) { cb(); } }); @@ -497,7 +497,7 @@ describe('multiple queries', () => { const pq = new PQ(); before((done) => { - pq.connect(done) + pq.connect(done); }); it('first query works', (done) => { diff --git a/libpq/tslint.json b/libpq/tslint.json index 377cc837d4..f05741c59b 100644 --- a/libpq/tslint.json +++ b/libpq/tslint.json @@ -1 +1,6 @@ -{ "extends": "../tslint.json" } +{ + "extends": "../tslint.json", + "rules": { + "forbidden-types": false + } +} diff --git a/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts b/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts index 37f7820888..0efb62c9ce 100644 --- a/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts +++ b/localforage-cordovasqlitedriver/localforage-cordovasqlitedriver-tests.ts @@ -26,30 +26,30 @@ declare var cordovaSQLiteDriver: LocalForageDriver; var newValue: string = value; }); - cordovaSQLiteDriver.keys((err: any, keys: Array) => { + cordovaSQLiteDriver.keys((err: any, keys: string[]) => { var newError: any = err; - var newArray: Array = keys; + var newArray: string[] = keys; }); - cordovaSQLiteDriver.getItem("key",(err: any, str: string) => { + cordovaSQLiteDriver.getItem("key", (err: any, str: string) => { var newError: any = err; - var newStr: string = str + var newStr: string = str; }); cordovaSQLiteDriver.setItem("key", "value", (err: any, str: string) => { var newError: any = err; - var newStr: string = str + var newStr: string = str; }); cordovaSQLiteDriver.setItem("key", "value", (str: string) => { var newStr: string = str; }); - cordovaSQLiteDriver.removeItem("key",(err: any) => { + cordovaSQLiteDriver.removeItem("key", (err: any) => { var newError: any = err; }); cordovaSQLiteDriver.removeItem("key", (err: any) => { var newError: any = err; }); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 7d4105df70..ea8bedcce7 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -80,7 +80,7 @@ var keys: IKey[] = [ class Dog { constructor(public name: string) { } - public bark() { + bark() { console.log('Woof, woof!'); } } @@ -7475,7 +7475,7 @@ namespace TestIsWeakMap { } // _.isWeakSet -module TestIsWeakSet { +namespace TestIsWeakSet { { let value: number|WeakSet; @@ -10496,7 +10496,7 @@ namespace TestValuesIn { let result: TResult[]; // Without this type hint, this will fail to compile, as expected. - result = _.valuesIn(new Object); + result = _.valuesIn({}); } { @@ -11705,7 +11705,7 @@ namespace TestNoConflict { // _.noop namespace TestNoop { { - let result: void; + let result: void; // tslint:disable-line:void-return result = _.noop(); result = _.noop(1); diff --git a/lodash/tslint.json b/lodash/tslint.json index 8bcd32b3b1..b896f97736 100644 --- a/lodash/tslint.json +++ b/lodash/tslint.json @@ -1,8 +1,18 @@ { "extends": "../tslint.json", "rules": { + "array-type": false, + "callable-types": false, "forbidden-types": false, + "interface-name": false, + "interface-over-type-literal": false, "no-empty-interface": false, - "unified-signatures": false + "object-literal-key-quotes": false, + "one-line": false, + "semicolon": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "whitespace": false } } \ No newline at end of file diff --git a/loopback-boot/index.d.ts b/loopback-boot/index.d.ts index 4c66af5ef8..84f72b57aa 100644 --- a/loopback-boot/index.d.ts +++ b/loopback-boot/index.d.ts @@ -17,35 +17,35 @@ import * as loopback from "loopback"; * ``` * var loopback= require('loopback'); * var boot = require('loopback-boot'); - * + * * var app = module.exports = loopback(); - * + * * boot(app, __dirname); - * + * * ``` - * + * * Initialize an application from an options object or a set of JSON and JavaScript files. - * - * NOTE: This module is primarily intended for use with LoopBack 2.0. It does work with LoopBack 1.x applications, + * + * NOTE: This module is primarily intended for use with LoopBack 2.0. It does work with LoopBack 1.x applications, * but none of the LoopBack 1.x examples or generated code (scaffolding) use it. - * + * * This function takes an optional argument that is either a string or an object. - * + * * If the argument is a string, then it sets the application root directory based on the string value. Then it: * Creates DataSources from the datasources.json file in the application root directory. - * + * * Configures Models from the model-config.json file in the application root directory. - * - * Configures the LoopBack Application object from the config.json file in the application root directory. + * + * Configures the LoopBack Application object from the config.json file in the application root directory. * These properties can be accessed using app.get('propname'). - * + * * If the argument is an object, then it looks for models, dataSources, 'config', modelsRootDir, dsRootDir, * appConfigRootDir and appRootDir properties of the object. - * + * * If the object has no appRootDir property then it sets the current working directory as the application root directory. - * + * * The execution environment, {env}, is established from, in order, - * + * * options.env * process.env.NODE_ENV, * the literal development. @@ -64,20 +64,20 @@ import * as loopback from "loopback"; * config.json, * config.local.js or config.local.json (only one), * config.{env}.js or config.{env}.json (only one) - * + * * in the directory designated by 'options.appConfigRootDir', if present, or the application root directory. * It merges the properties from the files found. - * - * In both cases, the function loads JavaScript files in the /boot subdirectory of the application root directory + * + * In both cases, the function loads JavaScript files in the /boot subdirectory of the application root directory * with require(). - * + * * NOTE: The version 2.0 of loopback-boot changed the way how models are created. - * The model-config.json file contains only configuration options like dataSource and extra relations. + * The model-config.json file contains only configuration options like dataSource and extra relations. * To define a model, create a per-model JSON file in models/ directory. - * + * * NOTE: Mixing bootLoopBackApp(app, bootConfig) and app.model(name, modelConfig) in multiple files may result in models being undefined due to race conditions. To avoid this when using bootLoopBackApp() make sure all models are passed as part of the models definition. * Throws an error if the config object is not valid or if boot fails. - * + * * @param {Loopback.LoopbackApplication} app LoopBack application created by loopback(). * @param {string|OptionsLB} options Boot options; If String, this is the application root directory; if object, has below properties. * @param {() => void} callback @@ -87,13 +87,13 @@ declare function lb(app: loopback.LoopBackApplication, options: string|OptionsLB interface OptionsLB { /** - * Directory to use when loading JSON and JavaScript files. + * Directory to use when loading JSON and JavaScript files. * Defaults to the current directory (process.cwd()). */ appRootDir: string; /** - * Directory to use when loading config.json. Defaults to appRootDir. + * Directory to use when loading config.json. Defaults to appRootDir. */ appConfigRootDir: string; @@ -103,7 +103,7 @@ interface OptionsLB { models: any; /** - * List of model definitions to use. When options.modelDefinitions is provided, + * List of model definitions to use. When options.modelDefinitions is provided, * loopback-boot does not search filesystem and use only the models provided in this argument. */ modelDefinitions: any[]; @@ -134,8 +134,8 @@ interface OptionsLB { componentRootDir: string; /** - * Environment type, defaults to process.env.NODE_ENV or development. - * Common values are development, staging and production; + * Environment type, defaults to process.env.NODE_ENV or development. + * Common values are development, staging and production; * however the applications are free to use any names. */ env: string; @@ -156,7 +156,7 @@ interface OptionsLB { components: any; /** - * List of directories where to look for files containing model mixin definitions. + * List of directories where to look for files containing model mixin definitions. * All files (mixins) found in these directory are loaded. */ mixinDirs: string[]; @@ -187,7 +187,7 @@ declare namespace lb { /** * compileToBrowserify - * + * * Compile boot instructions and add them to a browserify bundler. * @param {string|any} options as described in bootLoopBackApp above. * @param {any} bundler A browserify bundler created by browserify(). @@ -198,7 +198,7 @@ declare namespace lb { class compileToBrowserify { /** - * Application identifier used to load the correct boot configuration when + * Application identifier used to load the correct boot configuration when * building multiple applications using browserify. */ appId: string; diff --git a/loopback/index.d.ts b/loopback/index.d.ts index 64aac97c92..3402f3006c 100644 --- a/loopback/index.d.ts +++ b/loopback/index.d.ts @@ -88,7 +88,7 @@ declare namespace l { * @returns {any} http.Server A node `http.Server` with this application configured * as the request handle * listen(cb?: () => void):http.Serve - * + * */ // listen(port?: number, cb?: () => void): any; @@ -203,16 +203,16 @@ declare namespace l { /** * Register (new) middleware phases. - * + * * If all names are new, then the phases are added just before "routes" phase. * Otherwise the provided list of names is merged with the existing phases * in such way that the order of phases is preserved - * + * * **Examples* * ```js * // built-in phases: * // initial, session, auth, parse, routes, files, fina - * + * * app.defineMiddlewarePhases('custom'); * // new list of phases * // initial, session, auth, parse, custom, routes, files, fina @@ -340,7 +340,7 @@ declare namespace l { * In the second variant, the parameters `name`, `properties` and `options` * are provided in the config object. Any additional config entries are * interpreted as `options`, i.e. the following two configs are identical - * + * * ```js * { name: 'Customer', base: 'User' } * { name: 'Customer', options: { base: 'User' } } @@ -792,7 +792,7 @@ declare namespace l { * // => model with id 1 has been changed * }); * `` - * + * * #### Event: `deleted * Emitted after an individual model has been deleted. * Argument: `id`, model ID (number) @@ -803,7 +803,7 @@ declare namespace l { * }); * `` * #### Event: `deletedAll - * + * * Emitted after an individual model has been deleted. * Argument: `where` (optional), where filter, JSON object * ```js @@ -816,7 +816,7 @@ declare namespace l { * } * }); * `` - * + * * #### Event: `attached * Emitted after a `Model` has been attached to an `app` * #### Event: `dataSourceAttached @@ -830,7 +830,7 @@ declare namespace l { * // => model with id 1 has been changed * }); * `` - * + * * @param {any} data * @property {string} Model.modelName The name of the model. Static property. * @property {DataSource} Model.dataSource Data source to which the model is connected, if any. Static property. @@ -943,12 +943,12 @@ declare namespace l { * SharedClass * Create a new SharedClass with the given options. * **NOTE** TODO : exported from another module type definition called strong-remoting - * + * * @param {string} name The SharedClass name * @param {() => void} constructor The constructor the SharedClass represents * @param {any} options Additional options. * @property {() => void } ctor The constructor - * @property {any} http The HTTP settings + * @property {any} http The HTTP settings */ class SharedClass { @@ -1013,7 +1013,7 @@ declare namespace l { /** * Get all shared methods belonging to this shared class. - * @param {any} options + * @param {any} options * @return {any[]} An array of shared methods SharedMethod[] */ @@ -1034,7 +1034,7 @@ declare namespace l { * cb(null, str); * } * ``` - * + * * @param {() => void} resolver The resolver function. */ @@ -1053,7 +1053,7 @@ declare namespace l { * **Change Event* * Listen for model changes using the `change` event * ```js - * MyPersistedModel.on('changed', function(obj) + * MyPersistedModel.on('changed', function(obj) * console.log(obj) // => the changed model * }); * ``` @@ -1116,10 +1116,10 @@ declare namespace l { static create(data?: any|any[], callback?: (err: Error, models: any) => void): void; - /** + /** * Create a change stream. See here for more info http://loopback.io/doc/en/lb2/Realtime-server-sent-events.html * @param {any} options Only changes to models matching this where filter will be included in the ChangeStream. - * @param {() => void} callback + * @param {() => void} callback */ static createChangeStream(options: {where: any}, callback: (err: Error, changes: any) => void): void; @@ -1150,7 +1150,7 @@ declare namespace l { * ``` *
See * [Where filter](docs.strongloop.com/display/LB/Where+filter#Wherefilter-Whereclauseforothermethods) - * + * * @callback {() => void} callback Optional callback function called with `(err, info)` arguments. * @param {Error} err Error object; see [Error object](docs.strongloop.com/display/LB/Error+object). * @param {any} info Additional information about the command outcome. @@ -1270,7 +1270,7 @@ declare namespace l { * the same as `find`, but limited to one object. Returns an object, not * collection. If you don't provide the filter object argument, it tries to * locate an existing object that matches the `data` argument - * + * * @options {any} [filter] Optional Filter object; see below. * @property {string|any|Array} fields Identify fields to include in return result. *
See [Fields filter](docs.strongloop.com/display/LB/Fields+filter). @@ -1627,7 +1627,7 @@ declare namespace l { function static(root: string, options: any): void; /** - * Return HTTP response with basic application status information: + * Return HTTP response with basic application status information: * date the application was started and uptime, in JSON format. For example: * ``` * { @@ -1651,7 +1651,7 @@ declare namespace l { * - `access_token` (params only) * - `X-Access-Token` (headers only) * - `authorization` (headers and cookies - * + * * It checks for these values in cookies, headers, and query string parameters _in addition_ to the items * specified in the options parameter * **NOTE:** This function only checks for [signed cookies](expressjs.com/api.html#req.signedCookies) @@ -1664,7 +1664,7 @@ declare namespace l { * params: ['foo-auth', 'foo_auth'] * })); * ``` - * + * * @options {any} [options] Each option Array is used to add additional keys to find an `accessToken` for a `request`. * @property {Array} [cookies] Array of cookie names. * @property {Array} [headers] Array of header names. @@ -1985,7 +1985,7 @@ declare namespace l { * pushSettings.apns.feedbackOptions.port (APNS). * pushSettings.apns.feedbackOptions.batchFeedback (APNS). * pushSettings.apns.feedbackOptions.interval (APNS). - * pushSettings.gcm.serverApiKey: Google Cloud Messaging API key. + * pushSettings.gcm.serverApiKey: Google Cloud Messaging API key. */ pushSetings: { apns: { @@ -2091,7 +2091,7 @@ declare namespace l { /** Model ID. */ modelId: string; - /** + /** * settings Extends the `Model.settings` object. * settings.hashAlgorithm Algorithm used to create cryptographic hash, used as argument * to [crypto.createHash](nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm).Default is sha1. @@ -2260,7 +2260,7 @@ declare namespace l { /** * When two changes conflict a conflict is created * **Note**: call `conflict.fetch()` to get the `target` and `source` models - * + * * @param {*} modelId * @param {PersistedModel} SourceModel * @param {PersistedModel} TargetModel @@ -2337,7 +2337,7 @@ declare namespace l { * Return a new Conflict instance with swapped Source and Target models * This is useful when resolving a conflict in one-way * replication, where the source data must not be changed - * + * * ```js * conflict.swapParties().resolveUsingTarget(cb); * ``` @@ -2349,11 +2349,11 @@ declare namespace l { /** * Determine the conflict type * Possible results ar - * + * * - `Change.UPDATE`: Source and target models were updated * - `Change.DELETE`: Source and or target model was deleted. * - `Change.UNKNOWN`: the conflict type is uknown or due to an erro - * + * * @callback {() => void} callback * @param {Error} err * @param {string} type The conflict type @@ -2402,7 +2402,7 @@ declare namespace l { * } * `` * See github.com/andris9/Nodemailer for other supported options - * + * * @options {any} options See below * @prop {string} from Senders's email address * @prop {string} to List of one or more recipient email addresses (comma-delimited) @@ -2424,19 +2424,19 @@ declare namespace l { /** * Data model for key-value databases. - * @class + * @class */ class KeyValueModel { /** - * Set the TTL (time to live) in ms (milliseconds) for a given key. + * Set the TTL (time to live) in ms (milliseconds) for a given key. * TTL is the remaining time before a key-value pair is discarded from the database. - * - * Callback (Optional) Optional callback. + * + * Callback (Optional) Optional callback. * When the callback function is not provided, a promise is returned instead (see below). - * - * Promise - * this method supports both callback-based and promise-based invocation. + * + * Promise + * this method supports both callback-based and promise-based invocation. * Call this method with no callback argument to get back a promise instead. * @param {string} key Key to use when searching the database. * @param {number} ttl TTL in ms to set for the key. @@ -2448,14 +2448,14 @@ declare namespace l { /** * Return the value associated with a given key. - * + * * Callback (Optional) * Optional callback. When the callback function is not provided, a promise is returned instead (see below). - * + * * Promise - * This method supports both callback-based and promise-based invocation. + * This method supports both callback-based and promise-based invocation. * Call this method with no callback argument to get back a promise instead. - * + * * @param {string} key Key to use when searching the database. * @param {any} options * @param {() => void} callback @@ -2464,8 +2464,8 @@ declare namespace l { static get(key: string, option?: any, callback?: (err: Error, result: any) => void): PromiseLike; /** - * Asynchronously iterate all keys in the database. Similar to .keys() - * but instead allows for iteration over large data sets without having + * Asynchronously iterate all keys in the database. Similar to .keys() + * but instead allows for iteration over large data sets without having * to load everything into memory at once. * Callback example: * ``` @@ -2478,7 +2478,7 @@ declare namespace l { * }); * }); * ``` - * + * * Promise example: * ``` * // Given a model named `Color` with two keys `red` and `blue` @@ -2494,10 +2494,10 @@ declare namespace l { * // key contains `blue` * }); * ``` - * + * * @param {any} filter An optional filter object with the following * @param {string} filter.match Glob string to use to filter returned keys (i.e. userid.*). - * All connectors are required to support * and ?. + * All connectors are required to support * and ?. * They may also support additional special characters that are specific to the backing database. * @param {any} filter.options * @return {any} result AsyncIterator An Object implementing next(cb) -> Promise function that can be used to iterate all keys. @@ -2509,33 +2509,33 @@ declare namespace l { * Return all keys in the database. * WARNING: This method is not suitable for large data sets as all key-values pairs * are loaded into memory at once. For large data sets, use iterateKeys() instead. - * - * This method supports both callback-based and promise-based invocation. + * + * This method supports both callback-based and promise-based invocation. * Call this method with no callback argument to get back a promise instead - * + * * WARNING: this promise implementation will not resolve according to the callback function. - * + * * @param {any} filter An optional filter object with the following - * @param {string} filter.match Glob string used to filter returned keys (i.e. userid.*). - * All connectors are required to support * and ?, but may also support additional special + * @param {string} filter.match Glob string used to filter returned keys (i.e. userid.*). + * All connectors are required to support * and ?, but may also support additional special * characters specific to the database. - * @param {any} filter.options + * @param {any} filter.options * @param {() => void} callback - * @return {PromiseLike} + * @return {PromiseLike} */ static keys(filter: {match: string; options: any}, callback: () => void): PromiseLike; /** * Persist a value and associate it with the given key. - * + * * Callback (Optional) * Optional callback. When the callback function is not provided, a promise is returned instead (see below). - * + * * Promise - * This method supports both callback-based and promise-based invocation. + * This method supports both callback-based and promise-based invocation. * Call this method with no callback argument to get back a promise instead. - * + * * @param {string} key Key to associate with the given value. * @param {any} value Value to persist. * @param {number|any} Optional settings for the key-value pair. If a Number is provided, it is set as the TTL (time to live) in ms (milliseconds) for the key-value pair. @@ -2545,15 +2545,15 @@ declare namespace l { static set(key: string, value: any, options?: number|any, callback?: (err: Error) => void): PromiseLike; /** - * Return the TTL (time to live) for a given key. + * Return the TTL (time to live) for a given key. * TTL is the remaining time before a key-value pair is discarded from the database. - * + * * Callback (Optional) - * Optional callback. When the callback function is not provided, + * Optional callback. When the callback function is not provided, * a promise is returned instead (see below). - * + * * @param {string} key Key to use when searching the database. - * @param {any} options + * @param {any} options * @param {() => void} callback */ @@ -2702,7 +2702,7 @@ declare namespace l { * - ALLOW EVERYONE `logout` * - ALLOW OWNER `findById` * - ALLOW OWNER `updateAttributes` - * + * * @property {string} username Must be unique. * @property {string} password Hidden from remote clients. * @property {string} email Must be valid email. @@ -2724,7 +2724,7 @@ declare namespace l { * @property {number} settings.resetPasswordTokenTTL Time to live for password reset `AccessToken`. Default is `900` (15 minutes). * @property {number} settings.saltWorkFactor The `bcrypt` salt work factor. Default is `10`. * @property {boolean} settings.caseSensitiveEmail Enable case sensitive email. - * + * * @class User * @inherits {PersistedModel} */ @@ -2798,13 +2798,13 @@ declare namespace l { /** * Login a user by with the given `credentials` - * + * * ```js * User.login({username: 'foo', password: 'bar'}, function (err, token) { * console.log(token.id); * }); * ``` - * + * * @param {any} credentials username/password or email/password * @param {string[]|string} [include] Optionally set it to "user" to include * the user info @@ -2817,13 +2817,13 @@ declare namespace l { /** * Logout a user with the given accessToken id - * + * * ```js * User.logout('asd0a9f8dsj9s0s3223mk', function (err) { * console.log(err || 'Logged out'); * }); * ``` - * + * * @param {string} accessTokenID * @callback {() => void} callback * @param {Error} er @@ -2884,10 +2884,10 @@ declare namespace l { * redirect: '/', * tokenGenerator: function (user, cb) { cb("random-token"); } * }; - * + * * user.verify(options, next); * ``` - * + * * @options {any} options * @property {string} type Must be 'email'. * @property {string} to Email address to which verification email is sent. diff --git a/mailgen/mailgen-tests.ts b/mailgen/mailgen-tests.ts index 87d04ee943..b7c8afd244 100644 --- a/mailgen/mailgen-tests.ts +++ b/mailgen/mailgen-tests.ts @@ -1,4 +1,4 @@ -import * as Mailgen from "mailgen" +import * as Mailgen from "mailgen"; const generator: Mailgen = new Mailgen({ theme: "default", diff --git a/mapbox/mapbox-tests.ts b/mapbox/mapbox-tests.ts index aaa7dd1c5f..bd55747d6e 100644 --- a/mapbox/mapbox-tests.ts +++ b/mapbox/mapbox-tests.ts @@ -29,7 +29,7 @@ var marker2 = L.mapbox.featureLayer({ coordinates: [-73.9840, 40.7271] }, properties: { - title: 'Hello world!', + 'title': 'Hello world!', 'marker-color': '#f86767' } }).addTo(map); diff --git a/math3d/math3d-tests.ts b/math3d/math3d-tests.ts index d04ddbefb9..9647038565 100644 --- a/math3d/math3d-tests.ts +++ b/math3d/math3d-tests.ts @@ -1,7 +1,7 @@ import * as math3d from 'math3d'; const v = new math3d.Vector3(1, 2, 3); v.add(new math3d.Vector3(0, 0, 1)); -new math3d.Matrix4x4([1,1,1,1, - 2,2,2,2, - 3,3,3,3, - 4,4,4,4]); +new math3d.Matrix4x4([1, 1, 1, 1, + 2, 2, 2, 2, + 3, 3, 3, 3, + 4, 4, 4, 4]); diff --git a/memoizee/memoizee-tests.ts b/memoizee/memoizee-tests.ts index e8e73a2d6a..ee34ef5bfb 100644 --- a/memoizee/memoizee-tests.ts +++ b/memoizee/memoizee-tests.ts @@ -18,15 +18,15 @@ memoized('foo', 3, 13); memoized = memoize(fn, { primitive: true }); memoized('/path/one'); memoized('/path/one'); -memoized = memoize(fn, { dispose: function (value:number) { /*…*/ } }); +memoized = memoize(fn, { dispose: function (value: number) { /*…*/ } }); var foo3 = memoized('foo', 3); var bar7 = memoized('bar', 7); memoized.clear('foo', 3); // Dispose called with foo3 value memoized.clear('bar', 7); // Dispose called with bar7 value memoized.delete('foo', 0); -var mFn = memoize(function (hash:any) { +var mFn = memoize(function (hash: any) { // body of memoized function -}, { normalizer: function (args:any) { +}, { normalizer: function (args: any) { // args is arguments object as accessible in memoized function return JSON.stringify(args[0]); } }); @@ -34,12 +34,12 @@ var mFn = memoize(function (hash:any) { mFn({ foo: 'bar' }); memoized = memoize(fn, { length: 2, resolvers: [String, Boolean] }); -memoized(String(12), [1,2,3].length); +memoized(String(12), [1, 2, 3].length); memoized("12", Number(true)); memoized(String({ toString: function () { return "12"; } }), Number({})); { - var afn = function (a:number, b:number) { + var afn = function (a: number, b: number) { return new Promise(function (res) { res(a + b); }); }; let memoized = memoize(afn, { promise: true }); diff --git a/modernizr/modernizr-tests.ts b/modernizr/modernizr-tests.ts index 1807a5f377..a4e3c16785 100644 --- a/modernizr/modernizr-tests.ts +++ b/modernizr/modernizr-tests.ts @@ -4,7 +4,7 @@ declare var $: any; window.alert = function(thing?: string) { $('#content').append('
' + thing + '
'); -} +}; $(function () { var audio = new Audio(); @@ -30,15 +30,15 @@ $(function () { Modernizr.addTest('track', () => { var video = document.createElement('video'); - return typeof video.addTextTrack === 'function' + return typeof video.addTextTrack === 'function'; }); Modernizr.testStyles('#modernizr { width: 9px; color: papayawhip; }', (elem, rule) => { - Modernizr.addTest('width', elem.offsetWidth == 9); + Modernizr.addTest('width', elem.offsetWidth === 9); }); Modernizr.testStyles('#modernizr { width: 9px; color: papayawhip; }', (elem, rule) => { - Modernizr.addTest('width', elem.offsetWidth == 9); + Modernizr.addTest('width', elem.offsetWidth === 9); }, 2, ["video", "image"]); Modernizr.testProp('pointerEvents'); @@ -70,12 +70,12 @@ Modernizr.addTest('itsTuesday', function() { Modernizr.addTest('hasJquery', 'jQuery' in window); var detects = { - 'hasjquery': 'jQuery' in window, - 'itstuesday': function() { + hasjquery: 'jQuery' in window, + itstuesday: function() { var d = new Date(); return d.getDay() === 2; } -} +}; Modernizr.addTest(detects); var keyframes = Modernizr.atRule('@keyframes'); @@ -88,47 +88,47 @@ if (keyframes) { Modernizr._domPrefixes === [ "Moz", "O", "ms", "Webkit" ]; -Modernizr.hasEvent('blur') // true; +Modernizr.hasEvent('blur'); // true; -Modernizr.hasEvent('devicelight', window) // true; +Modernizr.hasEvent('devicelight', window); // true; var query = Modernizr.mq('(min-width: 900px)'); if (query) { // the browser window is larger than 900px } -Modernizr.prefixed('boxSizing') +Modernizr.prefixed('boxSizing'); var raf = Modernizr.prefixed('requestAnimationFrame', window); raf(function() { }); var rAFProp = Modernizr.prefixed('requestAnimationFrame', window, false); -rAFProp === 'WebkitRequestAnimationFrame' // in older webkit +rAFProp === 'WebkitRequestAnimationFrame'; // in older webkit -Modernizr.prefixedCSS('transition') // '-moz-transition' in old Firefox +Modernizr.prefixedCSS('transition'); // '-moz-transition' in old Firefox -Modernizr.prefixedCSSValue('background', 'linear-gradient(left, red, red)') +Modernizr.prefixedCSSValue('background', 'linear-gradient(left, red, red)'); var rule = Modernizr._prefixes.join('transform: rotate(20deg); '); -rule === 'transform: rotate(20deg); webkit-transform: rotate(20deg); moz-transform: rotate(20deg); o-transform: rotate(20deg); ms-transform: rotate(20deg);' +rule === 'transform: rotate(20deg); webkit-transform: rotate(20deg); moz-transform: rotate(20deg); o-transform: rotate(20deg); ms-transform: rotate(20deg);'; rule = 'display:' + Modernizr._prefixes.join('flex; display:') + 'flex'; -rule === 'display:flex; display:-webkit-flex; display:-moz-flex; display:-o-flex; display:-ms-flex; display:flex' +rule === 'display:flex; display:-webkit-flex; display:-moz-flex; display:-o-flex; display:-ms-flex; display:flex'; -Modernizr.testAllProps('boxSizing') // true -Modernizr.testAllProps('display', 'block') // true -Modernizr.testAllProps('display', 'penguin') // false +Modernizr.testAllProps('boxSizing'); // true +Modernizr.testAllProps('display', 'block'); // true +Modernizr.testAllProps('display', 'penguin'); // false Modernizr.testAllProps('shapeOutside', 'content-box', true); -Modernizr.testProp('pointerEvents') // true -Modernizr.testProp('pointerEvents', 'none') // true -Modernizr.testProp('pointerEvents', 'penguin') // false +Modernizr.testProp('pointerEvents'); // true +Modernizr.testProp('pointerEvents', 'none'); // true +Modernizr.testProp('pointerEvents', 'penguin'); // false Modernizr.testStyles('#modernizr { width: 9px; color: papayawhip; }', function(elem, rule) { // elem is the first DOM node in the page (by default #modernizr) // rule is the first argument you supplied - the CSS rule in string form - Modernizr.addTest('widthworks', elem.style.width === '9px') + Modernizr.addTest('widthworks', elem.style.width === '9px'); }); Modernizr.testStyles('#modernizr {width: 1px}; #modernizr2 {width: 2px}', function(elem) { diff --git a/msgpack-lite/msgpack-lite-tests.ts b/msgpack-lite/msgpack-lite-tests.ts index 033fde060c..2d9acbc420 100644 --- a/msgpack-lite/msgpack-lite-tests.ts +++ b/msgpack-lite/msgpack-lite-tests.ts @@ -3,7 +3,7 @@ import * as msgpack from 'msgpack-lite'; // https://github.com/kawanet/msgpack-lite#encoding-and-decoding-messagepack function encodingAndDecoding() { // encode from JS Object to MessagePack (Buffer) - var buffer = msgpack.encode({"foo": "bar"}); + var buffer = msgpack.encode({foo: "bar"}); // decode from MessagePack (Buffer) to JS Object var data = msgpack.decode(buffer); // => {"foo": "bar"} diff --git a/nanomsg/nanomsg-tests.ts b/nanomsg/nanomsg-tests.ts index a731312890..a94a2ac50a 100644 --- a/nanomsg/nanomsg-tests.ts +++ b/nanomsg/nanomsg-tests.ts @@ -2,7 +2,7 @@ import { Socket, socket } from "nanomsg"; const pub: Socket = socket("pub"); const sub: Socket = socket("sub"); -const addr: string = "tcp://127.0.0.1:7789" +const addr: string = "tcp://127.0.0.1:7789"; pub.bind(addr); sub.connect(addr); diff --git a/node-hid/node-hid-tests.ts b/node-hid/node-hid-tests.ts index 15bc71b7d1..5149b8ead1 100644 --- a/node-hid/node-hid-tests.ts +++ b/node-hid/node-hid-tests.ts @@ -1,6 +1,6 @@ import HID = require('node-hid'); -var devices = HID.devices() +var devices = HID.devices(); var device = new HID.HID("path"); diff --git a/node-zookeeper-client/node-zookeeper-client-tests.ts b/node-zookeeper-client/node-zookeeper-client-tests.ts index 71f2267878..8704319dc5 100644 --- a/node-zookeeper-client/node-zookeeper-client-tests.ts +++ b/node-zookeeper-client/node-zookeeper-client-tests.ts @@ -240,7 +240,7 @@ const client = zookeeper.createClient( { client.create('/test/demo', function (error, path) { if (error) { - if ((error as zookeeper.Exception).getCode() == zookeeper.Exception.NODE_EXISTS) { + if ((error as zookeeper.Exception).getCode() === zookeeper.Exception.NODE_EXISTS) { console.log('Node exists.'); } else { console.log((error as Error).stack); diff --git a/ns-api/ns-api-tests.ts b/ns-api/ns-api-tests.ts index 6f56cdd875..966c1f36d7 100644 --- a/ns-api/ns-api-tests.ts +++ b/ns-api/ns-api-tests.ts @@ -8,7 +8,7 @@ let ns: NsApi = NsApi({ timeout: 1500 }); -ns.vertrektijden("", (err: any, data: Object) => { +ns.vertrektijden("", (err, data) => { if(err) { console.log(err); } else { @@ -17,7 +17,7 @@ ns.vertrektijden("", (err: any, data: Object) => { }); // Get travel advise -ns.reisadvies ({}, (err: any, data: Object) => { +ns.reisadvies ({}, (err, data) => { if(err) { console.log(err); } else { @@ -25,7 +25,7 @@ ns.reisadvies ({}, (err: any, data: Object) => { } }); -ns.prijzen({}, (err: any, data: Object) => { +ns.prijzen({}, (err, data) => { if(err) { console.log(err); } else { @@ -33,7 +33,7 @@ ns.prijzen({}, (err: any, data: Object) => { } }); -ns.stations("code", (err: any, data: Object) => { +ns.stations("code", (err, data) => { if(err) { console.log(err); } else { @@ -41,7 +41,7 @@ ns.stations("code", (err: any, data: Object) => { } }); -ns.stations((err: any, data: Object) => { +ns.stations((err, data) => { if(err) { console.log(err); } else { @@ -49,7 +49,7 @@ ns.stations((err: any, data: Object) => { } }); -ns.storingen({}, (err: any, data: Object) => { +ns.storingen({}, (err, data) => { if(err) { console.log(err); } else { diff --git a/openfin/index.d.ts b/openfin/index.d.ts index 2c1cfd648e..0b9f3e16ac 100644 --- a/openfin/index.d.ts +++ b/openfin/index.d.ts @@ -63,7 +63,7 @@ declare namespace fin { */ close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application’s child windows. + * Retrieves an array of wrapped fin.desktop.Windows for each of the application�s child windows. */ getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; /** @@ -95,7 +95,7 @@ declare namespace fin { */ removeEventListener(type: OpenFinApplicationEventType, previouslyRegisteredListener: (event: ApplicationBaseEvent | TrayIconClickedEvent | WindowEvent | WindowAlertRequestedEvent | WindowAuthRequested | WindowNavigationRejectedEvent | WindowEndLoadEvent) => any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Removes the application’s icon from the tray. + * Removes the application�s icon from the tray. */ removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -288,8 +288,8 @@ declare namespace fin { size?: number; /** * The size in pixels of an additional - * square resizable region located at the - * bottom right corner of a + * square resizable region located at the + * bottom right corner of a * frameless window. (Default: 4) */ bottomRightCorner?: number; @@ -922,11 +922,11 @@ declare namespace fin { interface OpenFinWindowStatic { /** * Class: Window - * + * * new Window(options, callbackopt, errorCallbackopt) - * + * * Creates a new OpenFin Window - * + * * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. The new window appears in the same process as the parent window. * @param {any} options - The options of the window * @param {Function} [callback] - Called if the window creation was successful @@ -963,7 +963,7 @@ declare namespace fin { * @returns {OpenFinApplication} Parent application */ getParentApplication(): OpenFinApplication; - /** + /** * Gets the parent window. */ getParentWindow(): OpenFinWindow; @@ -989,7 +989,7 @@ declare namespace fin { bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Closes the window. - * @param {force} Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window. + * @param {force} Close will be prevented from closing when force is false and �close-requested� has been subscribed to for application�s main window. */ close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1009,7 +1009,7 @@ declare namespace fin { */ enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Flashes the window’s frame and taskbar icon until the window is activated. + * Flashes the window�s frame and taskbar icon until the window is activated. */ flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1106,7 +1106,7 @@ declare namespace fin { setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Shows the window if it is hidden. - * @param {force} Show will be prevented from closing when force is false and ‘show-requested’ has been subscribed to for application’s main window. + * @param {force} Show will be prevented from closing when force is false and �show-requested� has been subscribed to for application�s main window. */ show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** diff --git a/openfin/openfin-tests.ts b/openfin/openfin-tests.ts index 81ac24f937..f7b34b401a 100644 --- a/openfin/openfin-tests.ts +++ b/openfin/openfin-tests.ts @@ -232,11 +232,11 @@ function test_system() { }); // downloadAsset let dirAppAsset = { - 'src': 'http://local:8000/dir.zip', - 'alias': 'dirApp', - 'version': '1.23.24', - 'target': 'dir.bat', - 'args': '' + src: 'http://local:8000/dir.zip', + alias: 'dirApp', + version: '1.23.24', + target: 'dir.bat', + args: '' }; fin.desktop.System.downloadAsset(dirAppAsset, progress => { let downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); diff --git a/optics-agent/optics-agent-tests.ts b/optics-agent/optics-agent-tests.ts index 75fafbd871..1eb31b3546 100644 --- a/optics-agent/optics-agent-tests.ts +++ b/optics-agent/optics-agent-tests.ts @@ -8,7 +8,6 @@ import OpticsAgent, { import { GraphQLSchema } from 'graphql'; import * as express from 'express'; import * as hapi from 'hapi'; -var OpticsAgentRequired = require('optics-agent'); const configOptions = { apiKey: "", @@ -20,7 +19,7 @@ const configOptions = { proxyUrl: "", reportIntervalMs: 1, }; -OpticsAgent.configureAgent(configOptions) +OpticsAgent.configureAgent(configOptions); let expressServer = express(); expressServer.use(OpticsAgent.middleware()); diff --git a/pad/pad-tests.ts b/pad/pad-tests.ts index c808d303df..ccba560703 100644 --- a/pad/pad-tests.ts +++ b/pad/pad-tests.ts @@ -1,6 +1,6 @@ import pad = require('pad'); -pad('pad', 5) // "pad " -pad(5, 'pad') // " pad" -pad('pad', 5, '+') // "pad++" -pad(5, 'pad', '+') // "++pad" \ No newline at end of file +pad('pad', 5); // "pad " +pad(5, 'pad'); // " pad" +pad('pad', 5, '+'); // "pad++" +pad(5, 'pad', '+'); // "++pad" \ No newline at end of file diff --git a/passport-anonymous/passport-anonymous-tests.ts b/passport-anonymous/passport-anonymous-tests.ts index 3daa2474cf..0bdd2dda3f 100644 --- a/passport-anonymous/passport-anonymous-tests.ts +++ b/passport-anonymous/passport-anonymous-tests.ts @@ -1,4 +1,4 @@ import * as passport from "passport"; -import { Strategy } from "passport-anonymous"; +import { Strategy } from "passport-anonymous"; passport.use(new Strategy()); diff --git a/pbf/pbf-tests.ts b/pbf/pbf-tests.ts index 533c183801..2fde33cbd8 100644 --- a/pbf/pbf-tests.ts +++ b/pbf/pbf-tests.ts @@ -17,7 +17,7 @@ pbf.readMessage(function (tag, result, pbf) {}); pbf.readFixed32(); pbf.readSFixed32(); pbf.readFixed64(); -pbf.readSFixed64(); +pbf.readSFixed64(); pbf.readFloat(); pbf.readDouble(); pbf.readVarint(); @@ -28,7 +28,7 @@ pbf.readBoolean(); pbf.readString(); pbf.readBytes(); pbf.readPackedVarint(); -pbf.readPackedVarint([], true); +pbf.readPackedVarint([], true); pbf.readPackedSVarint(); pbf.readPackedSVarint([]); pbf.readPackedBoolean(); diff --git a/pem/pem-tests.ts b/pem/pem-tests.ts index fd4ce11f6e..1d1638d00e 100644 --- a/pem/pem-tests.ts +++ b/pem/pem-tests.ts @@ -55,7 +55,7 @@ const tests = { }, 'Create 2048bit Private key with Password': (test: any) => { - pem.createPrivateKey(2048,{cipher:'des',password:'TestMe'}, (error: any, data: any) => { + pem.createPrivateKey(2048, {cipher: 'des', password: 'TestMe'}, (error: any, data: any) => { var key = (data && data.key || '').toString(); test.ifError(error); test.ok(key); @@ -525,7 +525,7 @@ const tests = { }); }, 'Create PKCS12 with key password': (test: any) => { - pem.createPrivateKey({cipher:'aes128',password:'xxx'}, (error: any, data: any) => { + pem.createPrivateKey({cipher: 'aes128', password: 'xxx'}, (error: any, data: any) => { var key = (data && data.key || '').toString(); pem.createCertificate({ diff --git a/pikaday-time/pikaday-time-tests.ts b/pikaday-time/pikaday-time-tests.ts index d118639229..aa8e2be8e9 100644 --- a/pikaday-time/pikaday-time-tests.ts +++ b/pikaday-time/pikaday-time-tests.ts @@ -7,9 +7,9 @@ new Pikaday({field: document.getElementById('datepicker')}); new Pikaday({field: $('#datepicker')[0]}); (() => { - var field:HTMLInputElement = document.getElementById('datepicker'); + var field: HTMLInputElement = document.getElementById('datepicker'); var picker = new Pikaday({ - onSelect: function (date:Date) { + onSelect: function (date: Date) { field.value = picker.toString(); console.log(date.toISOString()); } @@ -38,10 +38,10 @@ new Pikaday({field: $('#datepicker')[0]}); picker.nextMonth(); picker.prevMonth(); picker.gotoYear(2015); - picker.setMinDate(new Date); - picker.setMaxDate(new Date); - picker.setStartRange(new Date); - picker.setEndRange(new Date); + picker.setMinDate(new Date()); + picker.setMaxDate(new Date()); + picker.setStartRange(new Date()); + picker.setEndRange(new Date()); picker.isVisible(); picker.show(); picker.adjustPosition(); diff --git a/plugapi/plugapi-tests.ts b/plugapi/plugapi-tests.ts index d9a0845997..4c30ce66d2 100644 --- a/plugapi/plugapi-tests.ts +++ b/plugapi/plugapi-tests.ts @@ -6,14 +6,14 @@ new PlugAPI({ }, function (err, bot) { if (!err) { const ROOM = "roomslug"; - bot.connect(ROOM); // The part after https://plug.dj + bot.connect(ROOM); // The part after https://plug.dj bot.on(PlugAPI.events.ROOM_JOIN, function (room) { console.log("Joined " + room); }); bot.on("chat", function (data) { - if (data.type == "emote") { + if (data.type === "emote") { console.log(data.from + data.message); } else { console.log(data.from + "> " + data.message); diff --git a/python-shell/python-shell-tests.ts b/python-shell/python-shell-tests.ts index 83bca24b6e..af282b427b 100644 --- a/python-shell/python-shell-tests.ts +++ b/python-shell/python-shell-tests.ts @@ -14,24 +14,24 @@ var options = { scriptPath: 'path/to/my/scripts', args: ['value1', 'value2', 'value3'] }; - + ps.run('my_script.py', options, function (err, results) { if (err) throw err; - // results is an array consisting of messages collected during execution + // results is an array consisting of messages collected during execution console.log('results: %j', results); }); var pyshell = new PythonShell('my_script.py'); -// sends a message to the Python script via stdin +// sends a message to the Python script via stdin pyshell.send('hello'); - + pyshell.on('message', function (message) { - // received a message sent from the Python script (a simple "print" statement) + // received a message sent from the Python script (a simple "print" statement) console.log(message); }); - -// end the input stream and allow the process to exit + +// end the input stream and allow the process to exit pyshell.end(function (err) { if (err) throw err; console.log('finished'); diff --git a/react-dnd-html5-backend/react-dnd-html5-backend-tests.ts b/react-dnd-html5-backend/react-dnd-html5-backend-tests.ts index 670790c46a..dd2dfd49cd 100644 --- a/react-dnd-html5-backend/react-dnd-html5-backend-tests.ts +++ b/react-dnd-html5-backend/react-dnd-html5-backend-tests.ts @@ -120,7 +120,7 @@ namespace Square { style: { backgroundColor: fill } - }) + }); } } @@ -168,7 +168,7 @@ namespace BoardSquare { backgroundColor: color } }); - }; + } render() { var black = (this.props.x + this.props.y) % 2 === 1; @@ -204,7 +204,7 @@ namespace BoardSquare { namespace CustomDragLayer { interface CustomDragLayerP extends React.Props { isDragging?: boolean; - item?: Object; + item?: {}; } function dragLayerCollect(monitor: ReactDnd.DragLayerMonitor) { @@ -240,7 +240,7 @@ namespace Board { return x === knightX && y === knightY ? Knight.create() : null; - }; + } private _renderSquare = (i: number) => { var x = i % 8; @@ -256,10 +256,10 @@ namespace Board { x: x, y: y }, this._renderPiece(x, y))); - }; + } render() { - var squares: React.ReactHTMLElement[] = []; + var squares: Array> = []; for (let i = 0; i < 64; i++) { squares.push(this._renderSquare(i)); } diff --git a/react-native-fs/react-native-fs-tests.ts b/react-native-fs/react-native-fs-tests.ts index 0e7dc2b0d0..f5a87051e4 100644 --- a/react-native-fs/react-native-fs-tests.ts +++ b/react-native-fs/react-native-fs-tests.ts @@ -68,7 +68,7 @@ var uploadBegin: RNFS.UploadCallbackBegin = (response) => { }; var uploadProgress: RNFS.UploadCallbackProgress = (response) => { - var percentage = Math.floor((response.totalBytesSent/response.totalBytesExpectedToSend) * 100); + var percentage = Math.floor((response.totalBytesSent / response.totalBytesExpectedToSend) * 100); console.log('UPLOAD IS ' + percentage + '% DONE!'); }; @@ -78,15 +78,15 @@ RNFS.uploadFiles({ files: files, method: 'POST', headers: { - 'Accept': 'application/json', + Accept: 'application/json', }, fields: { - 'hello': 'world', + hello: 'world', }, begin: uploadBegin, progress: uploadProgress }).promise.then((response) => { - if (response.statusCode == 200) { + if (response.statusCode === 200) { console.log('FILES UPLOADED!'); // response.statusCode, response.headers, response.body } else { console.log('SERVER ERROR'); @@ -100,14 +100,14 @@ RNFS.uploadFiles({ }); var downloadProgress: RNFS.DownloadCallbackProgress = (result) => { - result.bytesWritten === 0 - result.contentLength > 10 - result.jobId -} + result.bytesWritten === 0; + result.contentLength > 10; + result.jobId; +}; var downloadBegin: RNFS.DownloadCallbackBegin = (result) => { - result.headers === {} -} + result.headers === {}; +}; RNFS.downloadFile({ fromUrl: 'http://.txt', @@ -115,5 +115,5 @@ RNFS.downloadFile({ begin: downloadBegin, progress: downloadProgress }).promise.then((response) => { - response.statusCode === 200 -}) \ No newline at end of file + response.statusCode === 200; +}); diff --git a/react-router-redux/react-router-redux-tests.ts b/react-router-redux/react-router-redux-tests.ts index f917515d32..963d511f13 100644 --- a/react-router-redux/react-router-redux-tests.ts +++ b/react-router-redux/react-router-redux-tests.ts @@ -15,7 +15,7 @@ import { const reducer = combineReducers({ routing: routerReducer }); // Apply the middleware to the store -const browserHistory = createHistory() +const browserHistory = createHistory(); const middleware = routerMiddleware(browserHistory); const store = createStore( reducer, diff --git a/readline-sync/readline-sync-tests.ts b/readline-sync/readline-sync-tests.ts index 02c8d8e952..a56d4140f6 100644 --- a/readline-sync/readline-sync-tests.ts +++ b/readline-sync/readline-sync-tests.ts @@ -1,16 +1,14 @@ - - import readlineSync = require('readline-sync'); -let result:string = readlineSync.question('Which program starts do you want? ', { +let result: string = readlineSync.question('Which program starts do you want? ', { defaultInput: 'firefox' }); -let result2:string = readlineSync.prompt({prompt: '$$'}); +let result2: string = readlineSync.prompt({prompt: '$$'}); -let result3:string = readlineSync.keyIn('Press a key', { limit: '$<1-5>' }); +let result3: string = readlineSync.keyIn('Press a key', { limit: '$<1-5>' }); -let result4:{} = readlineSync.setDefaultOptions({ +let result4: {} = readlineSync.setDefaultOptions({ prompt: '$$', hideEchoBack: true, mask: '*', @@ -18,12 +16,12 @@ let result4:{} = readlineSync.setDefaultOptions({ limitMessage: 'Limit reached', defaultInput: 'English', trueValue: 2, - falseValue: (value:string) => { return true; }, + falseValue: (value: string) => true, caseSensitive: true, keepWhitespace: true, encoding: 'utf-8', bufferSize: 12, - print: (display:string, encoding:string) => { console.log(display)}, + print: (display: string, encoding: string) => { console.log(display); }, history: false, cd: true, charlist: 'abc', @@ -34,26 +32,26 @@ let result4:{} = readlineSync.setDefaultOptions({ exists: false, isFile: true, isDirectory: false, - validate: (path:string) => { return (path === '/usr/local/bin'); }, + validate: (path: string) => path === '/usr/local/bin', create: true, guide: false, }); -let result5:string = readlineSync.questionEMail('Enter email'); +let result5: string = readlineSync.questionEMail('Enter email'); -let result6:string = readlineSync.questionNewPassword('PASSWORD: ', {charlist: '$#$@%'}); +let result6: string = readlineSync.questionNewPassword('PASSWORD: ', {charlist: '$#$@%'}); -let result7:number = readlineSync.questionInt('Enter an integer', { limitMessage: 'Enter a valid integer' }); +let result7: number = readlineSync.questionInt('Enter an integer', { limitMessage: 'Enter a valid integer' }); -let result8:number = readlineSync.questionFloat('Enter a float', { limitMessage: 'Enter a valid float' }); +let result8: number = readlineSync.questionFloat('Enter a float', { limitMessage: 'Enter a valid float' }); -let result9:string = readlineSync.questionPath('Save to: ', { +let result9: string = readlineSync.questionPath('Save to: ', { isDirectory: true, exists: null, create: true }); -readlineSync.promptCL((command:string, arg1:string, arg2:string) => { +readlineSync.promptCL((command: string, arg1: string, arg2: string) => { if (command === 'add') { console.log(arg1 + ' is added.'); } else if (command === 'copy') { @@ -62,43 +60,43 @@ readlineSync.promptCL((command:string, arg1:string, arg2:string) => { }); readlineSync.promptCL({ - add: (element:string) => { // It's called by also "ADD", "Add", "aDd", etc.. + add: (element: string) => { // It's called by also "ADD", "Add", "aDd", etc.. console.log(element + ' is added.'); }, - copy: (from:string, to:string) => { + copy: (from: string, to: string) => { console.log(from + ' is copied to ' + to + '.'); } }); -readlineSync.promptLoop((input:string) => { +readlineSync.promptLoop((input: string) => { console.log('-- You said "' + input + '"'); return input === 'bye'; }); readlineSync.promptCLLoop({ - add: (element:string) => { + add: (element: string) => { console.log(element + ' is added.'); }, - copy: (from:string, to:string) => { + copy: (from: string, to: string) => { console.log(from + ' is copied to ' + to + '.'); }, - bye: () => { return true; } + bye: () => true }); -let result10:string = readlineSync.promptSimShell(); +let result10: string = readlineSync.promptSimShell(); -let result11:(boolean | string) = readlineSync.keyInYN('Do you want to install this?'); +let result11: (boolean | string) = readlineSync.keyInYN('Do you want to install this?'); -let result12:boolean = readlineSync.keyInYNStrict('Do you want to install this?', { guide: true }); +let result12: boolean = readlineSync.keyInYNStrict('Do you want to install this?', { guide: true }); -readlineSync.keyInPause({ guide:true }); +readlineSync.keyInPause({ guide: true }); let frameworks = ['Express', 'hapi', 'flatiron', 'MEAN.JS', 'locomotive']; -let result13:number = readlineSync.keyInSelect(frameworks, 'Which framework?'); +let result13: number = readlineSync.keyInSelect(frameworks, 'Which framework?'); -let result14:string = readlineSync.getRawInput(); +let result14: string = readlineSync.getRawInput(); -readlineSync.setPrint((display:string, encoding:string) => { console.log(display) }); +readlineSync.setPrint((display: string, encoding: string) => { console.log(display); }); readlineSync.setPrompt(new Date()); diff --git a/redux-actions/redux-actions-tests.ts b/redux-actions/redux-actions-tests.ts index 60923b9f10..11fa7adf13 100644 --- a/redux-actions/redux-actions-tests.ts +++ b/redux-actions/redux-actions-tests.ts @@ -26,7 +26,7 @@ const actionHandlerWithReduceMap = ReduxActions.handleAction( next(state: number, action: ReduxActions.Action) { return state * action.payload; }, - throw(state: number) { return state } + throw(state: number) { return state; } }, 0 ); @@ -34,17 +34,17 @@ const actionHandlerWithReduceMap = ReduxActions.handleAction( state = actionHandlerWithReduceMap(0, multiplyAction(10)); const actionsHandler = ReduxActions.handleActions({ - 'INCREMENT': (state: number, action: ReduxActions.Action) => state + action.payload, - 'MULTIPLY': (state: number, action: ReduxActions.Action) => state * action.payload + INCREMENT: (state: number, action: ReduxActions.Action) => state + action.payload, + MULTIPLY: (state: number, action: ReduxActions.Action) => state * action.payload }, 0); state = actionsHandler(0, { type: 'INCREMENT' }); const actionsHandlerWithInitialState = ReduxActions.handleActions({ - 'INCREMENT': { + INCREMENT: { next: (state: number, action: ReduxActions.Action) => state + action.payload, }, - 'MULTIPLY': { + MULTIPLY: { next: (state: number, action: ReduxActions.Action) => state * action.payload } }, 0); @@ -53,17 +53,17 @@ state = actionsHandlerWithInitialState(0, { type: 'INCREMENT' }); // ---------------------------------------------------------------------------------------------------- -type TypedState = { +interface TypedState { value: number; -}; +} -type TypedPayload = { +interface TypedPayload { increase: number; } -type MetaType = { - remote: boolean -}; +interface MetaType { + remote: boolean; +} let typedState: TypedState; @@ -103,37 +103,37 @@ const typedActionHandlerWithReduceMap = ReduxActions.handleAction) { return { value: state.value + action.payload.increase }; }, - throw(state: TypedState) { return state } + throw(state: TypedState) { return state; } }, {value: 1} ); typedState = typedActionHandlerWithReduceMap({ value: 0 }, typedIncrementByActionWithMeta(10)); -const act = ReduxActions.createAction('ACTION1') -act('hello').payload === 'hello' +const act = ReduxActions.createAction('ACTION1'); +act('hello').payload === 'hello'; -const act2 = ReduxActions.createAction('ACTION2', (s: {load: boolean}) => s) -act2({load: true}).payload.load == true +const act2 = ReduxActions.createAction('ACTION2', (s: {load: boolean}) => s); +act2({load: true}).payload.load === true; -const act3 = ReduxActions.createAction('ACTION3', (s: string) => ({s})) -act3('hello').payload.s == 'hello' +const act3 = ReduxActions.createAction('ACTION3', (s: string) => ({s})); +act3('hello').payload.s === 'hello'; ReduxActions.handleAction<{ hello: string }, string>(act, (state, action) => { - return { hello: action.payload } -}, {hello: 'greetings'}) + return { hello: action.payload }; +}, {hello: 'greetings'}); ReduxActions.handleAction<{ hello: { load: boolean } }, { load: boolean }>(act2, (state, action) => { - return { hello: action.payload } -}, {hello: {load: true}}) + return { hello: action.payload }; +}, {hello: {load: true}}); ReduxActions.handleAction(act3, (state, action) => { - return { hello: action.payload.s } -}, {hello: 'greetings'}) + return { hello: action.payload.s }; +}, {hello: 'greetings'}); ReduxActions.handleAction(ReduxActions.combineActions(act, act3, act2), (state, action) => { -}, 0) +}, 0); /* can't do this until it lands in 2.2, HKTs ReduxActions.handleAction(act, (state, action) => { diff --git a/redux-localstorage-debounce/redux-localstorage-debounce-tests.ts b/redux-localstorage-debounce/redux-localstorage-debounce-tests.ts index bb15d77121..24b5a32528 100644 --- a/redux-localstorage-debounce/redux-localstorage-debounce-tests.ts +++ b/redux-localstorage-debounce/redux-localstorage-debounce-tests.ts @@ -1,21 +1,21 @@ -import { compose } from "redux" +import { compose } from "redux"; import { default as persistState -} from "redux-localstorage" -import * as adapter from "redux-localstorage/lib/adapters/localStorage" -import { default as debounce } from "redux-localstorage-debounce" +} from "redux-localstorage"; +import * as adapter from "redux-localstorage/lib/adapters/localStorage"; +import { default as debounce } from "redux-localstorage-debounce"; const storageWait = compose( debounce(100) -)(adapter(window.localStorage)) -const enhancerWait = persistState(storageWait, "test") +)(adapter(window.localStorage)); +const enhancerWait = persistState(storageWait, "test"); const storageMax = compose( debounce(100, 200) -)(adapter(window.localStorage)) -const enhancerMax = persistState(storageMax, "test") +)(adapter(window.localStorage)); +const enhancerMax = persistState(storageMax, "test"); const storageOpts = compose( debounce(100, { maxWait : 200, foo : "bar" }) -)(adapter(window.localStorage)) -const enhancerOpts = persistState(storageOpts, "test") +)(adapter(window.localStorage)); +const enhancerOpts = persistState(storageOpts, "test"); diff --git a/redux-localstorage-filter/redux-localstorage-filter-tests.ts b/redux-localstorage-filter/redux-localstorage-filter-tests.ts index 83939ea310..5569b22345 100644 --- a/redux-localstorage-filter/redux-localstorage-filter-tests.ts +++ b/redux-localstorage-filter/redux-localstorage-filter-tests.ts @@ -1,16 +1,16 @@ -import { compose } from "redux" +import { compose } from "redux"; import { default as persistState -} from "redux-localstorage" -import * as adapter from "redux-localstorage/lib/adapters/localStorage" -import { default as filter } from "redux-localstorage-filter" +} from "redux-localstorage"; +import * as adapter from "redux-localstorage/lib/adapters/localStorage"; +import { default as filter } from "redux-localstorage-filter"; const storageSingle = compose( filter("foo") -)(adapter(window.localStorage)) -const enhancerSingle = persistState(storageSingle, "test") +)(adapter(window.localStorage)); +const enhancerSingle = persistState(storageSingle, "test"); const storageMulti = compose( filter(["foo", "bar"]) -)(adapter(window.localStorage)) -const enhancerMulti = persistState(storageMulti, "test") +)(adapter(window.localStorage)); +const enhancerMulti = persistState(storageMulti, "test"); diff --git a/redux-localstorage/redux-localstorage-tests.ts b/redux-localstorage/redux-localstorage-tests.ts index e0e5ad4bfa..49bf442fcf 100644 --- a/redux-localstorage/redux-localstorage-tests.ts +++ b/redux-localstorage/redux-localstorage-tests.ts @@ -1,33 +1,33 @@ -import { Reducer, compose, combineReducers, createStore } from "redux" +import { Reducer, compose, combineReducers, createStore } from "redux"; import { default as persistState, mergePersistedState, actionTypes -} from "redux-localstorage" -import * as adapterAsyncStorage from "redux-localstorage/lib/adapters/AsyncStorage" -import * as adapterLocalStorage from "redux-localstorage/lib/adapters/localStorage" -import * as adapterSessionStorage from "redux-localstorage/lib/adapters/sessionStorage" +} from "redux-localstorage"; +import * as adapterAsyncStorage from "redux-localstorage/lib/adapters/AsyncStorage"; +import * as adapterLocalStorage from "redux-localstorage/lib/adapters/localStorage"; +import * as adapterSessionStorage from "redux-localstorage/lib/adapters/sessionStorage"; -const AsyncStorage: any = {} +const AsyncStorage: any = {}; -const rootReducer: Reducer = (state: any, action: any) => state +const rootReducer: Reducer = (state: any, action: any) => state; const reducer = compose( mergePersistedState() -)(rootReducer) +)(rootReducer); -const storageAsyncStorage = adapterAsyncStorage(AsyncStorage) -const storageLocalStorage = adapterLocalStorage(window.localStorage) -const storageSessionStorage = adapterSessionStorage(window.sessionStorage) +const storageAsyncStorage = adapterAsyncStorage(AsyncStorage); +const storageLocalStorage = adapterLocalStorage(window.localStorage); +const storageSessionStorage = adapterSessionStorage(window.sessionStorage); const createStoreAsyncStorage = compose( persistState(storageAsyncStorage, "foo") -)(createStore)(reducer) +)(createStore)(reducer); const createStoreLocalStorage = compose( persistState(storageLocalStorage, "foo") -)(createStore)(reducer) +)(createStore)(reducer); const createStoreSessionStorage = compose( persistState(storageSessionStorage, "foo") -)(createStore)(reducer) +)(createStore)(reducer); diff --git a/rrule/test/rrule.ts b/rrule/test/rrule.ts index 733a8546db..829c22f087 100644 --- a/rrule/test/rrule.ts +++ b/rrule/test/rrule.ts @@ -16,7 +16,7 @@ let y: string[]; x = rule.all(); // Get a slice: -x = rule.between(new Date(2012, 7, 1), new Date(2012, 8, 1)) +x = rule.between(new Date(2012, 7, 1), new Date(2012, 8, 1)); // Get an iCalendar RRULE string representation: // The output can be used with RRule.fromString(). @@ -28,36 +28,36 @@ y.push(rule.toText()); // Get full a string representation of all options, // including the default and inferred ones. -y.push(RRule.optionsToString(rule.options)) +y.push(RRule.optionsToString(rule.options)); // Cherry-pick only some options from an rrule: y.push(RRule.optionsToString({ freq: rule.options.freq, dtstart: rule.options.dtstart, -})) +})); -rule = RRule.fromString("FREQ=WEEKLY;DTSTART=20120201T093000Z") +rule = RRule.fromString("FREQ=WEEKLY;DTSTART=20120201T093000Z"); // This is equivalent -rule = new RRule(RRule.parseString("FREQ=WEEKLY;DTSTART=20120201T093000Z")) +rule = new RRule(RRule.parseString("FREQ=WEEKLY;DTSTART=20120201T093000Z")); -var options = RRule.parseString('FREQ=DAILY;INTERVAL=6') -options.dtstart = new Date(2000, 1, 1) -rule = new RRule(options) +var options = RRule.parseString('FREQ=DAILY;INTERVAL=6'); +options.dtstart = new Date(2000, 1, 1); +rule = new RRule(options); rule = new RRule({ freq: RRule.WEEKLY, count: 23 -}) -y.push(rule.toText()) +}); +y.push(rule.toText()); -rule = RRule.fromText('every day for 3 times') +rule = RRule.fromText('every day for 3 times'); -options = RRule.parseText('every day for 3 times') +options = RRule.parseText('every day for 3 times'); // {freq: 3, count: "3"} -options.dtstart = new Date(2000, 1, 1) -rule = new RRule(options) +options.dtstart = new Date(2000, 1, 1); +rule = new RRule(options); // Test arrays -let multipleInstance = new RRule({freq:3, byhour:[6,12,18]}) +let multipleInstance = new RRule({freq: 3, byhour: [6, 12, 18]}); diff --git a/rx-lite-async/rx-lite-async-tests.ts b/rx-lite-async/rx-lite-async-tests.ts index a8119fbb82..8c88cc135c 100644 --- a/rx-lite-async/rx-lite-async-tests.ts +++ b/rx-lite-async/rx-lite-async-tests.ts @@ -8,20 +8,20 @@ namespace Rx.Tests.Async { var sch: Rx.IScheduler; function start() { - obsNum = Rx.Observable.start(()=> 10, obsStr, sch); + obsNum = Rx.Observable.start(() => 10, obsStr, sch); obsNum = Rx.Observable.start(() => 10, obsStr); - obsNum = Rx.Observable.start(()=> 10); + obsNum = Rx.Observable.start(() => 10); } function toAsync() { - obsNum = Rx.Observable.toAsync(()=> 1, sch)(); - obsNum = Rx.Observable.toAsync((a1: number)=> a1)(1); - obsStr = Rx.Observable.toAsync((a1: string, a2: number)=> a1 + a2.toFixed(0))("", 1); - obsStr = Rx.Observable.toAsync((a1: string, a2: number, a3: Date)=> a1 + a2.toFixed(0) + a3.toDateString())("", 1, new Date()); - obsStr = Rx.Observable.toAsync((a1: string, a2: number, a3: Date, a4: boolean)=> a1 + a2.toFixed(0) + a3.toDateString() + (a4 ? 1 : 0))("", 1, new Date(), false); + obsNum = Rx.Observable.toAsync(() => 1, sch)(); + obsNum = Rx.Observable.toAsync((a1: number) => a1)(1); + obsStr = Rx.Observable.toAsync((a1: string, a2: number) => a1 + a2.toFixed(0))("", 1); + obsStr = Rx.Observable.toAsync((a1: string, a2: number, a3: Date) => a1 + a2.toFixed(0) + a3.toDateString())("", 1, new Date()); + obsStr = Rx.Observable.toAsync((a1: string, a2: number, a3: Date, a4: boolean) => a1 + a2.toFixed(0) + a3.toDateString() + (a4 ? 1 : 0))("", 1, new Date(), false); } function startAsync() { - var o: Rx.Observable = Rx.Observable.startAsync(() => >{}); + var o: Rx.Observable = Rx.Observable.startAsync(() => > {}); } } diff --git a/semver-diff/semver-diff-tests.ts b/semver-diff/semver-diff-tests.ts index fca7d8552e..daa8fc9614 100644 --- a/semver-diff/semver-diff-tests.ts +++ b/semver-diff/semver-diff-tests.ts @@ -12,4 +12,4 @@ semverDiff('0.1.0', '0.1.0+foo'); //=> 'build' semverDiff('0.0.1', '0.0.1'); //=> null -semverDiff('0.0.2', '0.0.1'); //=> null +semverDiff('0.0.2', '0.0.1'); //=> null diff --git a/sheetify/sheetify-tests.ts b/sheetify/sheetify-tests.ts index 7287ba1499..bdeb1aa817 100644 --- a/sheetify/sheetify-tests.ts +++ b/sheetify/sheetify-tests.ts @@ -15,6 +15,6 @@ const test8 = sheetify` .test { border: 1px soild black; } -` +`; const prefix = sheetify.getPrefix('boop'); \ No newline at end of file diff --git a/simple-oauth2/simple-oauth2-tests.ts b/simple-oauth2/simple-oauth2-tests.ts index 290ac6fc31..2b5f45e673 100644 --- a/simple-oauth2/simple-oauth2-tests.ts +++ b/simple-oauth2/simple-oauth2-tests.ts @@ -91,9 +91,9 @@ const oauth2 = oauth2lib.create(credentials); (function () { // Sample of a JSON access token (you got it through previous steps) const tokenObject = { - 'access_token': '', - 'refresh_token': '', - 'expires_in': '7200' + access_token: '', + refresh_token: '', + expires_in: '7200' }; // Create the access token wrapper @@ -104,7 +104,7 @@ const oauth2 = oauth2lib.create(credentials); // Callbacks token.refresh((error, result) => { token = result; - }) + }); // Promises token.refresh() diff --git a/sip.js/sip.js-tests.ts b/sip.js/sip.js-tests.ts index 524caf1827..b817b8e2c8 100644 --- a/sip.js/sip.js-tests.ts +++ b/sip.js/sip.js-tests.ts @@ -55,7 +55,7 @@ ua.stop(); ua.register(); ua = ua.register({ extraHeaders: [""] }); -ua.unregister() +ua.unregister(); ua.unregister({ extraHeaders: [""], all: true }); const isConnected: boolean = ua.isConnected(); @@ -78,7 +78,7 @@ const inviteOptions: sipjs.InviteOptions = { rel100: "", inviteWithoutSdp: true, RTCConstraints: {} -} +}; session = ua.invite("", inviteOptions); diff --git a/slug/slug-tests.ts b/slug/slug-tests.ts index 101155e3ce..5fc72d1032 100644 --- a/slug/slug-tests.ts +++ b/slug/slug-tests.ts @@ -1,23 +1,23 @@ -import slug = require('slug') -var print = console.log.bind(console, '>') +import slug = require('slug'); +var print = console.log.bind(console, '>'); -print(slug('i ♥ unicode')) +print(slug('i ♥ unicode')); // > i-love-unicode -print(slug('unicode ♥ is ☢')) // yes! +print(slug('unicode ♥ is ☢')); // yes! // > unicode-love-is-radioactive -print(slug('i ♥ unicode', '_')) // If you prefer something else then `-` as seperator +print(slug('i ♥ unicode', '_')); // If you prefer something else then `-` as seperator // > i_love_unicode -slug.charmap['♥'] = 'freaking love' // change default charmap or use option {charmap:{…}} as 2. argument -print(slug('I ♥ UNICODE')) +slug.charmap['♥'] = 'freaking love'; // change default charmap or use option {charmap:{…}} as 2. argument +print(slug('I ♥ UNICODE')); // > I-freaking-love-UNICODE -print(slug('â˜�-Number', {lower: true})) // If you prefer lower case +print(slug('â˜�-Number', {lower: true})); // If you prefer lower case // > telephone-number -print(slug('i <3 unicode')) +print(slug('i <3 unicode')); // > i-love-unicode // options is either object or replacement (sets options.replacement) diff --git a/swagger-node-runner/swagger-node-runner-tests.ts b/swagger-node-runner/swagger-node-runner-tests.ts index 49538d3825..77b516e71c 100644 --- a/swagger-node-runner/swagger-node-runner-tests.ts +++ b/swagger-node-runner/swagger-node-runner-tests.ts @@ -77,7 +77,7 @@ let app = restify.createServer(); SwaggerNodeRunner.create(config, function(err, runner) { if (err) { throw err; } - let restifyMiddelware = runner.restifyMiddleware() + let restifyMiddelware = runner.restifyMiddleware(); restifyMiddelware.register(app); diff --git a/swagger-schema-official/tslint.json b/swagger-schema-official/tslint.json index ec365f164b..f03b9ed8c2 100644 --- a/swagger-schema-official/tslint.json +++ b/swagger-schema-official/tslint.json @@ -1,3 +1,6 @@ { - "extends": "../tslint.json" + "extends": "../tslint.json", + "rules": { + "object-literal-key-quotes": false + } } diff --git a/swiper/swiper-tests.ts b/swiper/swiper-tests.ts index 3fc9b3c185..99465226c1 100644 --- a/swiper/swiper-tests.ts +++ b/swiper/swiper-tests.ts @@ -269,7 +269,7 @@ function thumbsGalleryLoop() { prevButton: '.swiper-button-prev', spaceBetween: 10, loop: true, - loopedSlides: 5, //looped slides should be the same + loopedSlides: 5, //looped slides should be the same }); var galleryThumbs = new Swiper('.gallery-thumbs', { spaceBetween: 10, @@ -441,8 +441,8 @@ function scrollContainer() { // 32-slideable-menu.html function slideableMenu() { var toggleMenu = function () { - if (swiper.previousIndex == 0) - swiper.slidePrev() + if (swiper.previousIndex === 0) + swiper.slidePrev(); } , menuButton = document.getElementsByClassName('menu-button')[0] , swiper = new Swiper('.swiper-container', { @@ -450,20 +450,20 @@ function slideableMenu() { , initialSlide: 1 , resistanceRatio: .00000000000001 , onSlideChangeStart: function (slider) { - if (slider.activeIndex == 0) { - menuButton.classList.add('cross') - menuButton.removeEventListener('click', toggleMenu, false) + if (slider.activeIndex === 0) { + menuButton.classList.add('cross'); + menuButton.removeEventListener('click', toggleMenu, false); } else - menuButton.classList.remove('cross') + menuButton.classList.remove('cross'); } , onSlideChangeEnd: function (slider) { - if (slider.activeIndex == 0) - menuButton.removeEventListener('click', toggleMenu, false) + if (slider.activeIndex === 0) + menuButton.removeEventListener('click', toggleMenu, false); else - menuButton.addEventListener('click', toggleMenu, false) + menuButton.addEventListener('click', toggleMenu, false); } , slideToClickedSlide: true - }) + }); } // 33-responsive-breakpoints.html function responsiveBreakpoints() { diff --git a/uikit/uikit-tests.ts b/uikit/uikit-tests.ts index 200a7a470f..d9032fa8b0 100644 --- a/uikit/uikit-tests.ts +++ b/uikit/uikit-tests.ts @@ -37,7 +37,7 @@ function testModal() { UIkit.modal.confirm("Are you sure?", () => {}, () => {}, {}); UIkit.modal.confirm("Are you sure?", () => {}, {}); - UIkit.modal.prompt("Name:", 'value', function (newvalue:string) { + UIkit.modal.prompt("Name:", 'value', function (newvalue: string) { // will be executed on submit. }); var modal = UIkit.modal.blockUI("Any content..."); @@ -62,11 +62,11 @@ function testLightBox() { var element = "#group"; var lightbox = UIkit.lightbox(element, {/* options */}); var lightbox2 = UIkit.lightbox.create([ - {source: 'http://url/to/video.mp4', 'type': 'video'}, - {'source': 'http://url/to/image.jpg', 'type': 'image'} + {source: 'http://url/to/video.mp4', type: 'video'}, + {source: 'http://url/to/image.jpg', type: 'image'} ]); lightbox2.show(); - var lightbox3 = UIkit.lightbox(element) + var lightbox3 = UIkit.lightbox(element); } function testAutoComplete() { @@ -83,20 +83,20 @@ function testHtmlEditor() { } function testSlider() { - var slider = UIkit.slider("element", {}) + var slider = UIkit.slider("element", {}); } function testSlideSet() { - var slideset = UIkit.slideset("element", {}) + var slideset = UIkit.slideset("element", {}); } function testSlideShow() { - var slideshow = UIkit.slideshow("element", {}) + var slideshow = UIkit.slideshow("element", {}); } function testParallax() { - var parallax = UIkit.parallax("element", {}) + var parallax = UIkit.parallax("element", {}); } function testAccordion() { - var accordion = UIkit.accordion("element", {}) + var accordion = UIkit.accordion("element", {}); } @@ -121,7 +121,7 @@ function testNotify() { function testSearch() { - var search = UIkit.search("element", {}) + var search = UIkit.search("element", {}); } function testNestable() { @@ -134,11 +134,11 @@ function testStick() { var sticky = UIkit.sticky('element', {}); } function testTimePicker() { - var timepicker = UIkit.timepicker('element', {}) + var timepicker = UIkit.timepicker('element', {}); } function testTooltip() { - var tooltip = UIkit.tooltip('element', {}) + var tooltip = UIkit.tooltip('element', {}); } function testUpload() { @@ -159,7 +159,7 @@ function testUpload() { progress: function(percent: number) { percent = Math.ceil(percent); - bar.css("width", percent+"%").text(percent+"%"); + bar.css("width", percent + "%").text(percent + "%"); }, allcomplete: function(response: any) { @@ -170,7 +170,7 @@ function testUpload() { progressbar.addClass("uk-hidden"); }, 250); - alert("Upload Completed") + alert("Upload Completed"); } }; @@ -189,11 +189,11 @@ function testUpload() { }, - progress: function (percent:number) { + progress: function (percent: number) { }, - allcomplete: function (response:any) { + allcomplete: function (response: any) { } }); @@ -207,11 +207,11 @@ function testUpload() { }, - progress: function (percent:number) { + progress: function (percent: number) { }, - allcomplete: function (response:any) { + allcomplete: function (response: any) { } }); diff --git a/usb/usb-tests.ts b/usb/usb-tests.ts index f1963307fc..31e287c5b8 100644 --- a/usb/usb-tests.ts +++ b/usb/usb-tests.ts @@ -81,7 +81,7 @@ inEndpoint.direction = "in"; inEndpoint.transferType = 1; inEndpoint.timeout = 1; inEndpoint.descriptor = endpointDesc; -const xferInEndpoint: usb.InEndpoint = inEndpoint.transfer(1, (error: string, data: Buffer) => { return inEndpoint; }); +const xferInEndpoint: usb.InEndpoint = inEndpoint.transfer(1, (error: string, data: Buffer) => inEndpoint); inEndpoint.startPoll(1, 1); inEndpoint.stopPoll(() => null); @@ -95,7 +95,7 @@ outEndpoint.transferWithZLP(new Buffer([]), (error: string) => null); const findByDevice: usb.Device = usb.findByIds(1, 1); usb.on("hey", (device: usb.Device) => null); -const deviceList: Array = usb.getDeviceList(); +const deviceList: usb.Device[] = usb.getDeviceList(); usb.setDebugLevel(1); const CHECK_LIBUSB_CLASS_PER_INTERFACE: number = usb.LIBUSB_CLASS_PER_INTERFACE; diff --git a/vis/vis-tests.ts b/vis/vis-tests.ts index 804e69d96e..a5c755da84 100644 --- a/vis/vis-tests.ts +++ b/vis/vis-tests.ts @@ -55,7 +55,7 @@ console.log('item1', item1); // retrieve a filtered subset of the data var items = data.get({ filter: function (item) { - return item.group == 1; + return item.group === 1; } }); console.log('filtered items', items); @@ -133,7 +133,7 @@ var dataset = new vis.DataSet(); // retrieve all items having a property group with value 2 var group2 = dataset.get({ filter: function (item) { - return (item.group == 2); + return (item.group === 2); } }); @@ -166,7 +166,7 @@ var edges = new vis.DataSet([ ]); // create a network -var container = document.getElementById('mynetwork'); +var container = document.getElementById('mynetwork'); // provide the data in the vis format var data2 = { @@ -190,6 +190,6 @@ var options2 = { container: container, showButton: true } -} +}; network.setOptions(options2); \ No newline at end of file diff --git a/vkbeautify/vkbeautify-tests.ts b/vkbeautify/vkbeautify-tests.ts index bc91ffad01..0698927e0c 100644 --- a/vkbeautify/vkbeautify-tests.ts +++ b/vkbeautify/vkbeautify-tests.ts @@ -2,12 +2,12 @@ import VKBeautify from 'vkbeautify'; /* * Beautifying - * + * * vkbeautify.xml(text [,indent_pattern]); * vkbeautify.json(text [,indent_pattern]); * vkbeautify.css(text [,indent_pattern]); * vkbeautify.sql(text [,indent_pattern]); - * + * * @text - String; text to beatufy; * @indent_pattern - Integer | String; * Integer: number of white spaces; @@ -71,12 +71,12 @@ function sqlWithStringPattern() { /* * Minifying - * + * * vkbeautify.xmlmin(text [,preserve_comments]); * vkbeautify.jsonmin(text); * vkbeautify.cssmin(text [,preserve_comments]); * vkbeautify.sqlmin(text); - * + * * @text - String; text to minify; * @preserve_comments - Bool; [optional]; * Set this flag to true to prevent removing comments from @text ( minxml and mincss functions only. ) diff --git a/voca/voca-tests.ts b/voca/voca-tests.ts index 3fb9d100c3..5c6f1f4bc9 100644 --- a/voca/voca-tests.ts +++ b/voca/voca-tests.ts @@ -1,7 +1,7 @@ import v = require('voca'); var str: string; -var num: number +var num: number; var bool: boolean; var strAry: string[]; var numAry: number[]; @@ -128,7 +128,7 @@ str = v.chain('<p>wonderful world</p>').unescapeHtml().value(); str = v.sprintf(); str = v.sprintf('%s, %s!', 'Hello', 'World'); str = v.sprintf('%s costs $%d', 'coffee', 2); -str = v.sprintf('%1$s %2$s %1$s %2$s, watcha gonna %3$s', 'bad', 'boys', 'do') +str = v.sprintf('%1$s %2$s %1$s %2$s, watcha gonna %3$s', 'bad', 'boys', 'do'); str = v.sprintf('% 6s', 'bird'); str = v.sprintf('%d %i %+d', 15, -2, 25); str = v.sprintf("%06d", 15); @@ -137,7 +137,7 @@ str = v('%s, %s!').sprintf('Hello', 'World').value(); str = v.chain('%s, %s!').sprintf('Hello', 'World').value(); str = v.vprintf(); -str = v.vprintf('%s', ['Welcome']) +str = v.vprintf('%s', ['Welcome']); str = v.vprintf('%s has %d apples', ['Alexandra', 3]); str = v('%s').vprintf(['Welcome']).value(); str = v.chain('%s').vprintf(['Welcome']).value(); @@ -328,4 +328,4 @@ str = v.stripTags('Sun
set', '', '-'); // Util var voca: v.VocaStatic = v.noConflict(); -var version: String = v.version; +var version: string = v.version; diff --git a/watchpack/watchpack-tests.ts b/watchpack/watchpack-tests.ts index 77b78d8c23..7ae28bc514 100644 --- a/watchpack/watchpack-tests.ts +++ b/watchpack/watchpack-tests.ts @@ -3,5 +3,5 @@ const watch = new Watchpack({}); watch.watch(['test.js'], ['lib/'], 1000); -let time: number -time = watch.getTimes()['test.js'] +let time: number; +time = watch.getTimes()['test.js']; diff --git a/webpack/webpack-tests.ts b/webpack/webpack-tests.ts index ffa69e90f2..ac72e9415c 100644 --- a/webpack/webpack-tests.ts +++ b/webpack/webpack-tests.ts @@ -328,9 +328,9 @@ plugin = new CommonsChunkPlugin({ plugin = new webpack.optimize.AggressiveMergingPlugin(options); plugin = new webpack.DefinePlugin(definitions); plugin = new webpack.DefinePlugin({ - VERSION: JSON.stringify("5fa3b9"), - BROWSER_SUPPORTS_HTML5: true, - TWO: "1+1", + "VERSION": JSON.stringify("5fa3b9"), + "BROWSER_SUPPORTS_HTML5": true, + "TWO": "1+1", "typeof window": JSON.stringify("object") }); plugin = new webpack.ProvidePlugin(definitions); @@ -550,7 +550,7 @@ function loader(this: webpack.loader.LoaderContext, source: string, sourcemap: s this.callback(null, source); } -module loader { +namespace loader { export const raw: boolean = true; export const pitch = (remainingRequest: string, precedingRequest: string, data: any) => {}; } diff --git a/xml/index.d.ts b/xml/index.d.ts index 8c5d5179ca..357c3f5b16 100644 --- a/xml/index.d.ts +++ b/xml/index.d.ts @@ -6,16 +6,16 @@ /// interface Option { - /** - * String used for tab, defaults to no tabs (compressed) + /** + * String used for tab, defaults to no tabs (compressed) */ indent?: string; /** - * Return the result as a `stream` (default false) + * Return the result as a `stream` (default false) */ stream?: boolean; /** - * Add default xml declaration (default false) + * Add default xml declaration (default false) */ declaration?: boolean | { encoding?: string; diff --git a/xml/xml-tests.ts b/xml/xml-tests.ts index df8acf6ef9..c77fc5a064 100644 --- a/xml/xml-tests.ts +++ b/xml/xml-tests.ts @@ -132,7 +132,7 @@ test('streams end properly', t => { elem.push({ toy: 'Transformers' }); elem.push({ toy: 'GI Joe' }); - elem.push({ toy: [{name:'He-man'}] }); + elem.push({ toy: [{name: 'He-man'}] }); elem.close(); xmlStream.on('data', (data: any) => { diff --git a/xml2json/xml2json-tests.ts b/xml2json/xml2json-tests.ts index ede4486f2c..409fc5f27e 100644 --- a/xml2json/xml2json-tests.ts +++ b/xml2json/xml2json-tests.ts @@ -1,15 +1,15 @@ -import * as parser from 'xml2json' +import * as parser from 'xml2json'; var xml = "bar"; -// xml to json +// xml to json var jsonString: string = parser.toJson(xml); -// json to xml +// json to xml var xml: string = parser.toXml(jsonString); // xml to json in object mode and JsonOptions -var jsonObject: Object = parser.toJson(xml, { +var jsonObject: {} = parser.toJson(xml, { object: true, reversible: false, coerce: false, diff --git a/yeoman-generator/yeoman-generator-tests.ts b/yeoman-generator/yeoman-generator-tests.ts index fb3be4ce05..11fdd2d989 100644 --- a/yeoman-generator/yeoman-generator-tests.ts +++ b/yeoman-generator/yeoman-generator-tests.ts @@ -8,13 +8,13 @@ const MyGenerator = Base.extend({ writing: function(this: Base): void { this.fs.write('var foo = 1;', this.destinationPath('index.js')); } -}) +}); const generator = new MyES2015Generator(['arg1', 'arg2'], { opt1: 'foo', opt2: 3, opt3: false }); const eventEmitter: EventEmitter = generator; -const env: Object = generator.env; -const args: Object = generator.args; +const env: {} = generator.env; +const args: {} = generator.args; const resolved: string = generator.resolved; const description: string = generator.description; const appname: string = generator.appname;