Updates to config and files to pass TSLint

This commit is contained in:
Roel van Uden 2015-02-07 12:51:11 +01:00
parent b836436c11
commit 25a077b495
10 changed files with 42 additions and 30 deletions

View File

@ -63,9 +63,6 @@
<Folder Include="typings\request\" /> <Folder Include="typings\request\" />
<Folder Include="typings\xml2js\" /> <Folder Include="typings\xml2js\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Compile Include="ts.js" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="False" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="False" />
<Import Project="$(VSToolsPath)\Node.js Tools\Microsoft.NodejsTools.targets" /> <Import Project="$(VSToolsPath)\Node.js Tools\Microsoft.NodejsTools.targets" />

View File

@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntellisenseGloballyEnabled/IntellisenseEnabled/@EntryValue">Disabled</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=DeclarationHides/@EntryIndexedValue">DO_NOT_SHOW</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=DeclarationHides/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InconsistentNaming/@EntryIndexedValue">DO_NOT_SHOW</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InconsistentNaming/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NotAllPathsReturnValue/@EntryIndexedValue">DO_NOT_SHOW</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NotAllPathsReturnValue/@EntryIndexedValue">DO_NOT_SHOW</s:String>
@ -46,6 +47,13 @@
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String> <s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FMETHOD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String> <s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FMETHOD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FTYPE_005FPARAMETER/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /&gt;</s:String> <s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FTYPE_005FPARAMETER/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FHTML_005FCONTROL/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FTAG_005FNAME/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FTAG_005FPREFIX/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=NAMESPACE_005FALIAS/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FRESOURCE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/CodeStyle/TypeScriptCodeStyle/ExplicitPublicModifier/@EntryValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeStyle/TypeScriptCodeStyle/ExplicitPublicModifier/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/TypeScriptCodeStyle/FileReferenceStyle/@EntryValue">RelativeDotSlash</s:String> <s:String x:Key="/Default/CodeStyle/TypeScriptCodeStyle/FileReferenceStyle/@EntryValue">RelativeDotSlash</s:String>
<s:Boolean x:Key="/Default/CodeStyle/TypeScriptCodeStyle/NoImplicitAny/@EntryValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeStyle/TypeScriptCodeStyle/NoImplicitAny/@EntryValue">True</s:Boolean>

View File

