Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Testing.md and create Style.md #76

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,6 @@ Pushing to main is blocked unless all of the above steps pass and the code is ap

# Additional Documentation

- [Testing](admin/Testing.md)
- [Testing Specification](specs/Testing.md)
- [Trending Specification](specs/Trending%20posts%20specification.md)
- [Style Specification](specs/Style.md)
83 changes: 83 additions & 0 deletions specs/Style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Style Specification

Our automated linting on the client side utilizes [ESLint](https://eslint.org/) with the [Stylistic](https://eslint.style/) plugin to automate and enforce our style guidelines.

We utilize the recommended defaults for these two tools to create a wide spread of consistency between our code without needing to customize every single setting. Our approach was to use the defaults, watch for anything unusual, and edit our configuration as necessary. Due to the length of these default lists, we will instead link to the full lists and add any changes or customizations we added below.

## Default Lists
- [ESLint](https://eslint.org/docs/latest/rules/) (Rules with a ✅ are enabled)
- [Stylistic](https://eslint.style/rules)

## Customizations

### @stylistic/indent

Indentatiosn use four spaces.

```js
function abc() {
console.log("Hello World!");
}
```

### @stylistic/quotes

Strings are made with double quotes.

```js
const txt = "CSE 210 is awesome!";
```

### @stylistic/semi

Semicolins must be included.

```js
console.log("#PowellGang");
```

### @stylistic/arrow-spacing

Arrow functions must have a space before and after the `=>`.

```js
(a, b) => {
...
}
```

### @stylistic/block-spacing

Single line blocks must have a space between the curly braces and code. Multiline blocks must have the code start on a new line from the curly brace.

```js
function foo() { return true; }

function bar() {
const x = "a";
return x;
}
```

### linebreak-style

Linebreaks use CRLF.

### no-var

Disallows the use of `var`.

```js
let x = 1;
const y = 2;
```

### prefer-const

Requires const declarations for variables that are never reassigned after being declared.

```js
const x = 1;
let y = 2;
y = 3;
```
File renamed without changes.
Loading