Skip to content

Instantly share code, notes, and snippets.

@myitcv
Created October 17, 2015 16:35
Show Gist options
  • Select an option

  • Save myitcv/0f83f6ce02d184f26f69 to your computer and use it in GitHub Desktop.

Select an option

Save myitcv/0f83f6ce02d184f26f69 to your computer and use it in GitHub Desktop.
diff --git a/test/files/rules/align.test.ts b/test/files/rules/align.test.ts
index 220e6d9..acb8978 100644
--- a/test/files/rules/align.test.ts
+++ b/test/files/rules/align.test.ts
@@ -16,15 +16,13 @@ function invalidParametersAlignment3(a: number,
class C1 {
invalidParametersAlignment(a: number,
- b: number)
- {
+ b: number) {
}
}
class InvalidAlignmentInConstructor {
constructor(a: number,
- str: string)
- {
+ str: string) {
}
}
@@ -59,14 +57,12 @@ var validParametersAlignment6 = function(xxx: foo,
///////
-function invalidArgumentsAlignment1()
-{
+function invalidArgumentsAlignment1() {
f(10,
'abcd', 0);
}
-function invalidArgumentsAlignment2()
-{
+function invalidArgumentsAlignment2() {
f(10,
'abcd',
0);
@@ -74,29 +70,25 @@ function invalidArgumentsAlignment2()
class Foo {
constructor(a: number,
- str: string)
- {
+ str: string) {
}
}
var invalidConstructorArgsAlignment = new foo(10,
"abcd");
-function validArgumentsAlignment1()
-{
+function validArgumentsAlignment1() {
f(101, 'xyz', 'abc');
}
-function validArgumentsAlignment2()
-{
+function validArgumentsAlignment2() {
f(1,
2,
3,
4);
}
-function validArgumentsAlignment3()
-{
+function validArgumentsAlignment3() {
f(
1,
2,
@@ -104,23 +96,20 @@ function validArgumentsAlignment3()
4);
}
-function validArgumentsAlignment3()
-{
+function validArgumentsAlignment3() {
f(1, 2,
3, 4);
}
////////
-function invalidStatementsAlignment1()
-{
+function invalidStatementsAlignment1() {
var i = 0;
var j = 0;
var k = 1;
}
-function invalidStatementsAlignment1()
-{
+function invalidStatementsAlignment1() {
var i = 0;
{
var j = 0;
@@ -128,15 +117,13 @@ function invalidStatementsAlignment1()
}
}
-function validStatementsAlignment1()
-{
+function validStatementsAlignment1() {
var i = 0;
var j = 0;
var k = 1;
}
-function validStatementsAlignment2()
-{
+function validStatementsAlignment2() {
var i = 0;
{
var j = 0;
diff --git a/test/files/rules/curly.test.ts b/test/files/rules/curly.test.ts
index 472f60d..bb42a72 100644
--- a/test/files/rules/curly.test.ts
+++ b/test/files/rules/curly.test.ts
@@ -2,8 +2,7 @@ if (x == 3) {
console.log("x");
}
-if (y == 4)
-{
+if (y == 4) {
console.log("y");
}
@@ -14,8 +13,7 @@ for (i = 0; i < 1; ++i) {
console.log("i");
}
-for (j = 0; j < 1; ++j)
-{
+for (j = 0; j < 1; ++j) {
console.log("j");
}
@@ -29,8 +27,7 @@ while (m < 0) {
console.log("q");
}
-while (n < 0)
-{
+while (n < 0) {
console.log("r");
}
@@ -41,8 +38,7 @@ do {
console.log("m");
} while (i == 1);
-do
-{
+do {
console.log("n");
}
while (j == 1);
diff --git a/test/files/rules/nointernalmodule.test.ts b/test/files/rules/nointernalmodule.test.ts
index 02841ff..e120180 100644
--- a/test/files/rules/nointernalmodule.test.ts
+++ b/test/files/rules/nointernalmodule.test.ts
@@ -47,6 +47,5 @@ declare module dec . declare {
}
module mod.module { }
-module module.mod
-{
+module module.mod {
}
diff --git a/test/files/rules/oneline.test.ts b/test/files/rules/oneline.test.ts
index 8272fee..c20535f 100644
--- a/test/files/rules/oneline.test.ts
+++ b/test/files/rules/oneline.test.ts
@@ -1,17 +1,13 @@
-module Module
-{
- export enum Enumeration
- {
+module Module {
+ export enum Enumeration {
A,
B,
C,
D
}
- export function Call()
- {
- if (x == 3)
- {
+ export function Call() {
+ if (x == 3) {
x = 4;
}
else {
@@ -21,8 +17,7 @@ module Module
}
}
-interface Class
-{
+interface Class {
variable: string;
}
@@ -32,13 +27,11 @@ var object =
b: 2
};
-for(var x= 0; x < 1; ++x)
-{
+for (var x = 0; x < 1; ++x) {
++i;
}
-switch(y)
-{
+switch (y) {
case 0:
x--;
break;
@@ -47,12 +40,10 @@ switch(y)
break;
}
-try
-{
+try {
throw new Error("hi");
}
-catch (e)
-{
+catch (e) {
throw (e);
}
@@ -66,8 +57,7 @@ function f():
return 5;
}
-class BarBooBaz
-{
+class BarBooBaz {
}
diff --git a/test/ruleDisableEnableTests.ts b/test/ruleDisableEnableTests.ts
index c377139..2e6c92e 100644
--- a/test/ruleDisableEnableTests.ts
+++ b/test/ruleDisableEnableTests.ts
@@ -20,10 +20,12 @@ describe("Enable and Disable Rules", () => {
const {join} = require("path");
it("is enabled and disabled in all the right places", () => {
- const validConfiguration = {rules: {
+ const validConfiguration = {
+ rules: {
"variable-name": true,
"quotemark": [true, "double"]
- }};
+ }
+ };
const relativePath = join("test", "files", "enabledisable.test.ts");
const source = readFileSync(relativePath, "utf8");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment