From 0fac5c2327c0e167ec71bd662a62fb8895845de8 Mon Sep 17 00:00:00 2001 From: Veda Date: Wed, 11 Sep 2019 21:52:35 +0530 Subject: [PATCH] [fix]: add constructor & static-variable test to valid --- tests/lib/rules/sort-comp.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/lib/rules/sort-comp.js b/tests/lib/rules/sort-comp.js index cfebca7da8..8344f2175a 100644 --- a/tests/lib/rules/sort-comp.js +++ b/tests/lib/rules/sort-comp.js @@ -596,6 +596,33 @@ ruleTester.run('sort-comp', rule, { 'instance-variables' ] }] + }, { + code: ` + class MyComponent extends React.Component { + static foo = 1; + bar; + + constructor() { + super(props); + + this.state = {}; + } + + render() { + return null; + } + } + `, + parser: parsers.BABEL_ESLINT, + options: [{ + order: [ + 'static-variables', + 'instance-variables', + 'constructor', + 'everything-else', + 'render' + ] + }] }], invalid: [{