Repository: nzakas/eslint-plugin-typescript
Pull request #34 (2017-08-06 17:06:15)

no-use-before-define
This adds the `no-use-before-define` rule from core ESLint, with a new `typedefs` option to ignore errors coming from `type` declarations.

weirdpattern: Hi @j-f1, there are no tests in your PR. 
Do you mind adding a couple, including, but not limited to, the new typedefs option.
j-f1: @weirdpattern How does that look?
corbinu: LGTM

Patch:
diff --git a/README.md b/README.md
index e9b96ea..05b1b71 100644
--- a/README.md
+++ b/README.md
@@ -56,5 +56,7 @@ Then configure the rules you want to use under the rules section.
 * `typescript/no-explicit-any` - enforces the any type is not used.
 * `typescript/no-angle-bracket-type-assertion` - enforces the use of `as Type` assertions instead of `<Type>` assertions.
 * `typescript/no-namespace` - disallows the use of custom TypeScript modules and namespaces.
+* `typescript/no-use-before-define` - disallows the use of variables before they are defined
 * `typescript/prefer-namespace-keyword` - enforces the use of the keyword `namespace` over `module` to declare custom TypeScript modules.
 * `typescript/no-type-literal` - disallows the use of type aliases.
+* `typescript/member-ordering` - enforces a standard member declaration order.
diff --git a/docs/rules/member-ordering.md b/docs/rules/member-ordering.md
new file mode 100644
index 0000000..296ed58
--- /dev/null
+++ b/docs/rules/member-ordering.md
@@ -0,0 +1,584 @@
+# Enforces a standard member declaration order.
+
+A consistent ordering of fields, methods and constructors can make interfaces, type literals, classes and class 
+expressions easier to read, navigate and edit.
+
+## Rule Details
+
+This rule aims to standardise the way interfaces, type literals, classes and class expressions are structured.
+
+## Options
+
+This rule, in its default state, does not require any argument, in which case the following order is enforced:          
+- `public-static-field`
+- `protected-static-field`
+- `private-static-field`
+- `public-instance-field`
+- `protected-instance-field`
+- `private-instance-field`
+- `public-field` (ignores scope)
+- `protected-field` (ignores scope)
+- `private-field` (ignores scope)
+- `static-field` (ignores accessibility)
+- `instance-field` (ignores accessibility)
+- `field` (ignores scope and/or accessibility)
+- `constructor` (ignores scope and/or accessibility)
+- `public-static-method`
+- `protected-static-method`
+- `private-static-method`
+- `public-instance-method`
+- `protected-instance-method`
+- `private-instance-method`
+- `public-method` (ignores scope)
+- `protected-method` (ignores scope)
+- `private-method` (ignores scope)
+- `static-method` (ignores accessibility)
+- `instance-method` (ignores accessibility)
+- `method` (ignores scope and/or accessibility)
+
+The rule can also take one or more of the following options:
+- `default`, use this to change the default order (used when no specific configuration has been provided). 
+- `classes`, use this to change the order in classes.
+- `classExpressions`, use this to change the order in class expressions.
+- `interfaces`, use this to change the order in interfaces.
+- `typeLiterals`, use this to change the order in type literals.
+
+### default
+Disable using `never` or use one of the following values to specify an order:   
+- Fields:   
+`public-static-field`   
+`protected-static-field`   
+`private-static-field`   
+`public-instance-field`   
+`protected-instance-field`   
+`private-instance-field`   
+`public-field` (= public-*-field)    
+`protected-field` (= protected-*-field)      
+`private-field` (= private-*-field)   
+`static-field`  (= *-static-field)    
+`instance-field` (= *-instance-field)       
+`field` (= all)   
+
+- Constructors:  
+`public-constructor`  
+`protected-constructor`  
+`private-constructor`  
+`constructor` (= *-constructor)   
+
+- Methods:
+`public-static-method`   
+`protected-static-method`   
+`private-static-method`   
+`public-instance-method`   
+`protected-instance-method`   
+`private-instance-method`   
+`public-method` (= public-*-method)     
+`protected-method` (= protected-*-method)     
+`private-method` (= private-*-method)   
+`static-method` (= *-static-method)  
+`instance-method` (= *-instance-method)    
+`method` (= all)  
+
+Examples of **incorrect** code for the `{ "default": [...] }` option:
+```ts
+// { "default": ["method", "constructor", "field"] }
+
+interface Foo {
+    // -> field
+    B: string;
+    
+    // -> constructor
+    new();
+    
+    // -> method
+    A() : void;
+}
+
+type Foo = {
+    // -> field
+    B: string;
+    
+    // no constructor
+    
+    // -> method
+    A() : void;
+}
+
+class Foo {
+    // -> * field
+    private C: string
+    public D: string
+    protected static E: string
+    
+    // -> constructor
+    constructor() {}
+    
+    // -> * method
+    public static A(): void {}
+    public B(): void {}        
+}
+
+const Foo = class {
+    // -> * field
+    private C: string
+    public D: string
+    
+    // -> constructor
+    constructor() {}
+    
+    // -> * method
+    public static A(): void {}
+    public B(): void {}
+    
+    // * field
+    protected static E: string
+}
+
+// { "default": ["public-instance-method", "public-static-field"] }
+
+// does not apply for interfaces/type literals (accessibility and scope are not part of interfaces/type literals)
+
+class Foo {
+    // private instance field
+    private C: string
+    
+    // public instance field
+    public D: string
+    
+    // -> public static field
+    public static E: string
+    
+    // constructor
+    constructor() {}
+    
+    // public static method
+    public static A(): void {}
+    
+    // -> public instance method
+    public B(): void {}            
+}
+
+const Foo = class {
+    // private instance field
+    private C: string
+    
+    // -> public static field
+    public static E: string
+        
+    // public instance field    
+    public D: string
+    
+    // constructor
+    constructor() {}
+    
+    // public static method
+    public static A(): void {}
+    
+    // -> public instance method
+    public B(): void {}    
+}
+```
+
+Examples of **correct** code for the `{ "default": [...] }` option:
+```ts
+// { "default": ["method", "constructor", "field"] }
+
+interface Foo {
+    // -> method
+    A() : void;
+    
+    // -> constructor
+    new();
+    
+    // -> field
+    B: string;
+}
+
+type Foo = {
+    // -> method
+    A() : void;
+    
+    // -> field
+    B: string;
+}
+
+class Foo {
+    // -> * method
+    public static A(): void {}
+    public B(): void {}
+    
+    // -> constructor
+    constructor() {}
+    
+    // -> * field
+    private C: string
+    public D: string
+    protected static E: string                
+}
+
+const Foo = class {
+    // -> * method
+    public static A(): void {}
+    public B(): void {}
+    
+    // -> constructor
+    constructor() {}
+    
+    // -> * field
+    private C: string
+    public D: string
+    protected static E: string
+}
+
+// { "default": ["public-instance-method", "public-static-field"] }
+
+// does not apply for interfaces/type literals (accessibility and scope are not part of interfaces/type literals)
+
+class Foo {
+    // -> public instance method
+    public B(): void {}
+     
+    // private instance field
+    private C: string
+    
+    // public instance field
+    public D: string
+    
+    // -> public static field
+    public static E: string
+     
+    // constructor
+    constructor() {}
+    
+    // public static method
+    public static A(): void {}                
+}
+
+const Foo = class {
+    // -> public instance method
+    public B(): void {}
+    
+    // private instance field
+    private C: string
+    
+    // public instance field
+    public D: string
+    
+    // constructor
+    constructor() {}
+    
+    // public static method
+    public static A(): void {}
+    
+    // -> protected static field
+    protected static: string
+}
+
+// { "default": ["public-static-field", "static-field", "instance-field"] }
+
+// does not apply for interfaces/type literals (accessibility and scope are not part of interfaces/type literals)
+
+class Foo {
+    // -> public static field
+    public static A: string; 
+                   
+    // -> * static field
+    private static B: string;
+    protected statis C:string;
+    private static D: string;
+    
+    // -> * instance field
+    private E: string;
+}
+
+const foo = class {
+    // * method
+    public T(): void {}
+    
+    // -> public static field
+    public static A: string; 
+
+    // constructor
+    constructor(){}
+                   
+    // -> * static field
+    private static B: string;
+    protected statis C:string;
+    private static D: string;
+    
+    // -> * instance field
+    private E: string;
+}
+```
+
+### classes
+Disable using `never` or use one of the valid values (see default) to specify an order.  
+
+Examples of **incorrect** code for the `{ "classes": [...] }` option:
+```ts
+// { "classes": ["method", "constructor", "field"] }
+
+// does not apply for interfaces/type literals/class expressions.
+
+class Foo {
+    // -> field
+    private C: string
+    public D: string
+    protected static E: string
+    
+    // -> constructor
+    constructor() {}
+    
+    // -> method
+    public static A(): void {}
+    public B(): void {}        
+}
+
+// { "classes": ["public-instance-method", "public-static-field"] }
+
+// does not apply for interfaces/type literals/class expressions.
+
+class Foo {
+    // private instance field
+    private C: string
+    
+    // public instance field
+    public D: string
+    
+    // -> public static field
+    public static E: string
+    
+    // constructor
+    constructor() {}
+    
+    // public static method
+    public static A(): void {}
+    
+    // -> public instance method
+    public B(): void {}            
+}
+```
+
+Examples of **correct** code for `{ "classes": [...] }` option:
+```ts
+// { "classes": ["method", "constructor", "field"] }
+
+// does not apply for interfaces/type literals/class expressions.
+
+class Foo {
+    // -> * method
+    public static A(): void {}
+    public B(): void {}
+    
+    // -> constructor
+    constructor() {}
+    
+    // -> * field
+    private C: string
+    public D: string
+    protected static E: string                
+}
+
+// { "classes": ["public-instance-method", "public-static-field"] }
+
+// does not apply for interfaces/type literals/class expressions.
+
+class Foo {
+    // private instance field
+    private C: string
+    
+    // public instance field
+    public D: string
+    
+    // -> public static field
+    public static E: string
+    
+    // constructor
+    constructor() {}
+    
+    // public static method
+    public static A(): void {}
+    
+    // -> public instance method
+    public B(): void {}            
+}
+```
+
+### classExpressions
+Disable using `never` or use one of the valid values (see default) to specify an order.   
+
+Examples of **incorrect** code for the `{ "classExpressions": [...] }` option:
+```ts
+// { "classExpressions": ["method", "constructor", "field"] }
+
+// does not apply for interfaces/type literals/class expressions.
+
+const foo = class {
+    // -> field
+    private C: string
+    public D: string
+    protected static E: string
+    
+    // -> constructor
+    constructor() {}
+    
+    // -> method
+    public static A(): void {}
+    public B(): void {}        
+}
+
+// { "classExpressions": ["public-instance-method", "public-static-field"] }
+
+// does not apply for interfaces/type literals/class expressions.
+
+const foo = class {
+    // private instance field
+    private C: string
+    
+    // public instance field
+    public D: string
+    
+    // -> public static field
+    public static E: string
+    
+    // constructor
+    constructor() {}
+    
+    // public static method
+    public static A(): void {}
+    
+    // -> public instance method
+    public B(): void {}            
+}
+```
+
+Examples of **correct** code for `{ "classExpressions": [...] }` option:
+```ts
+// { "classExpressions": ["method", "constructor", "field"] }
+
+// does not apply for interfaces/type literals/class expressions.
+
+const foo = class {
+    // -> * method
+    public static A(): void {}
+    public B(): void {}
+    
+    // -> constructor
+    constructor() {}
+    
+    // -> * field
+    private C: string
+    public D: string
+    protected static E: string                
+}
+
+// { "classExpressions": ["public-instance-method", "public-static-field"] }
+
+// does not apply for interfaces/type literals/class expressions.
+
+const foo = class {
+    // private instance field
+    private C: string
+    
+    // public instance field
+    public D: string
+    
+    // -> public static field
+    public static E: string
+    
+    // constructor
+    constructor() {}
+    
+    // public static method
+    public static A(): void {}
+    
+    // -> public instance method
+    public B(): void {}            
+}
+```
+
+### interfaces
+Disable using `never` or use one of the following values to specify an order:   
+`field`   
+`constructor`     
+`method`   
+
+Examples of **incorrect** code for the `{ "interfaces": [...] }` option:
+```ts
+// { "interfaces": ["method", "constructor", "field"] }
+
+// does not apply for classes/class expressions/type literals
+
+interface Foo {
+    // -> field
+    B: string;
+    
+    // -> constructor
+    new();
+    
+    // -> method
+    A() : void;
+}
+```
+
+Examples of **correct** code for the `{ "interfaces": [...] }` option:
+```ts
+// { "interfaces": ["method", "constructor", "field"] }
+ 
+// does not apply for classes/class expressions/type literals
+ 
+interface Foo {
+    // -> method
+    A() : void;
+         
+    // -> constructor
+    new();     
+    
+    // -> field
+    B: string;
+}
+```
+
+### typeLiterals
+Disable using `never` or use one of the valid values (see interfaces) to specify an order.  
+   
+Examples of **incorrect** code for the `{ "typeLiterals": [...] }` option:
+```ts
+// { "typeLiterals": ["method", "constructor", "field"] }
+
+// does not apply for classes/class expressions/interfaces
+
+type Foo = {
+    // -> field
+    B: string;
+    
+    // -> method
+    A() : void;
+}
+```
+
+Examples of **correct** code for the `{ "typeLiterals": [...] }` option:
+```ts
+// { "typeLiterals": ["method", "constructor", "field"] }
+ 
+// does not apply for classes/class expressions/interfaces
+ 
+type Foo = {
+    // -> method
+    A() : void;
+         
+    // -> constructor
+    new();     
+    
+    // -> field
+    B: string;
+}
+```
+
+## When Not To Use It
+
+If you don't care about the general structure of your classes and interfaces, then you will not need this rule.
+
+## Compatibility
+
+* TSLint: [member-ordering](https://palantir.github.io/tslint/rules/member-ordering/)
\ No newline at end of file
diff --git a/docs/rules/no-use-before-define.md b/docs/rules/no-use-before-define.md
new file mode 100644
index 0000000..debb173
--- /dev/null
+++ b/docs/rules/no-use-before-define.md
@@ -0,0 +1,174 @@
+# Disallow Early Use (no-use-before-define)
+
+In JavaScript, prior to ES6, variable and function declarations are hoisted to the top of a scope, so it's possible to use identifiers before their formal declarations in code. This can be confusing and some believe it is best to always declare variables and functions before using them.
+
+In ES6, block-level bindings (`let` and `const`) introduce a "temporal dead zone" where a `ReferenceError` will be thrown with any attempt to access the variable before its declaration.
+
+## Rule Details
+
+This rule will warn when it encounters a reference to an identifier that has not yet been declared.
+
+Examples of **incorrect** code for this rule:
+
+```ts
+/*eslint no-use-before-define: "error"*/
+/*eslint-env es6*/
+
+alert(a);
+var a = 10;
+
+f();
+function f() {}
+
+function g() {
+    return b;
+}
+var b = 1;
+
+// With blockBindings: true
+{
+    alert(c);
+    let c = 1;
+}
+
+let myVar: StringOrNumber;
+type StringOrNumber = string | number;
+```
+
+Examples of **correct** code for this rule:
+
+```ts
+/*eslint no-use-before-define: "error"*/
+/*eslint-env es6*/
+
+var a;
+a = 10;
+alert(a);
+
+function f() {}
+f(1);
+
+var b = 1;
+function g() {
+    return b;
+}
+
+// With blockBindings: true
+{
+    let C;
+    c++;
+}
+
+type StringOrNumber = string | number;
+let myVar: StringOrNumber;
+```
+
+## Options
+
+```json
+{
+    "no-use-before-define": ["error", { "functions": true, "classes": true }]
+}
+```
+
+* `functions` (`boolean`) -
+  The flag which shows whether or not this rule checks function declarations.
+  If this is `true`, this rule warns every reference to a function before the function declaration.
+  Otherwise, ignores those references.
+  Function declarations are hoisted, so it's safe.
+  Default is `true`.
+* `classes` (`boolean`) -
+  The flag which shows whether or not this rule checks class declarations of upper scopes.
+  If this is `true`, this rule warns every reference to a class before the class declaration.
+  Otherwise, ignores those references if the declaration is in upper function scopes.
+  Class declarations are not hoisted, so it might be danger.
+  Default is `true`.
+* `variables` (`boolean`) -
+  This flag determines whether or not the rule checks variable declarations in upper scopes.
+  If this is `true`, the rule warns every reference to a variable before the variable declaration.
+  Otherwise, the rule ignores a reference if the declaration is in an upper scope, while still reporting the reference if it's in the same scope as the declaration.
+  Default is `true`.
+* `typedefs` (`boolean`, **added** in `eslint-plugin-typescript`) -
+  The flag which shows whether or not this rule checks type declarations.
+  If this is `true`, this rule warns every reference to a type before the type declaration.
+  Otherwise, ignores those references.
+  Type declarations are hoisted, so it's safe.
+  Default is `true`.
+
+This rule accepts `"nofunc"` string as an option.
+`"nofunc"` is the same as `{ "functions": false, "classes": true }`.
+
+### functions
+
+Examples of **correct** code for the `{ "functions": false }` option:
+
+```js
+/*eslint no-use-before-define: ["error", { "functions": false }]*/
+
+f();
+function f() {}
+```
+
+### classes
+
+Examples of **incorrect** code for the `{ "classes": false }` option:
+
+```js
+/*eslint no-use-before-define: ["error", { "classes": false }]*/
+/*eslint-env es6*/
+
+new A();
+class A {
+}
+```
+
+Examples of **correct** code for the `{ "classes": false }` option:
+
+```js
+/*eslint no-use-before-define: ["error", { "classes": false }]*/
+/*eslint-env es6*/
+
+function foo() {
+    return new A();
+}
+
+class A {
+}
+```
+
+### variables
+
+Examples of **incorrect** code for the `{ "variables": false }` option:
+
+```js
+/*eslint no-use-before-define: ["error", { "variables": false }]*/
+
+console.log(foo);
+var foo = 1;
+```
+
+Examples of **correct** code for the `{ "variables": false }` option:
+
+```js
+/*eslint no-use-before-define: ["error", { "variables": false }]*/
+
+function baz() {
+    console.log(foo);
+}
+
+var foo = 1;
+```
+
+### typedefs
+
+Examples of **correct** code for the `{ "typedefs": false }` option:
+
+```ts
+/*eslint no-use-before-define: ["error", { "typedefs": false }]*/
+
+let myVar: StringOrNumber;
+type StringOrNumber = string | number;
+```
+
+
+Copied from [the original ESLint rule docs](https://github.com/eslint/eslint/blob/a113cd3/docs/rules/no-use-before-define.md)
diff --git a/lib/rules/member-ordering.js b/lib/rules/member-ordering.js
new file mode 100644
index 0000000..1bacfd8
--- /dev/null
+++ b/lib/rules/member-ordering.js
@@ -0,0 +1,335 @@
+/**
+ * @fileoverview Enforces a standard member declaration order.
+ * @author Patricio Trevino
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+const schemaOptions = ["field", "method", "constructor"].reduce((options, type) => {
+    options.push(type);
+
+    ["public", "protected", "private"].forEach(accessibility => {
+        options.push(`${accessibility}-${type}`);
+        if (type !== "constructor") {
+            ["static", "instance"].forEach(scope => {
+                if (options.indexOf(`${scope}-${type}`) === -1) {
+                    options.push(`${scope}-${type}`);
+                }
+                options.push(`${accessibility}-${scope}-${type}`);
+            });
+        }
+    });
+
+    return options;
+}, []);
+
+module.exports = {
+    meta: {
+        docs: {
+            description: "Enforces a standard member declaration order.",
+            category: "TypeScript"
+        },
+        schema: [
+            {
+                type: "object",
+                properties: {
+                    default: {
+                        oneOf: [
+                            {
+                                enum: ["never"]
+                            },
+                            {
+                                type: "array",
+                                items: {
+                                    enum: schemaOptions
+                                }
+                            }
+                        ]
+                    },
+                    classes: {
+                        oneOf: [
+                            {
+                                enum: ["never"]
+                            },
+                            {
+                                type: "array",
+                                items: {
+                                    enum: schemaOptions
+                                }
+                            }
+                        ]
+                    },
+                    classExpressions: {
+                        oneOf: [
+                            {
+                                enum: ["never"]
+                            },
+                            {
+                                type: "array",
+                                items: {
+                                    enum: schemaOptions
+                                }
+                            }
+                        ]
+                    },
+                    interfaces: {
+                        oneOf: [
+                            {
+                                enum: ["never"]
+                            },
+                            {
+                                type: "array",
+                                items: {
+                                    enum: ["field", "method", "constructor"]
+                                }
+                            }
+                        ]
+                    },
+                    typeLiterals: {
+                        oneOf: [
+                            {
+                                enum: ["never"]
+                            },
+                            {
+                                type: "array",
+                                items: {
+                                    enum: ["field", "method", "constructor"]
+                                }
+                            }
+                        ]
+                    }
+                },
+                additionalProperties: false
+            }
+        ]
+    },
+
+    create(context) {
+
+        const options = context.options[0] || {};
+
+        const defaultOrder = [
+            "public-static-field",
+            "protected-static-field",
+            "private-static-field",
+
+            "public-instance-field",
+            "protected-instance-field",
+            "private-instance-field",
+
+            "public-field",
+            "protected-field",
+            "private-field",
+
+            "static-field",
+            "instance-field",
+
+            "field",
+
+            "constructor",
+
+            "public-static-method",
+            "protected-static-method",
+            "private-static-method",
+
+            "public-instance-method",
+            "protected-instance-method",
+            "private-instance-method",
+
+            "public-method",
+            "protected-method",
+            "private-method",
+
+            "static-method",
+            "instance-method",
+
+            "method"
+        ];
+
+        //----------------------------------------------------------------------
+        // Helpers
+        //----------------------------------------------------------------------
+
+        /**
+         * Gets the node type.
+         * @param {ASTNode} node the node to be evaluated.
+         * @returns {string|null} the type of the node.
+         * @private
+         */
+        function getNodeType(node) {
+            switch (node.type) {
+                case "MethodDefinition":
+                    return node.kind;
+                case "TSMethodSignature":
+                    return "method";
+                case "TSConstructSignature":
+                    return "constructor";
+                case "ClassProperty":
+                case "TSPropertySignature":
+                    return "field";
+                default:
+                    return null;
+            }
+        }
+
+        /**
+         * Gets the member name based on the member type.
+         * @param {ASTNode} node the node to be evaluated.
+         * @returns {string|null} the name of the member.
+         * @private
+         */
+        function getMemberName(node) {
+            switch (node.type) {
+                case "ClassProperty":
+                case "MethodDefinition":
+                    return node.kind === "constructor"
+                        ? "constructor"
+                        : node.key.name;
+                case "TSPropertySignature":
+                case "TSMethodSignature":
+                    return node.key.name;
+                case "TSConstructSignature":
+                    return "new";
+                default:
+                    return null;
+            }
+        }
+
+        /**
+         * Gets the calculated rank using the provided method definition.
+         * The algorithm is as follows:
+         * - Get the rank based on the accessibility-scope-type name, e.g. public-instance-field
+         * - If there is no order for accessibility-scope-type, then strip out the accessibility.
+         * - If there is no order for scope-type, then strip out the scope.
+         * - If there is no order for type, then return -1
+         * @param {Array} names the valid names to be validated.
+         * @param {Array} order the current order to be validated.
+         * @returns {number} the rank of the method definition in the given order.
+         * @private
+         */
+        function getRankOrder(names, order) {
+            let rank = -1;
+            const stack = names.slice();
+
+            while (stack.length > 0 && rank === -1) {
+                rank = order.indexOf(stack.shift());
+            }
+
+            return rank;
+        }
+
+        /**
+         * Gets the rank of the node given the order.
+         * @param {ASTNode} node the node to be evaluated.
+         * @param {Array} order the current order to be validated.
+         * @param {boolean} supportsModifiers a flag indicating whether the type supports modifiers or not.
+         * @returns {number} the rank of the node.
+         * @private
+         */
+        function getRank(node, order, supportsModifiers) {
+            const type = getNodeType(node);
+            const scope = node.static ? "static" : "instance";
+            const accessibility = node.accessibility || "public";
+
+            const names = [];
+
+            if (supportsModifiers) {
+                if (type !== "constructor") {
+                    names.push(`${accessibility}-${scope}-${type}`);
+                    names.push(`${scope}-${type}`);
+                }
+                names.push(`${accessibility}-${type}`);
+            }
+
+            names.push(type);
+
+            return getRankOrder(names, order);
+        }
+
+        /**
+         * Gets the lowest possible rank higher than target.
+         * e.g. given the following order:
+         *   ...
+         *   public-static-method
+         *   protected-static-method
+         *   private-static-method
+         *   public-instance-method
+         *   protected-instance-method
+         *   private-instance-method
+         *   ...
+         * and considering that a public-instance-method has already been declared, so ranks contains
+         * public-instance-method, then the lowest possible rank for public-static-method is
+         * public-instance-method.
+         * @param {Array} ranks the existing ranks in the object.
+         * @param {number} target the target rank.
+         * @param {Array} order the current order to be validated.
+         * @returns {string} the name of the lowest possible rank without dashes (-).
+         * @private
+         */
+        function getLowestRank(ranks, target, order) {
+            let lowest = ranks[ranks.length - 1];
+
+            ranks.forEach(rank => {
+                if (rank > target) {
+                    lowest = Math.min(lowest, rank);
+                }
+            });
+
+            return order[lowest].replace(/-/g, " ");
+        }
+
+        /**
+         * Validates each member rank.
+         * @param {Array} members the members to be validated.
+         * @param {(Array|string)} order the current order to be validated.
+         * @param {boolean} supportsModifiers a flag indicating whether the type supports modifiers or not.
+         * @returns {void}
+         * @private
+         */
+        function validateMembers(members, order, supportsModifiers) {
+            if (members && order !== "never") {
+                const previousRanks = [];
+
+                members.forEach(member => {
+                    const rank = getRank(member, order, supportsModifiers);
+
+                    if (rank !== -1) {
+                        if (rank < previousRanks[previousRanks.length - 1]) {
+                            context.report({
+                                node: member,
+                                message: "Member {{name}} should be declared before all {{rank}} definitions.",
+                                data: {
+                                    name: getMemberName(member),
+                                    rank: getLowestRank(previousRanks, rank, order)
+                                }
+                            });
+                        } else {
+                            previousRanks.push(rank);
+                        }
+                    }
+                });
+            }
+        }
+
+        //----------------------------------------------------------------------
+        // Public
+        //----------------------------------------------------------------------
+        return {
+            ClassDeclaration(node) {
+                validateMembers(node.body.body, options.classes || options.default || defaultOrder, true);
+            },
+            ClassExpression(node) {
+                validateMembers(node.body.body, options.classExpressions || options.default || defaultOrder, true);
+            },
+            TSInterfaceDeclaration(node) {
+                validateMembers(node.body.body, options.interfaces || options.default || defaultOrder, false);
+            },
+            TSTypeLiteral(node) {
+                validateMembers(node.members, options.typeLiterals || options.default || defaultOrder, false);
+            }
+        };
+    }
+};
diff --git a/lib/rules/no-use-before-define.js b/lib/rules/no-use-before-define.js
new file mode 100644
index 0000000..5e0f5a4
--- /dev/null
+++ b/lib/rules/no-use-before-define.js
@@ -0,0 +1,285 @@
+/**
+ * @fileoverview Rule to flag use of variables before they are defined
+ * @copyright ESLint
+ * @see https://github.com/eslint/eslint/blob/a113cd3/lib/rules/no-use-before-define.js
+ * @author Ilya Volodin
+ * @author Jed Fox
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/;
+const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/;
+
+/**
+ * Parses a given value as options.
+ *
+ * @param {any} options - A value to parse.
+ * @returns {Object} The parsed options.
+ */
+function parseOptions(options) {
+    let functions = true;
+    let classes = true;
+    let variables = true;
+    let typedefs = true;
+
+    if (typeof options === "string") {
+        functions = (options !== "nofunc");
+    } else if (typeof options === "object" && options !== null) {
+        functions = options.functions !== false;
+        classes = options.classes !== false;
+        variables = options.variables !== false;
+        typedefs = options.typedefs !== false;
+    }
+
+    return { functions, classes, variables, typedefs };
+}
+
+/**
+ * Checks whether or not a given variable is a function declaration.
+ *
+ * @param {eslint-scope.Variable} variable - A variable to check.
+ * @returns {boolean} `true` if the variable is a function declaration.
+ */
+function isFunction(variable) {
+    return variable.defs[0].type === "FunctionName";
+}
+
+/**
+ * Checks whether or not a given variable is a class declaration in an upper function scope.
+ *
+ * @param {eslint-scope.Variable} variable - A variable to check.
+ * @param {eslint-scope.Reference} reference - A reference to check.
+ * @returns {boolean} `true` if the variable is a class declaration.
+ */
+function isOuterClass(variable, reference) {
+    return (
+        variable.defs[0].type === "ClassName" &&
+        variable.scope.variableScope !== reference.from.variableScope
+    );
+}
+
+/**
+ * Checks whether or not a given variable is a variable declaration in an upper function scope.
+ * @param {eslint-scope.Variable} variable - A variable to check.
+ * @param {eslint-scope.Reference} reference - A reference to check.
+ * @returns {boolean} `true` if the variable is a variable declaration.
+ */
+function isOuterVariable(variable, reference) {
+    return (
+        variable.defs[0].type === "Variable" &&
+        variable.scope.variableScope !== reference.from.variableScope
+    );
+}
+
+/**
+ * Checks whether or not a given variable is a type declaration.
+ * @param {eslint-scope.Variable} variable - A type to check.
+ * @returns {boolean} `true` if the variable is a type.
+ */
+function isType(variable) {
+    return (
+        variable.defs[0].type === "Variable" &&
+        variable.defs[0].parent.kind === "type"
+    );
+}
+
+/**
+ * Checks whether or not a given location is inside of the range of a given node.
+ *
+ * @param {ASTNode} node - An node to check.
+ * @param {number} location - A location to check.
+ * @returns {boolean} `true` if the location is inside of the range of the node.
+ */
+function isInRange(node, location) {
+    return node && node.range[0] <= location && location <= node.range[1];
+}
+
+/**
+ * Checks whether or not a given reference is inside of the initializers of a given variable.
+ *
+ * This returns `true` in the following cases:
+ *
+ *     var a = a
+ *     var [a = a] = list
+ *     var {a = a} = obj
+ *     for (var a in a) {}
+ *     for (var a of a) {}
+ *
+ * @param {Variable} variable - A variable to check.
+ * @param {Reference} reference - A reference to check.
+ * @returns {boolean} `true` if the reference is inside of the initializers.
+ */
+function isInInitializer(variable, reference) {
+    if (variable.scope !== reference.from) {
+        return false;
+    }
+
+    let node = variable.identifiers[0].parent;
+    const location = reference.identifier.range[1];
+
+    while (node) {
+        if (node.type === "VariableDeclarator") {
+            if (isInRange(node.init, location)) {
+                return true;
+            }
+            if (FOR_IN_OF_TYPE.test(node.parent.parent.type) &&
+                isInRange(node.parent.parent.right, location)
+            ) {
+                return true;
+            }
+            break;
+        } else if (node.type === "AssignmentPattern") {
+            if (isInRange(node.right, location)) {
+                return true;
+            }
+        } else if (SENTINEL_TYPE.test(node.type)) {
+            break;
+        }
+
+        node = node.parent;
+    }
+
+    return false;
+}
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = {
+    meta: {
+        docs: {
+            description: "disallow the use of variables before they are defined",
+            category: "Variables",
+            recommended: false
+        },
+
+        schema: [
+            {
+                oneOf: [
+                    {
+                        enum: ["nofunc"]
+                    },
+                    {
+                        type: "object",
+                        properties: {
+                            functions: { type: "boolean" },
+                            classes: { type: "boolean" },
+                            variables: { type: "boolean" },
+                            typedefs: { type: "boolean" }
+                        },
+                        additionalProperties: false
+                    }
+                ]
+            }
+        ]
+    },
+
+    create(context) {
+        const options = parseOptions(context.options[0]);
+
+        /**
+         * Determines whether a given use-before-define case should be reported according to the options.
+         * @param {eslint-scope.Variable} variable The variable that gets used before being defined
+         * @param {eslint-scope.Reference} reference The reference to the variable
+         * @returns {boolean} `true` if the usage should be reported
+         */
+        function isForbidden(variable, reference) {
+            if (isFunction(variable)) {
+                return options.functions;
+            }
+            if (isOuterClass(variable, reference)) {
+                return options.classes;
+            }
+            if (isType(variable) && !options.typedefs) {
+                return false;
+            }
+            if (isOuterVariable(variable, reference)) {
+                return options.variables;
+            }
+            return true;
+        }
+
+        /**
+         * Finds and validates all variables in a given scope.
+         * @param {Scope} scope The scope object.
+         * @returns {void}
+         * @private
+         */
+        function findVariablesInScope(scope) {
+            scope.references.forEach(reference => {
+                const variable = reference.resolved;
+
+                // Skips when the reference is:
+                // - initialization's.
+                // - referring to an undefined variable.
+                // - referring to a global environment variable (there're no identifiers).
+                // - located preceded by the variable (except in initializers).
+                // - allowed by options.
+                if (reference.init ||
+                    !variable ||
+                    variable.identifiers.length === 0 ||
+                    (variable.identifiers[0].range[1] < reference.identifier.range[1] && !isInInitializer(variable, reference)) ||
+                    !isForbidden(variable, reference)
+                ) {
+                    return;
+                }
+
+                // Reports.
+                context.report({
+                    node: reference.identifier,
+                    message: "'{{name}}' was used before it was defined.",
+                    data: reference.identifier
+                });
+            });
+        }
+
+        /**
+         * Validates variables inside of a node's scope.
+         * @param {ASTNode} node The node to check.
+         * @returns {void}
+         * @private
+         */
+        function findVariables() {
+            const scope = context.getScope();
+
+            findVariablesInScope(scope);
+        }
+
+        const ruleDefinition = {
+            "Program:exit"(node) {
+                const scope = context.getScope(),
+                    ecmaFeatures = context.parserOptions.ecmaFeatures || {};
+
+                findVariablesInScope(scope);
+
+                // both Node.js and Modules have an extra scope
+                if (ecmaFeatures.globalReturn || node.sourceType === "module") {
+                    findVariablesInScope(scope.childScopes[0]);
+                }
+            }
+        };
+
+        if (context.parserOptions.ecmaVersion >= 6) {
+            ruleDefinition["BlockStatement:exit"] =
+                ruleDefinition["SwitchStatement:exit"] = findVariables;
+
+            ruleDefinition["ArrowFunctionExpression:exit"] = function(node) {
+                if (node.body.type !== "BlockStatement") {
+                    findVariables();
+                }
+            };
+        } else {
+            ruleDefinition["FunctionExpression:exit"] =
+                ruleDefinition["FunctionDeclaration:exit"] =
+                ruleDefinition["ArrowFunctionExpression:exit"] = findVariables;
+        }
+
+        return ruleDefinition;
+    }
+};
diff --git a/package.json b/package.json
index 17d27d4..41f820a 100644
--- a/package.json
+++ b/package.json
@@ -11,8 +11,8 @@
   "author": "Nicholas C. Zakas",
   "main": "lib/index.js",
   "scripts": {
-    "lint": "eslint lib/",
-    "lint:fix": "eslint --fix lib/",
+    "lint": "eslint lib/ tests/",
+    "lint:fix": "eslint lib/ test/ --fix",
     "mocha": "mocha tests --recursive",
     "test": "npm run lint && npm run mocha"
   },


