Opened on 02/24/2016 at 04:38:56 PM

Closed on 05/24/2016 at 12:37:06 PM

Last modified on 05/24/2016 at 12:37:55 PM

#3691 closed change (rejected)

Create standard JSCS config for ABP projects

Reported by: juliandoucette Assignee:
Priority: Unknown Milestone:
Module: Unknown Keywords:
Cc: fhd, saroyanm, greiner, trev, erikvold Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by juliandoucette)

Background

  • We have very specific code style standards for ABP projects
  • Documentation on our code style is spread across multiple documents and sometimes missing

What to change

We should create a standard JSCS config for JavaScript projects to help reduce the time spent on code style related NITs in code review

http://jscs.info/

JSCS is different from EditorConfig and ESLint because it focuses on (and does a much better job linting) code style specifically.

Attachments (0)

Change History (5)

comment:1 Changed on 02/24/2016 at 04:47:31 PM by fhd

  • Cc erikvold added

Very much agree!

Erik and Thomas recently created something for a project we shouldn't mention yet, but we can talk about its .jscsrc :)

{
  "disallowTabs": true,
  "disallowTrailingWhitespace": true,
  "disallowVar": true,
  "extract": ["*.htm", "*.html"],
  "fileExtensions": [".js", ".jsx"],
  "maximumNumberOfLines": 500,
  "maximumLineLength": 80,
  "requireAlignedMultilineParams": 2,
  "requireArrowFunctions": true,
  "requireBlocksOnNewline": true,
  "requireEnhancedObjectLiterals": true,
  "requireKeywordsOnNewLine": ["else", "else if"],
  "requireNewlineBeforeBlockStatements": true,
  "requireOperatorBeforeLineBreak":
  [
    "?", "+", "-"
  ],
  "requirePaddingNewLinesAfterUseStrict": true,
  "requirePaddingNewLinesBeforeExport": true,
  "requireSpaceAfterKeywords": true,
  "requireSpaceBeforeBlockStatements": true,
  "requireSpacesInConditionalExpression": true,
  "requireLineBreakAfterVariableAssignment": true,
  "requireLineFeedAtFileEnd": true,
  "requireSemicolons": true,
  "requireSpaceBetweenArguments": true,
  "requireSpacesInForStatement": true,
  "requireSpacesInFunctionDeclaration":
  {
    "beforeOpeningCurlyBrace": true
  },
  "requireTemplateStrings":
  {
    "allExcept": ["stringConcatenation"]
  },
  "validateIndentation": 2,
  "validateLineBreaks": "LF",
  "validateParameterSeparator": ", ",
  "validateQuoteMarks": "\""
}

Looks like it'll need some adjusting to really reflect our coding style, but I guess it's a starting point.

Last edited on 02/24/2016 at 04:49:28 PM by fhd

comment:2 Changed on 02/24/2016 at 04:53:59 PM by juliandoucette

  • Summary changed from Create JSCS config to Create standard JSCS config for ABP projects

comment:3 Changed on 02/24/2016 at 05:03:15 PM by juliandoucette

  • Description modified (diff)

comment:4 Changed on 05/18/2016 at 07:32:55 PM by trev

Given that JSCS has been deprecated in favor on ESLint, why have this issue in addition to #3692?

Note that the rules listed in comment:1 appear to be something that ESLint can validate as well.

Last edited on 05/18/2016 at 07:35:13 PM by trev

comment:5 Changed on 05/24/2016 at 12:37:06 PM by juliandoucette

  • Resolution set to rejected
  • Status changed from new to closed

@trev JSCS was not deprecated when this ticket was created and I did not yet know that ESLint can validate everything we need.

Thanks for pointing it out :)

Last edited on 05/24/2016 at 12:37:55 PM by juliandoucette

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none).
 
Note: See TracTickets for help on using tickets.