-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #23 by adding linters and pre-commit hook
Rename prettier config file Add README.md Update values for semi, tabWidth, and add new props Add information about ways to contribute Add link to CONTRIBUTION.md Update formatting, scripts, and dependencies Update tabwidth Add recommended extensions Add default settings for browser Update prettierignore Add eslintignore Add husky configuration Add eslint configuration add lintstaged config Update precommit settings Refactored and reformatted using linters Reformatted using prettier Ignore webpack, css, and json files Update command
- Loading branch information
1 parent
5c613b3
commit 7dbea09
Showing
25 changed files
with
10,303 additions
and
6,642 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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
{ | ||
"plugins": [ | ||
"@babel/syntax-dynamic-import", | ||
"@babel/plugin-syntax-import-assertions" | ||
], | ||
"sourceType": "module", | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"modules": false | ||
} | ||
] | ||
"plugins": [ | ||
"@babel/syntax-dynamic-import", | ||
"@babel/plugin-syntax-import-assertions" | ||
], | ||
"sourceType": "module", | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"modules": 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,9 @@ | ||
# Ignore artifacts: | ||
build | ||
node_modules | ||
.* | ||
dist | ||
*.md | ||
webpack.config.js | ||
*.json | ||
*.css |
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,45 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": ["airbnb-base", "prettier"], | ||
"overrides": [], | ||
"parser": "@babel/eslint-parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"no-duplicate-imports": ["error", { "includeExports": true }], | ||
"no-invalid-regexp": "error", | ||
"no-this-before-super": "error", | ||
"no-unexpected-multiline": "warn", | ||
"no-unused-vars": "error", | ||
"no-use-before-define": "error", | ||
"accessor-pairs": "error", | ||
"arrow-body-style": ["error", "as-needed"], | ||
"camelcase": ["error", { "ignoreImports": true }], | ||
"func-name-matching": "error", | ||
"no-confusing-arrow": "warn", | ||
"no-empty": "warn", | ||
"no-empty-function": "error", | ||
"no-useless-call": "error", | ||
"no-useless-catch": "error", | ||
"no-useless-return": "warn", | ||
"no-var": "error", | ||
"prefer-arrow-callback": "warn", | ||
"require-await": "warn", | ||
"no-trailing-spaces": [ | ||
"error", | ||
{ "skipBlankLines": true, "ignoreComments": true } | ||
], | ||
"import/extensions": "off", | ||
"no-console": "off", | ||
"import/no-cycle": "off", | ||
"no-nested-ternary": "off", | ||
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }], | ||
"array-callback-return": "off" | ||
} | ||
} |
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" | ||
|
||
npm run pre-commit |
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 @@ | ||
{ | ||
"*": "npx eslint --fix" | ||
} |
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,6 @@ | ||
# Ignore artifacts: | ||
build | ||
node_modules | ||
.git | ||
.* | ||
dist | ||
*.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,8 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": true, | ||
"bracketSpacing": true, | ||
"arrowParens": "always" | ||
} |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
{ | ||
"recommendations": [ | ||
"esbenp.prettier-vscode", | ||
"dbaeumer.vscode-eslint", | ||
"eamodio.gitlens" | ||
] | ||
} |
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,15 +1,15 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Launch Program", | ||
"skipFiles": ["<node_internals>/**"], | ||
"program": "${workspaceFolder}/build/index.js" | ||
} | ||
] | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Launch Program", | ||
"skipFiles": ["<node_internals>/**"], | ||
"program": "${workspaceFolder}/build/index.js" | ||
} | ||
] | ||
} |
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 @@ | ||
{ | ||
"editor.tabSize": 2, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true, | ||
"files.eol": "\n" | ||
} |
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,104 @@ | ||
# Contributing to Siteit | ||
|
||
Thank you for showing interest in contributing to Siteit. | ||
|
||
We encourage all sorts of contributions, whether your changes improve the source code or enhance the documentation. Please read [Table of Contents](#table-of-contents) to get started. | ||
|
||
--- | ||
|
||
## Table of Contents | ||
- [Code Contribution](#code-contribution) | ||
- [Reporting Bugs](#reporting-bugs) | ||
- [Suggesting Enhancements](#suggesting-enhancements) | ||
- [Improving the Documentation](#improving-the-documentation) | ||
- [Styleguides](#styleguides) | ||
- [Commit Messages](#commit-messages) | ||
|
||
--- | ||
|
||
### Code Contribution | ||
This section is to help developers set up Siteit locally on their machines for development. | ||
|
||
#### Getting Started | ||
|
||
#### Pre-requisites | ||
|
||
Make sure you have the following technologies installed on your machine: | ||
- [Node](https://nodejs.org/en/download/)current LTS version. | ||
- [npm](https://docs.npmjs.com/about-npm#use-npm-to---) current release. | ||
|
||
An easy to way to test if you already have the above technologies installed is by running the following commands: | ||
```node | ||
node -v | ||
npm -v | ||
``` | ||
If you have `node` and `npm` installed, the above commands will print the installed `version` information. | ||
|
||
_If you get an error message, please install the missing technology._ | ||
|
||
**Note**: | ||
We recommend installing the [current LTS version of [`node`](https://nodejs.org/en/download/) for your operating system to test and develop Siteit without complications. | ||
|
||
#### Getting Started | ||
- [`fork`](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the Siteit on Github. | ||
- Use `git clone` to `clone` the forked repo to your local machine | ||
- `cd` into the cloned directory, and create a new `branch` for your changes. | ||
- Run `npm link` to run Siteit locally on your machine | ||
- Run `npm start` to start Siteit | ||
|
||
##### About `npm start` | ||
This script builds the source code using `babel`, and starts an instance of `siteit` on your machine. | ||
|
||
#### Making Changes | ||
*Note:* | ||
- Make all your changes in a new `git` `branch`. Learn more about creating branches [here](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging) | ||
- Make changes only in the `src` folder | ||
|
||
To run Siteit locally with changes you introduced to the source code, you need to run the following script: | ||
```node | ||
npm run build | ||
``` | ||
Running the above script will compile the code using `babel` and output in the `build` folder. | ||
|
||
_Modify the files in `src` folder, as files within the `build` folder are overwritten when the source code is compiled using `babel`._ | ||
|
||
##### Starting the Project | ||
Assuming you ran the `npm link` previously as instructed, run `npm run start` to start Siteit locally. Alternatively, you can start the project by running `node ./build/index.js` from the command line. | ||
|
||
##### Statically Generated Content | ||
If you ran the tool using options that accepts a `source` as an `argument`, the rendered HTML will can be found in the `dist` under `root`. | ||
|
||
#### Formatting and Error Checking | ||
Frequently check your code for formatting and other problems using the following commands: | ||
|
||
`npm run prettier:check` | ||
Running the above script will run tests to check for formatting errors in the `src` folder, using `prettier`. | ||
|
||
`npm run lint` | ||
Running the above script will run tests to check for problems in the code using `ESLint`. | ||
|
||
--- | ||
|
||
To automatically apply the changes detected by using `prettier` and `ESLint`, use the following scripts: | ||
|
||
```node | ||
npm run prettier:format | ||
npm run lint:fix | ||
``` | ||
|
||
--- | ||
|
||
**Note:** | ||
If you push changes without running checks for formatting and problems in code, the `husky` `pre-commit` `hook` will automatically apply the changes before pushing your changes remotely to GitHub. | ||
|
||
|
||
### Reporting Bugs | ||
_WIP_ | ||
### Suggesting Enhancements | ||
_WIP_ | ||
### Improving the Documentation | ||
_WIP_ | ||
### Styleguides | ||
_WIP_ | ||
### Commit Messages | ||
_WIP_ |
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.