Update code standards so that they follow our prettier config #354

Closed
opened 2026-04-16 11:03:25 +00:00 by a24vinla · 2 comments
Collaborator

Prettier config sits in frontend under (.prettierrc). Its easier to change our code standards than update everyone's config!

Wiki: https://git.webug.se/Andras/BoundlessFlowCampus2K/wiki/Coding-Conventions

Prettier config sits in frontend under (.prettierrc). Its easier to change our code standards than update everyone's config! Wiki: https://git.webug.se/Andras/BoundlessFlowCampus2K/wiki/Coding-Conventions
Collaborator

To better match the current Code convention, the following formatting rules could be added:

  • Make sure to use single quotes ( ' ) for strings.

  • Make sure to always end statements with semicolons.

-Keep the maximum line length to 80 characters.

-Add commas where it is allowed (for example in objects and arrays). This makes it easier to add new elements later. Example:
const colors = [
'black',
'red',
'blue',
];

-Arrow functions should include parentheses, for example:
var double = (x) => x * 2;

-Keep spacing inside brackets, for example:
{ value } instead of {value}.

**To better match the current Code convention, the following formatting rules could be added:** - Make sure to use single quotes **( ' )** for strings. - Make sure to always end statements with semicolons. -Keep the maximum line length to 80 characters. -Add commas where it is allowed (for example in objects and arrays). This makes it easier to add new elements later. Example: **const colors = [ 'black', 'red', 'blue', ];** -Arrow functions should include parentheses, for example: **var double = (x) => x * 2;** -Keep spacing inside brackets, for example: **{ value } instead of {value}**.
Collaborator

The research is good it matches our current prettier setup. However since this issue is to make sure our standards align with our .prettierrc i believe we should include all the rules stated in our .prettierrc rather just a part of it.

At the same time we need to be careful about how and where we add these rules into the wiki since in our current project prettier does not support all the languages that are currently in use specifically C# and SQL because of this when adding these rules to the general coding conventions sections we need to be careful because prettier does technically not apply to every language.

Rules:

}
  "arrowParens": "always", 
  "bracketSameLine": false, 
  "bracketSpacing": true, 
  "htmlWhitespaceSensitivity": "css", 
  "insertPragma": false, 
  "objectWrap": "preserve",
   "jsxBracketSameLine": false, 
  "jsxSingleQuote": true, 
  "printWidth": 80, 
  "proseWrap": "always", 
  "quoteProps": "as-needed", 
  "requirePragma": false, 
  "semi": true,
   "singleQuote": true, 
  "tabWidth": 2, 
  "trailingComma": "all", 
  "useTabs": true, 
  "endOfLine": "lf"
}
The research is good it matches our current prettier setup. However since this issue is to make sure our standards align with our .prettierrc i believe we should include all the rules stated in our .prettierrc rather just a part of it. At the same time we need to be careful about how and where we add these rules into the wiki since in our current project prettier does not support all the languages that are currently in use specifically C# and SQL because of this when adding these rules to the general coding conventions sections we need to be careful because prettier does technically not apply to every language. ### Rules: ``` } "arrowParens": "always", "bracketSameLine": false, "bracketSpacing": true, "htmlWhitespaceSensitivity": "css", "insertPragma": false, "objectWrap": "preserve", "jsxBracketSameLine": false, "jsxSingleQuote": true, "printWidth": 80, "proseWrap": "always", "quoteProps": "as-needed", "requirePragma": false, "semi": true, "singleQuote": true, "tabWidth": 2, "trailingComma": "all", "useTabs": true, "endOfLine": "lf" } ```
Sign in to join this conversation.
No milestone
No project
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K#354
No description provided.