Test patch:
diff --git a/tests/.eslintrc.yml b/tests/.eslintrc.yml
new file mode 100644
index 0000000..09a3dd3
--- /dev/null
+++ b/tests/.eslintrc.yml
@@ -0,0 +1,2 @@
+rules:
+  node/no-unpublished-require: off # we’re using devDeps here.
diff --git a/tests/lib/rules/explicit-member-accessibility.js b/tests/lib/rules/explicit-member-accessibility.js
index b24142c..a5bef21 100644
--- a/tests/lib/rules/explicit-member-accessibility.js
+++ b/tests/lib/rules/explicit-member-accessibility.js
@@ -8,7 +8,7 @@
 // Requirements
 //------------------------------------------------------------------------------
 
-let rule = require("../../../lib/rules/explicit-member-accessibility"),
+const rule = require("../../../lib/rules/explicit-member-accessibility"),
     RuleTester = require("eslint").RuleTester;
 
 
@@ -16,7 +16,8 @@ let rule = require("../../../lib/rules/explicit-member-accessibility"),
 // Tests
 //------------------------------------------------------------------------------
 
-let ruleTester = new RuleTester();
+const ruleTester = new RuleTester();
+
 ruleTester.run("explicit-member-accessibility", rule, {
 
     valid: [
diff --git a/tests/lib/rules/interface-name-prefix.js b/tests/lib/rules/interface-name-prefix.js
index 9f3d2f7..54de815 100644
--- a/tests/lib/rules/interface-name-prefix.js
+++ b/tests/lib/rules/interface-name-prefix.js
@@ -8,7 +8,7 @@
 // Requirements
 //------------------------------------------------------------------------------
 
-let rule = require("../../../lib/rules/interface-name-prefix"),
+const rule = require("../../../lib/rules/interface-name-prefix"),
     RuleTester = require("eslint").RuleTester;
 
 
@@ -16,7 +16,8 @@ let rule = require("../../../lib/rules/interface-name-prefix"),
 // Tests
 //------------------------------------------------------------------------------
 
-let ruleTester = new RuleTester();
+const ruleTester = new RuleTester();
+
 ruleTester.run("interface-name-prefix", rule, {
 
     valid: [
diff --git a/tests/lib/rules/member-ordering.js b/tests/lib/rules/member-ordering.js
new file mode 100644
index 0000000..5c09e4e
--- /dev/null
+++ b/tests/lib/rules/member-ordering.js
@@ -0,0 +1,2570 @@
+/**
+ * @fileoverview Enforces a standard member declaration order.
+ * @author Patricio Trevino
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const rule = require("../../../lib/rules/member-ordering"),
+    RuleTester = require("eslint").RuleTester;
+
+
+//------------------------------------------------------------------------------
+// Tests
+//------------------------------------------------------------------------------
+
+const ruleTester = new RuleTester();
+
+ruleTester.run("member-ordering", rule, {
+    valid: [
+        {
+            code: `
+// no accessibility === public
+interface Foo {
+    A: string; 
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    new();
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+}
+            `,
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+interface Foo {
+    A: string;
+    J();
+    K();
+    D: string;
+    E: string;
+    F: string;
+    new();
+    G();
+    H();
+    B: string;
+    C: string;
+    I();
+    L();        
+}
+            `,
+            options: [{ default: "never" }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+interface Foo {
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    new();
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();        
+}
+            `,
+            options: [{ default: ["field", "constructor", "method"] }],
+            parser: "typescript-eslint-parser"
+        },
+
+        {
+            code: `
+// no accessibility === public
+interface Foo {
+    A: string;
+    J();
+    K();
+    D: string;
+    E: string;
+    F: string;
+    new();
+    G();
+    B: string;
+    C: string;
+    H();
+    I();
+    L();        
+}
+            `,
+            options: [{ interfaces: "never" }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+interface Foo {
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+    new();
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;    
+}
+            `,
+            options: [{ interfaces: ["method", "constructor", "field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+interface Foo {
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+    new();
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;    
+}
+            `,
+            options: [
+                {
+                    default: ["field", "constructor", "method"],
+                    interfaces: ["method", "constructor", "field"]
+                }
+            ],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+interface Foo {
+    G();
+    H();
+    I();
+    new();
+    D: string;
+    E: string;
+    F: string;
+    J();
+    K();
+    L();
+    A: string;
+    B: string;
+    C: string;        
+}
+            `,
+            options: [{ default: ["private-instance-method", "public-constructor", "protected-static-field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+interface Foo {
+    G();
+    H();
+    I();    
+    J();
+    K();
+    L();
+    D: string;
+    E: string;
+    F: string;    
+    new();
+    A: string;
+    B: string;
+    C: string;        
+}
+            `,
+            options: [{ default: ["method", "public-constructor", "protected-static-field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    new();
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+}
+            `,
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+}
+            `,
+            options: [{ default: "never" }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+}
+            `,
+            options: [{ default: ["field", "constructor", "method"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    new();
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+}
+            `,
+            options: [{ default: ["field", "method"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    G();
+    H();
+    K();
+    L();
+    A: string;
+    B: string;    
+    I();
+    J();
+    C: string;
+    D: string;
+    E: string;
+    F: string;    
+}
+            `,
+            options: [{ typeLiterals: "never" }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;    
+}
+            `,
+            options: [{ typeLiterals: ["method", "field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+}
+            `,
+            options: [{ typeLiterals: ["method", "constructor", "field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;    
+}
+            `,
+            options: [
+                {
+                    default: ["field", "constructor", "method"],
+                    typeLiterals: ["method", "constructor", "field"]
+                }
+            ],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    D: string;
+    E: string;
+    F: string;
+    A: string;
+    B: string;
+    C: string;
+    G();
+    H();
+    I();    
+    J();
+    K();
+    L();           
+}
+            `,
+            options: [
+                {
+                    default: ["public-instance-method", "public-constructor", "protected-static-field"],
+                    typeLiterals: ["field", "method"]
+                }
+            ],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    public static A: string;
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    constructor() {}
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+}
+            `,
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    public static A: string;
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    constructor() {}
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+}
+            `,
+            options: [{ default: "never" }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    public static A: string;
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    constructor() {}
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+}
+            `,
+            options: [{ default: ["field", "constructor", "method"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    constructor() {}
+    public static A: string;
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}    
+}
+            `,
+            options: [{ default: ["field", "method"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    public static G() {}
+    protected K() {}
+    private L() {}
+    private static I() {}
+    public J() {}
+    public D: string = "";
+    protected static H() {}
+    public static A: string;
+    protected static B: string = "";
+    constructor() {}
+    private static C: string = "";
+    protected E: string = "";
+    private F: string = "";    
+}
+            `,
+            options: [{ classes: "never" }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    public static A: string;
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    constructor() {}
+}
+            `,
+            options: [{ classes: ["method", "field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    constructor() {}
+    public static A: string;
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+}
+            `,
+            options: [{ classes: ["method", "constructor", "field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    constructor() {}
+    public static A: string;
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+}
+            `,
+            options: [
+                {
+                    default: ["field", "constructor", "method"],
+                    classes: ["method", "constructor", "field"]
+                }
+            ],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    public J() {}
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    protected K() {}
+    private L() {}
+    constructor() {}    
+    public D: string = "";
+    public static A: string;
+    private static C: string = "";
+    private F: string = "";
+    protected static B: string = "";
+    protected E: string = "";
+}
+            `,
+            options: [
+                {
+                    classes: ["public-method", "constructor", "public-field", "private-field", "protected-field"]
+                }
+            ],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    public static G() {}
+    private static I() {}
+    protected static H() {}    
+    public J() {}
+    private L() {}
+    protected K() {}
+    constructor() {}    
+    public D: string = "";
+    public static A: string;
+    protected static B: string = "";
+    protected E: string = "";
+    private static C: string = "";
+    private F: string = "";    
+}
+            `,
+            options: [
+                {
+                    classes: [
+                        "public-static-method",
+                        "static-method",
+                        "public-instance-method",
+                        "instance-method",
+                        "constructor",
+                        "public-field",
+                        "protected-field",
+                        "private-field"]
+                }
+            ],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    public J() {}
+    public static G() {}
+    public D: string = "";
+    public static A: string = "";
+    constructor() {}
+    protected K() {}
+    private L() {}
+    protected static H() {}
+    private static I() {}
+    protected static B: string = "";
+    private static C: string = "";
+    protected E: string = "";
+    private F: string = "";
+}
+            `,
+            parser: "typescript-eslint-parser",
+            options: [{ default: ["public-method", "public-field", "constructor", "method", "field"] }]
+        },
+        {
+            code: `
+class Foo {
+    public J() {}
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    protected K() {}
+    private L() {}
+    constructor() {}    
+    public static A: string;
+    private F: string = "";
+    protected static B: string = "";
+    public D: string = "";
+    private static C: string = "";
+    protected E: string = "";
+}
+            `,
+            options: [
+                {
+                    classes: [
+                        "public-method",
+                        "protected-static-method",
+                        "private-static-method",
+                        "protected-instance-method",
+                        "private-instance-method",
+                        "constructor",
+                        "field"
+                    ]
+                }
+            ],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    private L() {}
+    private static I() {}
+    protected static H() {}
+    protected static B: string = "";    
+    public static G() {}
+    public J() {}
+    protected K() {}
+    private static C: string = "";
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;
+    public D: string = "";
+    constructor() {}
+    
+}
+            `,
+            options: [{ classes: ["private-instance-method", "protected-static-field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    private L() {}
+    private static I() {}
+    protected static H() {}
+    public static G() {}
+    public J() {}
+    protected static B: string = "";    
+    protected K() {}
+    private static C: string = "";
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;
+    public D: string = "";
+    constructor() {}
+    
+}
+            `,
+            options: [{ default: ["public-instance-method", "protected-static-field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    private L() {}
+    private static I() {}
+    protected static H() {}
+    public static G() {}
+    public J() {}
+    protected static B: string = "";    
+    protected K() {}
+    private static C: string = "";
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;
+    public D: string = "";
+    constructor() {}
+    
+}
+            `,
+            options: [{ classes: ["public-instance-method", "protected-static-field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    public D: string = "";
+    private L() {}
+    private static I() {}
+    protected static H() {}
+    public static G() {}
+    public J() {}
+    private constructor() {}
+    protected static B: string = "";    
+    protected K() {}
+    private static C: string = "";
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;        
+}
+            `,
+            options: [
+                {
+                    default: ["public-instance-method", "public-constructor", "protected-static-field"],
+                    classes: ["public-instance-field", "private-constructor", "protected-instance-method"]
+                }
+            ],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+class Foo {
+    public constructor() {}
+    public D: string = "";
+    private L() {}
+    private static I() {}
+    protected static H() {}
+    public static G() {}
+    public J() {}    
+    protected static B: string = "";    
+    protected K() {}
+    private static C: string = "";
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;        
+}
+            `,
+            options: [
+                {
+                    default: ["public-instance-method", "public-constructor", "protected-static-field"],
+                    classes: ["public-instance-field", "private-constructor", "protected-instance-method"]
+                }
+            ],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+const foo = class Foo {
+    public static A: string;
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    constructor() {}
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+}
+            `,
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+const foo = class Foo {
+    constructor() {}
+    public static A: string;
+    protected static B: string = "";
+    private static I() {}
+    public J() {}
+    private F: string = "";
+    public static G() {}
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    protected static H() {}
+    protected K() {}
+    private L() {}
+}
+            `,
+            options: [{ default: "never" }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+const foo = class Foo {
+    public static A: string;
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    constructor() {}
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+}
+            `,
+            options: [{ default: ["field", "constructor", "method"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+const foo = class Foo {
+    constructor() {}
+    public static A: string;
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}    
+}
+            `,
+            options: [{ default: ["field", "method"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+const foo = class Foo {
+    private L() {}
+    protected static H() {}
+    constructor() {}
+    private static I() {}
+    public J() {}
+    private static C: string = "";
+    public D: string = "";
+    protected K() {}
+    public static G() {}
+    public static A: string;
+    protected static B: string = "";
+    protected E: string = "";
+    private F: string = "";    
+}
+            `,
+            options: [{ classExpressions: "never" }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+const foo = class Foo {
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    public static A: string;
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    constructor() {}
+}
+            `,
+            options: [{ classExpressions: ["method", "field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+const foo = class Foo {
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    constructor() {}
+    public static A: string;
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+}
+            `,
+            options: [{ classExpressions: ["method", "constructor", "field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+const foo = class Foo {
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    constructor() {}
+    public static A: string;
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+}
+            `,
+            options: [
+                {
+                    default: ["field", "constructor", "method"],
+                    classExpressions: ["method", "constructor", "field"]
+                }
+            ],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+const foo = class Foo {
+    private L() {}
+    private static I() {}
+    protected static H() {}
+    protected static B: string = "";    
+    public static G() {}
+    public J() {}
+    protected K() {}
+    private static C: string = "";
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;
+    public D: string = "";
+    constructor() {}
+    
+}
+            `,
+            options: [{ classExpressions: ["private-instance-method", "protected-static-field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+const foo = class Foo {
+    private L() {}
+    private static I() {}
+    protected static H() {}
+    public static G() {}
+    public J() {}
+    protected static B: string = "";    
+    protected K() {}
+    private static C: string = "";
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;
+    public D: string = "";
+    constructor() {}
+    
+}
+            `,
+            options: [{ default: ["public-instance-method", "protected-static-field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+const foo = class Foo {
+    private L() {}
+    private static I() {}
+    protected static H() {}
+    public static G() {}
+    public J() {}
+    protected static B: string = "";    
+    protected K() {}
+    private static C: string = "";
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;
+    public D: string = "";
+    constructor() {}
+    
+}
+            `,
+            options: [{ classExpressions: ["public-instance-method", "protected-static-field"] }],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+const foo = class Foo {
+    public D: string = "";
+    private L() {}
+    private static I() {}
+    protected static H() {}
+    public static G() {}
+    public J() {}
+    private constructor() {}
+    protected static B: string = "";    
+    protected K() {}
+    private static C: string = "";
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;        
+}
+            `,
+            options: [
+                {
+                    default: ["public-instance-method", "public-constructor", "protected-static-field"],
+                    classes: ["public-instance-method", "protected-constructor", "protected-static-method"],
+                    classExpressions: ["public-instance-field", "private-constructor", "protected-instance-method"]
+                }
+            ],
+            parser: "typescript-eslint-parser"
+        },
+        {
+            code: `
+const foo = class Foo {
+    public constructor() {}
+    public D: string = "";
+    private L() {}
+    private static I() {}
+    protected static H() {}
+    public static G() {}
+    public J() {}    
+    protected static B: string = "";    
+    protected K() {}
+    private static C: string = "";
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;        
+}
+            `,
+            options: [
+                {
+                    default: ["public-instance-method", "public-constructor", "protected-static-field"],
+                    classes: ["public-instance-method", "protected-constructor", "protected-static-method"],
+                    classExpressions: ["public-instance-field", "private-constructor", "protected-instance-method"]
+                }
+            ],
+            parser: "typescript-eslint-parser"
+        }
+    ],
+    invalid: [
+        {
+            code: `
+// no accessibility === public
+interface Foo {
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+    new();
+}
+            `,
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member new should be declared before all method definitions.",
+                    line: 16,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+// no accessibility === public
+interface Foo {
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+    new();
+}
+            `,
+            parser: "typescript-eslint-parser",
+            options: [{ default: ["method", "constructor", "field"] }],
+            errors: [
+                {
+                    message: "Member G should be declared before all field definitions.",
+                    line: 10,
+                    column: 5
+                },
+                {
+                    message: "Member H should be declared before all field definitions.",
+                    line: 11,
+                    column: 5
+                },
+                {
+                    message: "Member I should be declared before all field definitions.",
+                    line: 12,
+                    column: 5
+                },
+                {
+                    message: "Member J should be declared before all field definitions.",
+                    line: 13,
+                    column: 5
+                },
+                {
+                    message: "Member K should be declared before all field definitions.",
+                    line: 14,
+                    column: 5
+                },
+                {
+                    message: "Member L should be declared before all field definitions.",
+                    line: 15,
+                    column: 5
+                },
+                {
+                    message: "Member new should be declared before all field definitions.",
+                    line: 16,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+// no accessibility === public
+interface Foo {
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+    new();
+}
+            `,
+            parser: "typescript-eslint-parser",
+            options: [{ interfaces: ["method", "constructor", "field"] }],
+            errors: [
+                {
+                    message: "Member G should be declared before all field definitions.",
+                    line: 10,
+                    column: 5
+                },
+                {
+                    message: "Member H should be declared before all field definitions.",
+                    line: 11,
+                    column: 5
+                },
+                {
+                    message: "Member I should be declared before all field definitions.",
+                    line: 12,
+                    column: 5
+                },
+                {
+                    message: "Member J should be declared before all field definitions.",
+                    line: 13,
+                    column: 5
+                },
+                {
+                    message: "Member K should be declared before all field definitions.",
+                    line: 14,
+                    column: 5
+                },
+                {
+                    message: "Member L should be declared before all field definitions.",
+                    line: 15,
+                    column: 5
+                },
+                {
+                    message: "Member new should be declared before all field definitions.",
+                    line: 16,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+// no accessibility === public
+interface Foo {
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+    new();
+}
+            `,
+            parser: "typescript-eslint-parser",
+            options: [
+                {
+                    default: ["field", "method", "constructor"],
+                    interfaces: ["method", "constructor", "field"]
+                }
+            ],
+            errors: [
+                {
+                    message: "Member G should be declared before all field definitions.",
+                    line: 10,
+                    column: 5
+                },
+                {
+                    message: "Member H should be declared before all field definitions.",
+                    line: 11,
+                    column: 5
+                },
+                {
+                    message: "Member I should be declared before all field definitions.",
+                    line: 12,
+                    column: 5
+                },
+                {
+                    message: "Member J should be declared before all field definitions.",
+                    line: 13,
+                    column: 5
+                },
+                {
+                    message: "Member K should be declared before all field definitions.",
+                    line: 14,
+                    column: 5
+                },
+                {
+                    message: "Member L should be declared before all field definitions.",
+                    line: 15,
+                    column: 5
+                },
+                {
+                    message: "Member new should be declared before all field definitions.",
+                    line: 16,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+// no accessibility === public
+interface Foo {
+    new();
+    A: string;
+    G();
+    B: string;
+    H();
+    C: string;
+    I();
+    D: string;
+    J();
+    E: string;
+    K();
+    F: string;
+    L();    
+}
+            `,
+            parser: "typescript-eslint-parser",
+            options: [
+                {
+                    interfaces: ["constructor", "field", "method"]
+                }
+            ],
+            errors: [
+                {
+                    message: "Member B should be declared before all method definitions.",
+                    line: 7,
+                    column: 5
+                },
+                {
+                    message: "Member C should be declared before all method definitions.",
+                    line: 9,
+                    column: 5
+                },
+                {
+                    message: "Member D should be declared before all method definitions.",
+                    line: 11,
+                    column: 5
+                },
+                {
+                    message: "Member E should be declared before all method definitions.",
+                    line: 13,
+                    column: 5
+                },
+                {
+                    message: "Member F should be declared before all method definitions.",
+                    line: 15,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+    new();
+}
+            `,
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member new should be declared before all method definitions.",
+                    line: 16,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+    new();
+}
+            `,
+            parser: "typescript-eslint-parser",
+            options: [{ default: ["method", "constructor", "field"] }],
+            errors: [
+                {
+                    message: "Member G should be declared before all field definitions.",
+                    line: 10,
+                    column: 5
+                },
+                {
+                    message: "Member H should be declared before all field definitions.",
+                    line: 11,
+                    column: 5
+                },
+                {
+                    message: "Member I should be declared before all field definitions.",
+                    line: 12,
+                    column: 5
+                },
+                {
+                    message: "Member J should be declared before all field definitions.",
+                    line: 13,
+                    column: 5
+                },
+                {
+                    message: "Member K should be declared before all field definitions.",
+                    line: 14,
+                    column: 5
+                },
+                {
+                    message: "Member L should be declared before all field definitions.",
+                    line: 15,
+                    column: 5
+                },
+                {
+                    message: "Member new should be declared before all field definitions.",
+                    line: 16,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+    new();
+}
+            `,
+            parser: "typescript-eslint-parser",
+            options: [{ typeLiterals: ["method", "constructor", "field"] }],
+            errors: [
+                {
+                    message: "Member G should be declared before all field definitions.",
+                    line: 10,
+                    column: 5
+                },
+                {
+                    message: "Member H should be declared before all field definitions.",
+                    line: 11,
+                    column: 5
+                },
+                {
+                    message: "Member I should be declared before all field definitions.",
+                    line: 12,
+                    column: 5
+                },
+                {
+                    message: "Member J should be declared before all field definitions.",
+                    line: 13,
+                    column: 5
+                },
+                {
+                    message: "Member K should be declared before all field definitions.",
+                    line: 14,
+                    column: 5
+                },
+                {
+                    message: "Member L should be declared before all field definitions.",
+                    line: 15,
+                    column: 5
+                },
+                {
+                    message: "Member new should be declared before all field definitions.",
+                    line: 16,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    A: string;
+    B: string;
+    C: string;
+    D: string;
+    E: string;
+    F: string;
+    G();
+    H();
+    I();
+    J();
+    K();
+    L();
+    new();
+}
+            `,
+            parser: "typescript-eslint-parser",
+            options: [
+                {
+                    default: ["field", "method", "constructor"],
+                    typeLiterals: ["method", "constructor", "field"]
+                }
+            ],
+            errors: [
+                {
+                    message: "Member G should be declared before all field definitions.",
+                    line: 10,
+                    column: 5
+                },
+                {
+                    message: "Member H should be declared before all field definitions.",
+                    line: 11,
+                    column: 5
+                },
+                {
+                    message: "Member I should be declared before all field definitions.",
+                    line: 12,
+                    column: 5
+                },
+                {
+                    message: "Member J should be declared before all field definitions.",
+                    line: 13,
+                    column: 5
+                },
+                {
+                    message: "Member K should be declared before all field definitions.",
+                    line: 14,
+                    column: 5
+                },
+                {
+                    message: "Member L should be declared before all field definitions.",
+                    line: 15,
+                    column: 5
+                },
+                {
+                    message: "Member new should be declared before all field definitions.",
+                    line: 16,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+// no accessibility === public
+type Foo = {
+    new();
+    A: string;
+    G();
+    B: string;
+    H();
+    C: string;
+    I();
+    D: string;
+    J();
+    E: string;
+    K();
+    F: string;
+    L();    
+}
+            `,
+            parser: "typescript-eslint-parser",
+            options: [
+                {
+                    typeLiterals: ["constructor", "field", "method"]
+                }
+            ],
+            errors: [
+                {
+                    message: "Member B should be declared before all method definitions.",
+                    line: 7,
+                    column: 5
+                },
+                {
+                    message: "Member C should be declared before all method definitions.",
+                    line: 9,
+                    column: 5
+                },
+                {
+                    message: "Member D should be declared before all method definitions.",
+                    line: 11,
+                    column: 5
+                },
+                {
+                    message: "Member E should be declared before all method definitions.",
+                    line: 13,
+                    column: 5
+                },
+                {
+                    message: "Member F should be declared before all method definitions.",
+                    line: 15,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+class Foo {
+    public static A: string = "";
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    constructor() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    public static G() {}
+    protected static H() {}
+    private static I() {}    
+}
+            `,
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member G should be declared before all public instance method definitions.",
+                    line: 13,
+                    column: 5
+                },
+                {
+                    message: "Member H should be declared before all public instance method definitions.",
+                    line: 14,
+                    column: 5
+                },
+                {
+                    message: "Member I should be declared before all public instance method definitions.",
+                    line: 15,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+class Foo {
+    constructor() {}
+    public static A: string = "";
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    public J() {}
+    protected K() {}
+    private L() {}
+    public static G() {}
+    protected static H() {}
+    private static I() {}    
+}
+            `,
+            parser: "typescript-eslint-parser",
+            options: [{ default: ["field", "constructor", "method"] }],
+            errors: [
+                {
+                    message: "Member A should be declared before all constructor definitions.",
+                    line: 4,
+                    column: 5
+                },
+                {
+                    message: "Member B should be declared before all constructor definitions.",
+                    line: 5,
+                    column: 5
+                },
+                {
+                    message: "Member C should be declared before all constructor definitions.",
+                    line: 6,
+                    column: 5
+                },
+                {
+                    message: "Member D should be declared before all constructor definitions.",
+                    line: 7,
+                    column: 5
+                },
+                {
+                    message: "Member E should be declared before all constructor definitions.",
+                    line: 8,
+                    column: 5
+                },
+                {
+                    message: "Member F should be declared before all constructor definitions.",
+                    line: 9,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+class Foo {
+    constructor() {}
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    public static G() {}
+    public static A: string;
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}    
+}
+            `,
+            options: [{ default: ["field", "method"] }],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member A should be declared before all method definitions.",
+                    line: 10,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+class Foo {
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    public static A: string;
+    public static G() {}
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    constructor() {}
+}
+            `,
+            options: [{ default: ["method", "field"] }],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member G should be declared before all field definitions.",
+                    line: 9,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+class Foo {
+    public static G() {}
+    protected static H() {}
+    protected static B: string = "";
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    public static A: string;
+    constructor() {}    
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+}
+            `,
+            options: [{ classes: ["method", "constructor", "field"] }],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member I should be declared before all field definitions.",
+                    line: 6,
+                    column: 5
+                },
+                {
+                    message: "Member J should be declared before all field definitions.",
+                    line: 7,
+                    column: 5
+                },
+                {
+                    message: "Member K should be declared before all field definitions.",
+                    line: 8,
+                    column: 5
+                },
+                {
+                    message: "Member L should be declared before all field definitions.",
+                    line: 9,
+                    column: 5
+                },
+                {
+                    message: "Member constructor should be declared before all field definitions.",
+                    line: 11,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+class Foo {
+    public static A: string;
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    constructor() {}
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+}
+            `,
+            options: [
+                {
+                    default: ["field", "constructor", "method"],
+                    classes: ["method", "constructor", "field"]
+                }
+            ],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member G should be declared before all field definitions.",
+                    line: 4,
+                    column: 5
+                },
+                {
+                    message: "Member H should be declared before all field definitions.",
+                    line: 5,
+                    column: 5
+                },
+                {
+                    message: "Member I should be declared before all field definitions.",
+                    line: 6,
+                    column: 5
+                },
+                {
+                    message: "Member J should be declared before all field definitions.",
+                    line: 7,
+                    column: 5
+                },
+                {
+                    message: "Member K should be declared before all field definitions.",
+                    line: 8,
+                    column: 5
+                },
+                {
+                    message: "Member L should be declared before all field definitions.",
+                    line: 9,
+                    column: 5
+                },
+                {
+                    message: "Member constructor should be declared before all field definitions.",
+                    line: 10,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+class Foo {
+    private L() {}
+    public J() {}
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    protected K() {}    
+    constructor() {}    
+    public D: string = "";
+    private static C: string = "";
+    public static A: string;
+    private static C: string = "";
+    protected static B: string = "";
+    private F: string = "";
+    protected static B: string = "";
+    protected E: string = "";
+}
+            `,
+            options: [
+                {
+                    classes: ["public-method", "constructor", "public-field", "private-field", "protected-field"]
+                }
+            ],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member A should be declared before all private field definitions.",
+                    line: 12,
+                    column: 5
+                },
+                {
+                    message: "Member F should be declared before all protected field definitions.",
+                    line: 15,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+class Foo {
+    public static G() {}
+    private static I() {}
+    public J() {}
+    protected static H() {}    
+    private L() {}
+    protected K() {}
+    public D: string = "";
+    constructor() {}        
+    public static A: string;
+    protected static B: string = "";
+    protected E: string = "";
+    private static C: string = "";
+    private F: string = "";    
+}
+            `,
+            options: [
+                {
+                    classes: [
+                        "public-static-method",
+                        "static-method",
+                        "public-instance-method",
+                        "instance-method",
+                        "constructor",
+                        "public-field",
+                        "protected-field",
+                        "private-field"]
+                }
+            ],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member H should be declared before all public instance method definitions.",
+                    line: 6,
+                    column: 5
+                },
+                {
+                    message: "Member constructor should be declared before all public field definitions.",
+                    line: 10,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+class Foo {
+    public J() {}
+    public static G() {}
+    public D: string = "";
+    public static A: string = "";
+    private L() {}
+    constructor() {}
+    protected K() {}
+    protected static H() {}
+    private static I() {}
+    protected static B: string = "";
+    private static C: string = "";
+    protected E: string = "";
+    private F: string = "";
+}
+            `,
+            parser: "typescript-eslint-parser",
+            options: [{ default: ["public-method", "public-field", "constructor", "method", "field"] }],
+            errors: [
+                {
+                    message: "Member constructor should be declared before all method definitions.",
+                    line: 8,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+class Foo {
+    public J() {}
+    private static I() {}
+    public static G() {}
+    protected static H() {}    
+    protected K() {}
+    private L() {}
+    constructor() {}    
+    public static A: string;
+    private F: string = "";
+    protected static B: string = "";
+    public D: string = "";
+    private static C: string = "";
+    protected E: string = "";
+}
+            `,
+            options: [
+                {
+                    classes: [
+                        "public-method",
+                        "protected-static-method",
+                        "private-static-method",
+                        "protected-instance-method",
+                        "private-instance-method",
+                        "constructor",
+                        "field"
+                    ]
+                }
+            ],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member G should be declared before all private static method definitions.",
+                    line: 5,
+                    column: 5
+                },
+                {
+                    message: "Member H should be declared before all private static method definitions.",
+                    line: 6,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+class Foo {
+    private static I() {}
+    protected static H() {}
+    protected static B: string = "";    
+    public static G() {}
+    public J() {}
+    protected K() {}
+    private static C: string = "";
+    private L() {}
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;
+    public D: string = "";
+    constructor() {}
+}
+            `,
+            options: [{ classes: ["private-instance-method", "protected-static-field"] }],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member L should be declared before all protected static field definitions.",
+                    line: 10,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+class Foo {
+    private L() {}
+    private static I() {}
+    protected static H() {}
+    public static G() {}
+    protected static B: string = "";    
+    public J() {}
+    protected K() {}
+    private static C: string = "";
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;
+    public D: string = "";
+    constructor() {}
+    
+}
+            `,
+            options: [{ default: ["public-instance-method", "protected-static-field"] }],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member J should be declared before all protected static field definitions.",
+                    line: 8,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+const foo = class Foo {
+    public static A: string = "";
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    constructor() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    public static G() {}
+    protected static H() {}
+    private static I() {}    
+}
+            `,
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member G should be declared before all public instance method definitions.",
+                    line: 13,
+                    column: 5
+                },
+                {
+                    message: "Member H should be declared before all public instance method definitions.",
+                    line: 14,
+                    column: 5
+                },
+                {
+                    message: "Member I should be declared before all public instance method definitions.",
+                    line: 15,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+const foo = class {
+    constructor() {}
+    public static A: string = "";
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    public J() {}
+    protected K() {}
+    private L() {}
+    public static G() {}
+    protected static H() {}
+    private static I() {}    
+}
+            `,
+            parser: "typescript-eslint-parser",
+            options: [{ default: ["field", "constructor", "method"] }],
+            errors: [
+                {
+                    message: "Member A should be declared before all constructor definitions.",
+                    line: 4,
+                    column: 5
+                },
+                {
+                    message: "Member B should be declared before all constructor definitions.",
+                    line: 5,
+                    column: 5
+                },
+                {
+                    message: "Member C should be declared before all constructor definitions.",
+                    line: 6,
+                    column: 5
+                },
+                {
+                    message: "Member D should be declared before all constructor definitions.",
+                    line: 7,
+                    column: 5
+                },
+                {
+                    message: "Member E should be declared before all constructor definitions.",
+                    line: 8,
+                    column: 5
+                },
+                {
+                    message: "Member F should be declared before all constructor definitions.",
+                    line: 9,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+const foo = class {
+    constructor() {}
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    public static G() {}
+    public static A: string;
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}    
+}
+            `,
+            options: [{ default: ["field", "method"] }],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member A should be declared before all method definitions.",
+                    line: 10,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+const foo = class {
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    public static A: string;
+    public static G() {}
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+    constructor() {}
+}
+            `,
+            options: [{ default: ["method", "field"] }],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member G should be declared before all field definitions.",
+                    line: 9,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+const foo = class {
+    public static G() {}
+    protected static H() {}
+    protected static B: string = "";
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    public static A: string;
+    constructor() {}    
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+}
+            `,
+            options: [{ classExpressions: ["method", "constructor", "field"] }],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member I should be declared before all field definitions.",
+                    line: 6,
+                    column: 5
+                },
+                {
+                    message: "Member J should be declared before all field definitions.",
+                    line: 7,
+                    column: 5
+                },
+                {
+                    message: "Member K should be declared before all field definitions.",
+                    line: 8,
+                    column: 5
+                },
+                {
+                    message: "Member L should be declared before all field definitions.",
+                    line: 9,
+                    column: 5
+                },
+                {
+                    message: "Member constructor should be declared before all field definitions.",
+                    line: 11,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+const foo = class {
+    public static A: string;
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    public J() {}
+    protected K() {}
+    private L() {}
+    constructor() {}
+    protected static B: string = "";
+    private static C: string = "";
+    public D: string = "";
+    protected E: string = "";
+    private F: string = "";
+}
+            `,
+            options: [
+                {
+                    default: ["field", "constructor", "method"],
+                    classExpressions: ["method", "constructor", "field"]
+                }
+            ],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member G should be declared before all field definitions.",
+                    line: 4,
+                    column: 5
+                },
+                {
+                    message: "Member H should be declared before all field definitions.",
+                    line: 5,
+                    column: 5
+                },
+                {
+                    message: "Member I should be declared before all field definitions.",
+                    line: 6,
+                    column: 5
+                },
+                {
+                    message: "Member J should be declared before all field definitions.",
+                    line: 7,
+                    column: 5
+                },
+                {
+                    message: "Member K should be declared before all field definitions.",
+                    line: 8,
+                    column: 5
+                },
+                {
+                    message: "Member L should be declared before all field definitions.",
+                    line: 9,
+                    column: 5
+                },
+                {
+                    message: "Member constructor should be declared before all field definitions.",
+                    line: 10,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+const foo = class {
+    private L() {}
+    public J() {}
+    public static G() {}
+    protected static H() {}
+    private static I() {}
+    protected K() {}    
+    constructor() {}    
+    public D: string = "";
+    private static C: string = "";
+    public static A: string;
+    private static C: string = "";
+    protected static B: string = "";
+    private F: string = "";
+    protected static B: string = "";
+    protected E: string = "";
+}
+            `,
+            options: [
+                {
+                    classExpressions: ["public-method", "constructor", "public-field", "private-field", "protected-field"]
+                }
+            ],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member A should be declared before all private field definitions.",
+                    line: 12,
+                    column: 5
+                },
+                {
+                    message: "Member F should be declared before all protected field definitions.",
+                    line: 15,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+const foo = class {
+    public static G() {}
+    private static I() {}
+    public J() {}
+    protected static H() {}    
+    private L() {}
+    protected K() {}
+    public D: string = "";
+    constructor() {}        
+    public static A: string;
+    protected static B: string = "";
+    protected E: string = "";
+    private static C: string = "";
+    private F: string = "";    
+}
+            `,
+            options: [
+                {
+                    classExpressions: [
+                        "public-static-method",
+                        "static-method",
+                        "public-instance-method",
+                        "instance-method",
+                        "constructor",
+                        "public-field",
+                        "protected-field",
+                        "private-field"]
+                }
+            ],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member H should be declared before all public instance method definitions.",
+                    line: 6,
+                    column: 5
+                },
+                {
+                    message: "Member constructor should be declared before all public field definitions.",
+                    line: 10,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+const foo = class {
+    public J() {}
+    public static G() {}
+    public D: string = "";
+    public static A: string = "";
+    private L() {}
+    constructor() {}
+    protected K() {}
+    protected static H() {}
+    private static I() {}
+    protected static B: string = "";
+    private static C: string = "";
+    protected E: string = "";
+    private F: string = "";
+}
+            `,
+            parser: "typescript-eslint-parser",
+            options: [{ default: ["public-method", "public-field", "constructor", "method", "field"] }],
+            errors: [
+                {
+                    message: "Member constructor should be declared before all method definitions.",
+                    line: 8,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+const foo = class {
+    public J() {}
+    private static I() {}
+    public static G() {}
+    protected static H() {}    
+    protected K() {}
+    private L() {}
+    constructor() {}    
+    public static A: string;
+    private F: string = "";
+    protected static B: string = "";
+    public D: string = "";
+    private static C: string = "";
+    protected E: string = "";
+}
+            `,
+            options: [
+                {
+                    classExpressions: [
+                        "public-method",
+                        "protected-static-method",
+                        "private-static-method",
+                        "protected-instance-method",
+                        "private-instance-method",
+                        "constructor",
+                        "field"
+                    ]
+                }
+            ],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member G should be declared before all private static method definitions.",
+                    line: 5,
+                    column: 5
+                },
+                {
+                    message: "Member H should be declared before all private static method definitions.",
+                    line: 6,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+const foo = class {
+    private static I() {}
+    protected static H() {}
+    protected static B: string = "";    
+    public static G() {}
+    public J() {}
+    protected K() {}
+    private static C: string = "";
+    private L() {}
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;
+    public D: string = "";
+    constructor() {}
+    
+}
+            `,
+            options: [{ classExpressions: ["private-instance-method", "protected-static-field"] }],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member L should be declared before all protected static field definitions.",
+                    line: 10,
+                    column: 5
+                }
+            ]
+        },
+        {
+            code: `
+const foo = class {
+    private L() {}
+    private static I() {}
+    protected static H() {}
+    public static G() {}
+    protected static B: string = "";    
+    public J() {}
+    protected K() {}
+    private static C: string = "";
+    private F: string = "";
+    protected E: string = "";
+    public static A: string;
+    public D: string = "";
+    constructor() {}
+    
+}
+            `,
+            options: [{ default: ["public-instance-method", "protected-static-field"] }],
+            parser: "typescript-eslint-parser",
+            errors: [
+                {
+                    message: "Member J should be declared before all protected static field definitions.",
+                    line: 8,
+                    column: 5
+                }
+            ]
+        }
+    ]
+});
diff --git a/tests/lib/rules/no-angle-bracket-type-assertion.js b/tests/lib/rules/no-angle-bracket-type-assertion.js
index 95d8fe3..f57c101 100644
--- a/tests/lib/rules/no-angle-bracket-type-assertion.js
+++ b/tests/lib/rules/no-angle-bracket-type-assertion.js
@@ -8,7 +8,7 @@
 // Requirements
 //------------------------------------------------------------------------------
 
-let rule = require("../../../lib/rules/no-angle-bracket-type-assertion"),
+const rule = require("../../../lib/rules/no-angle-bracket-type-assertion"),
     RuleTester = require("eslint").RuleTester;
 
 
@@ -16,7 +16,8 @@ let rule = require("../../../lib/rules/no-angle-bracket-type-assertion"),
 // Tests
 //------------------------------------------------------------------------------
 
-let ruleTester = new RuleTester();
+const ruleTester = new RuleTester();
+
 ruleTester.run("no-angle-bracket-type-assertion", rule, {
 
     valid: [
@@ -127,7 +128,7 @@ const bar = <Foo>new Generic<int>();
                     message: "Prefer 'as Foo' instead of '<Foo>' when doing type assertions",
                     row: 9,
                     column: 13
-                },
+                }
             ]
         },
         {
diff --git a/tests/lib/rules/no-explicit-any.js b/tests/lib/rules/no-explicit-any.js
index 52d7172..0cd7237 100644
--- a/tests/lib/rules/no-explicit-any.js
+++ b/tests/lib/rules/no-explicit-any.js
@@ -8,7 +8,7 @@
 // Requirements
 //------------------------------------------------------------------------------
 
-let rule = require("../../../lib/rules/no-explicit-any"),
+const rule = require("../../../lib/rules/no-explicit-any"),
     RuleTester = require("eslint").RuleTester;
 
 
@@ -16,7 +16,8 @@ let rule = require("../../../lib/rules/no-explicit-any"),
 // Tests
 //------------------------------------------------------------------------------
 
-let ruleTester = new RuleTester();
+const ruleTester = new RuleTester();
+
 ruleTester.run("no-explicit-any", rule, {
 
     valid: [
diff --git a/tests/lib/rules/no-namespace.js b/tests/lib/rules/no-namespace.js
index b80c819..27f3e7c 100644
--- a/tests/lib/rules/no-namespace.js
+++ b/tests/lib/rules/no-namespace.js
@@ -8,7 +8,7 @@
 // Requirements
 //------------------------------------------------------------------------------
 
-let rule = require("../../../lib/rules/no-namespace"),
+const rule = require("../../../lib/rules/no-namespace"),
     RuleTester = require("eslint").RuleTester;
 
 
@@ -16,7 +16,8 @@ let rule = require("../../../lib/rules/no-namespace"),
 // Tests
 //------------------------------------------------------------------------------
 
-let ruleTester = new RuleTester();
+const ruleTester = new RuleTester();
+
 ruleTester.run("no-namespace", rule, {
     valid: [
         {
diff --git a/tests/lib/rules/no-triple-slash-reference.js b/tests/lib/rules/no-triple-slash-reference.js
index c06b2f0..61744d0 100644
--- a/tests/lib/rules/no-triple-slash-reference.js
+++ b/tests/lib/rules/no-triple-slash-reference.js
@@ -8,7 +8,7 @@
 // Requirements
 //------------------------------------------------------------------------------
 
-let rule = require("../../../lib/rules/no-triple-slash-reference"),
+const rule = require("../../../lib/rules/no-triple-slash-reference"),
     RuleTester = require("eslint").RuleTester;
 
 
@@ -16,7 +16,8 @@ let rule = require("../../../lib/rules/no-triple-slash-reference"),
 // Tests
 //------------------------------------------------------------------------------
 
-let ruleTester = new RuleTester();
+const ruleTester = new RuleTester();
+
 ruleTester.run("no-triple-slash-reference", rule, {
 
     valid: [
diff --git a/tests/lib/rules/no-type-alias.js b/tests/lib/rules/no-type-alias.js
index 8ef1a70..4f36c27 100644
--- a/tests/lib/rules/no-type-alias.js
+++ b/tests/lib/rules/no-type-alias.js
@@ -8,7 +8,7 @@
 // Requirements
 //------------------------------------------------------------------------------
 
-var rule = require("../../../lib/rules/no-type-alias"),
+const rule = require("../../../lib/rules/no-type-alias"),
     RuleTester = require("eslint").RuleTester;
 
 
@@ -16,7 +16,8 @@ var rule = require("../../../lib/rules/no-type-alias"),
 // Tests
 //------------------------------------------------------------------------------
 
-var ruleTester = new RuleTester();
+const ruleTester = new RuleTester();
+
 ruleTester.run("no-type-alias", rule, {
 
     valid: [
@@ -32,7 +33,7 @@ ruleTester.run("no-type-alias", rule, {
         },
         {
             code: "type Foo = 'a' | 'b';",
-            options: [{ allowAliases: true}],
+            options: [{ allowAliases: true }],
             parser: "typescript-eslint-parser"
         },
         {
diff --git a/tests/lib/rules/no-unused-vars.js b/tests/lib/rules/no-unused-vars.js
index ab97d09..76d668c 100644
--- a/tests/lib/rules/no-unused-vars.js
+++ b/tests/lib/rules/no-unused-vars.js
@@ -40,7 +40,7 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 "@ClassDecoratorFactory()",
                 "export class Foo {}"
             ].join("\n"),
-            parser,
+            parser
         },
         {
             code: [
@@ -48,7 +48,7 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 "@ClassDecorator",
                 "export class Foo {}"
             ].join("\n"),
-            parser,
+            parser
         },
         {
             code: [
@@ -58,7 +58,7 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 "   get bar() {}",
                 "}"
             ].join("\n"),
-            parser,
+            parser
         },
         {
             code: [
@@ -68,7 +68,7 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 "   set bar() {}",
                 "}"
             ].join("\n"),
-            parser,
+            parser
         },
         {
             code: [
@@ -78,7 +78,7 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 "   bar() {}",
                 "}"
             ].join("\n"),
-            parser,
+            parser
         },
         {
             code: [
@@ -88,7 +88,7 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 "   static bar() {}",
                 "}"
             ].join("\n"),
-            parser,
+            parser
         },
         {
             code: [
@@ -99,7 +99,7 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 "   }",
                 "}"
             ].join("\n"),
-            parser,
+            parser
         },
         {
             code: [
@@ -110,7 +110,7 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 "   }",
                 "}"
             ].join("\n"),
-            parser,
+            parser
         },
         {
             code: [
@@ -121,7 +121,7 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 "   }",
                 "}"
             ].join("\n"),
-            parser,
+            parser
         },
         {
             code: [
@@ -132,7 +132,7 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 "   }",
                 "}"
             ].join("\n"),
-            parser,
+            parser
         },
         {
             code: [
@@ -143,7 +143,7 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 "   click = new EventEmitter();",
                 "}"
             ].join("\n"),
-            parser,
+            parser
         },
         {
             code: [
@@ -155,7 +155,7 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 "   static prop2;",
                 "}"
             ].join("\n"),
-            parser,
+            parser
         },
         {
             code: [
@@ -167,16 +167,16 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 "   y;",
                 "}"
             ].join("\n"),
-            parser,
+            parser
         },
         {
             code: [
                 "interface Base {}",
                 "class Thing implements Base {}",
-                "new Thing()",
+                "new Thing()"
             ].join("\n"),
-            parser,
-        },
+            parser
+        }
     ],
 
     invalid: [
@@ -191,6 +191,6 @@ ruleTester.run("no-unused-vars", ruleNoUnusedVars, {
                 line: 1,
                 column: 10
             }]
-        },
+        }
     ]
 });
diff --git a/tests/lib/rules/no-use-before-define.js b/tests/lib/rules/no-use-before-define.js
new file mode 100644
index 0000000..f5fa274
--- /dev/null
+++ b/tests/lib/rules/no-use-before-define.js
@@ -0,0 +1,127 @@
+/**
+ * @fileoverview Tests for no-use-before-define rule.
+ * @author Ilya Volodin
+ * @author Jed Fox
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const rule = require("../../../lib/rules/no-use-before-define"),
+    RuleTester = require("eslint").RuleTester;
+
+//------------------------------------------------------------------------------
+// Tests
+//------------------------------------------------------------------------------
+
+const ruleTester = new RuleTester();
+
+ruleTester.run("no-use-before-define", rule, {
+    valid: [
+        "var a=10; alert(a);",
+        "function b(a) { alert(a); }",
+        "Object.hasOwnProperty.call(a);",
+        "function a() { alert(arguments);}",
+        { code: "a(); function a() { alert(arguments); }", options: ["nofunc"] },
+        { code: "(() => { var a = 42; alert(a); })();", parserOptions: { ecmaVersion: 6 } },
+        { code: "a(); try { throw new Error() } catch (a) {}" },
+        { code: "class A {} new A();", parserOptions: { ecmaVersion: 6 } },
+        "var a = 0, b = a;",
+        { code: "var {a = 0, b = a} = {};", parserOptions: { ecmaVersion: 6 } },
+        { code: "var [a = 0, b = a] = {};", parserOptions: { ecmaVersion: 6 } },
+        "function foo() { foo(); }",
+        "var foo = function() { foo(); };",
+        { code: "var a; for (a in a) {}" },
+        { code: "var a; for (a of a) {}", parserOptions: { ecmaVersion: 6 } },
+
+        // Block-level bindings
+        { code: "\"use strict\"; a(); { function a() {} }", parserOptions: { ecmaVersion: 6 } },
+        { code: "\"use strict\"; { a(); function a() {} }", options: ["nofunc"], parserOptions: { ecmaVersion: 6 } },
+        { code: "switch (foo) { case 1:  { a(); } default: { let a; }}", parserOptions: { ecmaVersion: 6 } },
+        { code: "a(); { let a = function () {}; }", parserOptions: { ecmaVersion: 6 } },
+
+        // object style options
+        { code: "a(); function a() { alert(arguments); }", options: [{ functions: false }] },
+        { code: "\"use strict\"; { a(); function a() {} }", options: [{ functions: false }], parserOptions: { ecmaVersion: 6 } },
+        { code: "function foo() { new A(); } class A {};", options: [{ classes: false }], parserOptions: { ecmaVersion: 6 } },
+
+        // "variables" option
+        {
+            code: "function foo() { bar; } var bar;",
+            options: [{ variables: false }]
+        },
+        {
+            code: "var foo = () => bar; var bar;",
+            options: [{ variables: false }],
+            parserOptions: { ecmaVersion: 6 }
+        },
+
+        // "typedefs" option
+        {
+            code: "var x: Foo = 2; type Foo = string | number",
+            options: [{ typedefs: false }],
+            parser: "typescript-eslint-parser"
+        }
+    ],
+    invalid: [
+        { code: "a++; var a=19;", parserOptions: { sourceType: "module" }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "a++; var a=19;", parserOptions: { parserOptions: { ecmaVersion: 6 } }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "a++; var a=19;", errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "a(); var a=function() {};", errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "alert(a[1]); var a=[1,3];", errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "a(); function a() { alert(b); var b=10; a(); }", errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }, { message: "'b' was used before it was defined.", type: "Identifier" }] },
+        { code: "a(); var a=function() {};", options: ["nofunc"], errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "(() => { alert(a); var a = 42; })();", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "(() => a())(); function a() { }", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "\"use strict\"; a(); { function a() {} }", errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "a(); try { throw new Error() } catch (foo) {var a;}", errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "var f = () => a; var a;", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "new A(); class A {};", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'A' was used before it was defined.", type: "Identifier" }] },
+        { code: "function foo() { new A(); } class A {};", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'A' was used before it was defined.", type: "Identifier" }] },
+        { code: "new A(); var A = class {};", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'A' was used before it was defined.", type: "Identifier" }] },
+        { code: "function foo() { new A(); } var A = class {};", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'A' was used before it was defined.", type: "Identifier" }] },
+
+        // Block-level bindings
+        { code: "a++; { var a; }", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "\"use strict\"; { a(); function a() {} }", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "{a; let a = 1}", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "switch (foo) { case 1: a();\n default: \n let a;}", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "if (true) { function foo() { a; } let a;}", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+
+        // object style options
+        { code: "a(); var a=function() {};", options: [{ functions: false, classes: false }], errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "new A(); class A {};", options: [{ functions: false, classes: false }], parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'A' was used before it was defined.", type: "Identifier" }] },
+        { code: "new A(); var A = class {};", options: [{ classes: false }], parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'A' was used before it was defined.", type: "Identifier" }] },
+        { code: "function foo() { new A(); } var A = class {};", options: [{ classes: false }], parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'A' was used before it was defined.", type: "Identifier" }] },
+
+        // invalid initializers
+        { code: "var a = a;", errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "let a = a + b;", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "const a = foo(a);", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "function foo(a = a) {}", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "var {a = a} = [];", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "var [a = a] = [];", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "var {b = a, a} = {};", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "var [b = a, a] = {};", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "var {a = 0} = a;", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "var [a = 0] = a;", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "for (var a in a) {}", errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+        { code: "for (var a of a) {}", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "'a' was used before it was defined.", type: "Identifier" }] },
+
+        // "variables" option
+        {
+            code: "function foo() { bar; var bar = 1; } var bar;",
+            parserOptions: { ecmaVersion: 6 },
+            options: [{ variables: false }],
+            errors: [{ message: "'bar' was used before it was defined.", type: "Identifier" }]
+        },
+        {
+            code: "foo; var foo;",
+            options: [{ variables: false }],
+            errors: [{ message: "'foo' was used before it was defined.", type: "Identifier" }]
+        }
+    ]
+});
diff --git a/tests/lib/rules/prefer-namespace-keyword.js b/tests/lib/rules/prefer-namespace-keyword.js
index 5369dea..9e68e24 100644
--- a/tests/lib/rules/prefer-namespace-keyword.js
+++ b/tests/lib/rules/prefer-namespace-keyword.js
@@ -8,7 +8,7 @@
 // Requirements
 //------------------------------------------------------------------------------
 
-let rule = require("../../../lib/rules/prefer-namespace-keyword"),
+const rule = require("../../../lib/rules/prefer-namespace-keyword"),
     RuleTester = require("eslint").RuleTester;
 
 
@@ -16,7 +16,8 @@ let rule = require("../../../lib/rules/prefer-namespace-keyword"),
 // Tests
 //------------------------------------------------------------------------------
 
-let ruleTester = new RuleTester();
+const ruleTester = new RuleTester();
+
 ruleTester.run("prefer-namespace-keyword", rule, {
     valid: [
         {
@@ -41,7 +42,7 @@ ruleTester.run("prefer-namespace-keyword", rule, {
                     message: "Use namespace instead of module to declare custom TypeScript modules",
                     output: "namespace foo { }",
                     row: 1,
-                    column: 1,
+                    column: 1
                 }
             ]
         },
diff --git a/tests/lib/rules/type-annotation-spacing.js b/tests/lib/rules/type-annotation-spacing.js
index 720ef32..be9aba8 100644
--- a/tests/lib/rules/type-annotation-spacing.js
+++ b/tests/lib/rules/type-annotation-spacing.js
@@ -8,7 +8,7 @@
 // Requirements
 //------------------------------------------------------------------------------
 
-let rule = require("../../../lib/rules/type-annotation-spacing"),
+const rule = require("../../../lib/rules/type-annotation-spacing"),
     RuleTester = require("eslint").RuleTester;
 
 
@@ -16,7 +16,8 @@ let rule = require("../../../lib/rules/type-annotation-spacing"),
 // Tests
 //------------------------------------------------------------------------------
 
-let ruleTester = new RuleTester();
+const ruleTester = new RuleTester();
+
 ruleTester.run("type-annotation-spacing", rule, {
 
     valid: [