Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#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.

Change History (5)

comment:1 Changed 4 years ago 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 4 years ago by fhd (previous) (diff)

comment:2 Changed 4 years ago by juliandoucette

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

comment:3 Changed 4 years ago by juliandoucette

  • Description modified (diff)

comment:4 Changed 4 years ago 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 4 years ago by trev (previous) (diff)

comment:5 Changed 4 years ago 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 4 years ago by juliandoucette (previous) (diff)
Note: See TracTickets for help on using tickets.