To improve the quality of an existing project
by establishing useful workflows that make the development process more efficient.
In order to complete this task, you are given an existing JavaScript project that has:
- API calls to
CRUD
an item - API call to
authenticate
a user
- Fork this repo on your GitHub account and start working.
-
Clone the project
-
npm install
to install node modules. -
npm run build
to build the project. -
npm run preview
to run in Production mode and this should be on a different terminal. -
npm run dev
to run in Development mode and this should be on a different terminal.
- Integrate the
Prettier
package and add a script callformat
for it in the package.json file - Integrate the
HUSKY
package and make sure that it works and run the pre-hooks before any commit - Integrate the
ESLint
package and add a script calledlint
for it in the package.json file - Integrate the
JEST
package and add a script calledtest
for it in the package.json file
- Tab Width should be
4 spaces
- Quotes should be
single quotes
- Make sure that you have
pretty-quick
installed - Use a working version for
husky
- Use
airbnb
eslint styleguide as your default styleguide in the config - Add a
lint
script to lint all your code andlint-fix
script to automatically fix the project lint issues to your package.json
- The
logInUser
function returns a valid token when provided with valid credentials - The
logoutUser
function clears the token from browser storage - The
createPost
function creates a new item on the API (You need to check if the item is created from the API response)
- The
login
form validates user inputs correctly based on API restrictions - The
create
item form validates user inputs correctly based on API restrictions - The
logout
button logs the user out when clicked
Please create a branch call it workflow
to work during the CA on and deliver an open Pull Request
from branch workflow
into master
.
Please post your PR to the peer review forum and review 2 other submissions.
- https://blog.bitsrc.io/add-prettier-to-your-project-d7e91ac03d05
- https://eslint.org/ and https://eslint.org/docs/latest/user-guide/getting-started
- https://www.linkedin.com/learning/eslint-integrating-with-your-workflow/solution-add-eslint-to-a-project?u=43268076
- https://www.youtube.com/watch?v=FgnxcUQ5vho
- https://www.linkedin.com/learning/end-to-end-javascript-testing-with-cypress-io/