Repository: nzakas/eslint-plugin-typescript
Pull request #23 (2017-02-02 06:19:04)

New: Add rule member-ordering
This includes

New rule member-ordering
Corresponding test
Corresponding documentation
Update to README.md to include the new rule

weirdpattern: @dannyfritz one more =), could you please update #5 
JamesHenry: Sorry again @weirdpattern for the delay, as with your other PR, would you be available to update this to include all the latest changes?
corbinu: @weirdpattern Not at all trying to steal your thunder but just so you know if your no longer interested I am happy to take these over :)
weirdpattern: @corbinu, no worries, I can do this, just need 1 or 2 nights to catch up, most of the code is already there, I just need to validate
corbinu: glad to hear it!
weirdpattern: @JamesHenry and @corbinu is it OK with you if we wait until the other PR has been approved and merged to update and rebase this PR? 
JamesHenry: @weirdpattern I have merged the other PR, thanks a lot
weirdpattern: @JamesHenry alright, I'm gonna work on this tonight.
weirdpattern: @JamesHenry I finally found the time to do this... sorry it took me this long, was real busy at work and home... feel free to review the code and then merge it...
corbinu: @weirdpattern No worries we all get busy. Thanks
corbinu: LGTM
JamesHenry: I don't want to slow down this awesome momentum so I am going to go ahead and merge this without the most detailed of reviews 😄 

Thanks so much for your efforts @weirdpattern!

Even though the plugin has been around for a while, it is still early days, so I would rather just get this in and we can work on problems, if they arise.

Patch:
diff --git a/README.md b/README.md
index e9b96ea..e37f5d3 100644
--- a/README.md
+++ b/README.md
@@ -58,3 +58,4 @@ Then configure the rules you want to use under the rules section.
 * `typescript/no-namespace` - disallows the use of custom TypeScript modules and namespaces.
 * `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/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);
+            }
+        };
+    }
+};


Test patch:
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
+                }
+            ]
+        }
+    ]
+});