-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added CONTRIBUTING.md - Added Prettier packages. - Formatted files using Prettier. - Added ESLInt. - Added ESLint and Prettier config module. - Fixed linter errors. - Added blank Prettier config file. - Added Git hooks. - Adjusted fomatting for MD files. - Added to CONTRIBUTING.md - Added Prettier config rules.
- Loading branch information
Showing
17 changed files
with
5,537 additions
and
419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"commonjs": true, | ||
"es2021": true | ||
}, | ||
"extends": ["standard", "prettier"], | ||
"overrides": [], | ||
"parserOptions": { | ||
"ecmaVersion": "latest" | ||
}, | ||
"rules": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,7 @@ dist | |
.pnp.* | ||
.DS_Store | ||
src/.DS_Store | ||
|
||
# Ignore artifacts: | ||
build | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Ignore artifacts: | ||
build | ||
coverage | ||
|
||
# Ignore MD files | ||
#*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"arrowParens": "always", | ||
"bracketSameLine": false, | ||
"bracketSpacing": true, | ||
"endOfLine": "lf", | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Development Setup | ||
|
||
To contribute to this project, setup your development environment according to these steps and use the code formatter and linter described below. | ||
|
||
## Fork Repository and Install Packages | ||
|
||
1. Download and install a recent version of [Node.js](https://nodejs.org/en/) (8.0 or higher). | ||
2. Fork the project repository and clone the forked repository on to your local machine. | ||
3. Open the repository in your editor/IDE of choice. | ||
4. Open a terminal or command window and move to the directory where the repository was cloned to. | ||
5. Run the command `npm install` followed by `npm install -g` to install packages and install the tool globally. | ||
|
||
## Source Code Formatter | ||
|
||
This project uses [Prettier](https://prettier.io/) to format the source code. | ||
|
||
### Using the Command Line | ||
|
||
Once all packages are installed you can format all files using the terminal/CLI with the command: | ||
|
||
``` | ||
npx prettier --write . | ||
``` | ||
|
||
You can use `prettier --write .` to format everything, but it's not recommended. It's recommended only to format the source code that you have written/changed. | ||
|
||
To format a certain directory use: | ||
|
||
``` | ||
npx prettier --write directory_name/ | ||
``` | ||
|
||
To format a certain file use: | ||
|
||
``` | ||
npx prettier --write filepath/filename.js | ||
``` | ||
|
||
To check whether files have been formatted using Prettier but without overwriting anything, run the command: | ||
|
||
``` | ||
npx prettier --check . | ||
``` | ||
|
||
### Editor/IDE Integration | ||
|
||
Formatting from the command line is a good way to format the source code and should be done at the minimum. But it can be annoying to run the command(s) every time. Depending on your editor/IDE, you can integrate Prettier so that code formats automatically as it's being written. | ||
|
||
[Click here](https://prettier.io/docs/en/editors.html) to find out how to integrate Prettier in your editor/IDE. | ||
|
||
## Linter | ||
|
||
This project uses [ESLint](https://eslint.org/) as the linter of choice to help make the source code more consistent and to avoid potential bugs. | ||
|
||
### Using the Command Line | ||
|
||
Once all packages are installed you can use ESLint to check files for coding errors/mistakes with this command: | ||
|
||
``` | ||
npx eslint yourfile.js | ||
``` | ||
|
||
You can also do this for multiple files at once, just keep adding filenames to the end like so: | ||
|
||
``` | ||
npx eslint yourfile.js yourfile_2.js yourfile_3.js | ||
``` | ||
|
||
It's recommended to do this on all files that have been added or changed. | ||
|
||
### Editor/IDE Integration | ||
|
||
Much like code formatting, using the command line to check for coding errors should be done at the minimum. However, you can integrate ESLint into your editor/IDE of choice to make the process much easier. | ||
|
||
[Click here](https://eslint.org/docs/latest/user-guide/integrations) to find out how to integrate ESLint in your editor/IDE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
<!doctype html> | ||
<!DOCTYPE html> | ||
<html lang="en-CA" dir="ltr"> | ||
<head> | ||
<title>index</title> | ||
<meta charset="utf-8"> | ||
|
||
|
||
|
||
|
||
</head> | ||
<body> | ||
<ul> | ||
|
||
<li><a href=".\dist\input MD.html">input MD</a></li> | ||
|
||
<li><a href=".\dist\inputTXT.html">inputTXT</a></li> | ||
|
||
<li><a href=".\dist\Silver Blaze.html">Silver Blaze</a></li> | ||
|
||
<li><a href=".\dist\THE ADVENTURE OF THE SIX NAPOLEONS.html">THE ADVENTURE OF THE SIX NAPOLEONS</a></li> | ||
|
||
<li><a href=".\dist\THE ADVENTURE OF THE SPECKLED BAND.html">THE ADVENTURE OF THE SPECKLED BAND</a></li> | ||
|
||
<li><a href=".\dist\The Naval Treaty.html">The Naval Treaty</a></li> | ||
|
||
<li><a href=".\dist\The Red Headed League.html">The Red Headed League</a></li> | ||
</ul> | ||
|
||
</body> | ||
<head> | ||
<title>index</title> | ||
<meta charset="utf-8" /> | ||
</head> | ||
<body> | ||
<ul> | ||
<li><a href=".\dist\input MD.html">input MD</a></li> | ||
|
||
<li><a href=".\dist\inputTXT.html">inputTXT</a></li> | ||
|
||
<li><a href=".\dist\Silver Blaze.html">Silver Blaze</a></li> | ||
|
||
<li> | ||
<a href=".\dist\THE ADVENTURE OF THE SIX NAPOLEONS.html" | ||
>THE ADVENTURE OF THE SIX NAPOLEONS</a | ||
> | ||
</li> | ||
|
||
<li> | ||
<a href=".\dist\THE ADVENTURE OF THE SPECKLED BAND.html" | ||
>THE ADVENTURE OF THE SPECKLED BAND</a | ||
> | ||
</li> | ||
|
||
<li><a href=".\dist\The Naval Treaty.html">The Naval Treaty</a></li> | ||
|
||
<li> | ||
<a href=".\dist\The Red Headed League.html">The Red Headed League</a> | ||
</li> | ||
</ul> | ||
</body> | ||
</html> |
Oops, something went wrong.