@ -7,7 +7,10 @@
"crunchyroll" "crunchyroll"
], ],
"name": "crunchyroll", "name": "crunchyroll",
"repository": "git://github.com/Deathspike/crunchyroll.js.git", "repository": {
"type": "git",
"url": "git://github.com/Deathspike/crunchyroll.js.git"
},
"version": "1.1.0", "version": "1.1.0",
"bin": { "bin": {
"crunchyroll": "./bin/crunchyroll" "crunchyroll": "./bin/crunchyroll"

View File

@ -79,7 +79,11 @@ function downloadSubtitle(config: typings.IConfig, player: typings.IEpisodePlaye
/** /**
* Streams the video to disk. * Streams the video to disk.
*/ */
function downloadVideo(config: typings.IConfig, page: typings.IEpisodePage, player: typings.IEpisodePlayer, filePath: string, done: (err: Error) => void) { function downloadVideo(config: typings.IConfig,
page: typings.IEpisodePage,
player: typings.IEpisodePlayer,
filePath: string,
done: (err: Error) => void) {
video.stream( video.stream(
player.video.host, player.video.host,
player.video.file, player.video.file,

View File

@ -17,8 +17,8 @@ export function get(config: typings.IConfig, options: request.Options, done: (er
} }
/** /**
* Performs a POST request for the resource. * Performs a POST request for the resource.
*/ */
export function post(config: typings.IConfig, options: request.Options, done: (err: Error, result?: string) => void) { export function post(config: typings.IConfig, options: request.Options, done: (err: Error, result?: string) => void) {
authenticate(config, err => { authenticate(config, err => {
if (err) return done(err); if (err) return done(err);

View File

@ -38,7 +38,11 @@ function main(config: typings.IConfig, address: string, done: (err: Error) => vo
/** /**
* Downloads the episode. * Downloads the episode.
*/ */
function download(cache: {[address: string]: number}, config: typings.IConfig, baseAddress: string, item: typings.ISeriesEpisode, done: (err: Error) => void) { function download(cache: {[address: string]: number},
config: typings.IConfig,
baseAddress: string,
item: typings.ISeriesEpisode,
done: (err: Error) => void) {
if (!filter(config, item)) return done(null); if (!filter(config, item)) return done(null);
var address = url.resolve(baseAddress, item.address); var address = url.resolve(baseAddress, item.address);
if (cache[address]) return done(null); if (cache[address]) return done(null);

View File

@ -1,7 +1,7 @@
/* tslint:disable:no-bitwise false */
'use strict'; 'use strict';
export = main; export = main;
import crypto = require('crypto'); import crypto = require('crypto');
import bigInt = require('big-integer');
import zlib = require('zlib'); import zlib = require('zlib');
/** /**

View File

@ -17,14 +17,14 @@ function main(config: typings.IConfig, rtmpInputPath: string, filePath: string,
'-o "' + filePath + '.mkv" ' + '-o "' + filePath + '.mkv" ' +
'"' + videoPath + '" ' + '"' + videoPath + '" ' +
'"' + subtitlePath + '"', { '"' + subtitlePath + '"', {
maxBuffer: Infinity maxBuffer: Infinity
}, err => { }, err => {
if (err) return done(err); if (err) return done(err);
unlink(videoPath, subtitlePath, err => { unlink(videoPath, subtitlePath, err => {
if (err) unlinkTimeout(videoPath, subtitlePath, 5000); if (err) unlinkTimeout(videoPath, subtitlePath, 5000);
done(null); done(null);
});
}); });
});
} }
/** /**

5
ts.js
View File

@ -48,7 +48,10 @@ function clean(filePaths, done) {
function compile(filePaths, done) { function compile(filePaths, done) {
var execPath = path.join(__dirname, 'node_modules/.bin/tsc'); var execPath = path.join(__dirname, 'node_modules/.bin/tsc');
var options = '--declaration --module CommonJS --noImplicitAny --outDir dist'; var options = '--declaration --module CommonJS --noImplicitAny --outDir dist';
childProcess.exec([execPath, options].concat(filePaths).join(' '), done); childProcess.exec([execPath, options].concat(filePaths).join(' '), function(err, stdout) {
if (stdout) return done(new Error(stdout));
done(null);
});
} }
/** /**

View File

@ -3,11 +3,10 @@
"ban": false, "ban": false,
"class-name": true, "class-name": true,
"comment-format": [true, "comment-format": [true,
"check-space", "check-space"
"check-lowercase"
], ],
"curly": false, "curly": false,
"eofline": true, "eofline": false,
"forin": true, "forin": true,
"indent": [true, 2], "indent": [true, 2],
"interface-name": true, "interface-name": true,
@ -44,7 +43,7 @@
"no-unused-expression": true, "no-unused-expression": true,
"no-unused-variable": true, "no-unused-variable": true,
"no-unreachable": true, "no-unreachable": true,
"no-use-before-declare": true, "no-use-before-declare": false,
"no-var-requires": true, "no-var-requires": true,
"one-line": [true, "one-line": [true,
"check-catch", "check-catch",
@ -57,11 +56,8 @@
"semicolon": true, "semicolon": true,
"triple-equals": [true, "allow-null-check"], "triple-equals": [true, "allow-null-check"],
"typedef": [true, "typedef": [true,
"call-signature",
"member-variable-declaration", "member-variable-declaration",
"parameter", "property-declaration"
"property-declaration",
"variable-declaration"
], ],
"typedef-whitespace": [true, { "typedef-whitespace": [true, {
"call-signature": "nospace", "call-signature": "nospace",
@ -70,10 +66,7 @@
"property-declaration": "nospace", "property-declaration": "nospace",
"variable-declaration": "nospace" "variable-declaration": "nospace"
}], }],
"use-strict": [true, "use-strict": false,
"check-module",
"check-function"
],
"variable-name": false, "variable-name": false,
"whitespace": [true, "whitespace": [true,
"check-branch", "check-branch",