create-react-app-typescript icon indicating copy to clipboard operation
create-react-app-typescript copied to clipboard

Update member-ordering rule in template

Open corydeppen opened this issue 7 years ago • 3 comments

The current value for the member-ordering rule in the tslint.json template file doesn't appear to be correct. According to the tslint rules for member-ordering, the order property should be a preset string or an array of strings. While the current values in the template file were deprecated a while back, it looks like the fields-first preset may be an appropriate replacement.

I'd be happy to submit a PR for this if you agree this rule should be updated and would like the help.

corydeppen avatar Jun 17 '17 03:06 corydeppen

I think that this should be solved by #112 - please provide feedback once this lands.

wmonk avatar Aug 07 '17 15:08 wmonk

Not sure what's happening with #112, so I'd like to correct a little error in case anyone comes across this issue.

The schema is actually not an array of strings, but an object with the key order that lists the types by which to sort.

"member-ordering": [
	true,
	"public-before-private",
	"static-before-instance",
	"variables-before-functions"
],

should be:

"member-ordering": [
  true,
  {
	"order": [
	  "public-before-private",
	  "static-before-instance",
	  "variables-before-functions"
	]
  }
],

I could make a PR to have this fixed if #112 is stalling or being reconsidered.

NiroSugir avatar Apr 09 '18 18:04 NiroSugir

Hey @corydeppen!

Looks like this issue is outdated because tslint.json was changed a lot (https://github.com/wmonk/create-react-app-typescript/blob/master/template/tslint.json).

Please close this issue. 😉

r3nya avatar Oct 02 '18 05:10 r3nya