Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added code tasks like, prettier for fromatting, eslint for linting, v…
…scode settings for auto formatting and linting on save, pre-commit hooks for auto formatting and linting before committing: * refactored readme and added contributing * added prettier configuration to project * added eslint configuration * added vscode integration for auto formatting using prettier and linting using eslint * added pre-commit hooks with lint-staged and husky to lint and format files automatically before committing * updated pre-commit settings * testing pre-commit hook * removed console.log to test whether pre-comit hook works properly * added updated lintstaged commands
- Loading branch information
Showing
19 changed files
with
2,227 additions
and
66 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,4 @@ | ||
| package.json | ||
| package-lock.json | ||
| node_modules/ | ||
| examples/ |
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,15 @@ | ||
| module.exports = { | ||
| env: { | ||
| browser: true, | ||
| es2021: true, | ||
| node: true, | ||
| }, | ||
| "extends": [ | ||
| "eslint:recommended", | ||
| "prettier" | ||
| ], | ||
| parserOptions: { | ||
| ecmaVersion: 'latest', | ||
| sourceType: 'module', | ||
| }, | ||
| }; |
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,5 +1,3 @@ | ||
| node_modules | ||
|
|
||
| til | ||
|
|
||
| .DS_Store |
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 @@ | ||
| _ |
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,3 @@ | ||
| #!/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,4 @@ | ||
| { | ||
| "*.js": ["prettier --write", "eslint --fix"], | ||
| "*.{html, css}": ["prettier --write"] | ||
| } |
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 @@ | ||
| package.json | ||
| package-lock.json | ||
| node_modules/ | ||
| examples/ |
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 |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "recommendations": [ | ||
| "dbaeumer.vscode-eslint", | ||
| "esbenp.prettier-vscode", | ||
| ] | ||
| } |
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,8 @@ | ||
| { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "editor.formatOnSave": true, | ||
| "editor.codeActionsOnSave": { | ||
| "source.fixAll": true | ||
| }, | ||
| "eslint.workingDirectories": [{ "mode": "auto" }] | ||
| } |
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,51 @@ | ||
| ## Project Setup | ||
|
|
||
| Make sure [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) is installed on your system. Also, make sure you have latest [node](https://nodejs.org/en/download) installed on your computer. | ||
|
|
||
| To install this program, first clone the repository by running: | ||
|
|
||
| ```bash | ||
| git clone https://github.com/sdthaker/Node-TILify.git | ||
| ``` | ||
|
|
||
| To make sure node & npm are installed on your system, run: | ||
|
|
||
| ```bash | ||
| node -v | ||
| npm -v | ||
| ``` | ||
|
|
||
| Then run the following command from root directory to install the dependencies: | ||
|
|
||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| You can now run the program from the cloned repository's terminal to see how to use this tool: | ||
|
|
||
| ```bash | ||
| node src/index.js -h | ||
| ``` | ||
|
|
||
| _Optional_ - If you'd like to spin up a node server, open a terminal inside of the cloned repository, and install the node dependencies & spin up the server by running: | ||
|
|
||
| ```bash | ||
| npm install | ||
| npm run start | ||
| ``` | ||
|
|
||
| ## Pretty Print | ||
|
|
||
| To pretty print the entire project, run the following command: | ||
|
|
||
| ```bash | ||
| npm run prettier | ||
| ``` | ||
|
|
||
| ## Lint | ||
|
|
||
| To lint the entire project and check for errors/warnings, run the following command: | ||
|
|
||
| ```bash | ||
| npm run lint | ||
| ``` |
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
Oops, something went wrong.