To-do list Microverse! project is a repository consisting of the following files:
- HTML file
- CSS file
- JS files
- HTML, CSS, and JS linters file
The repository also contains files for setting up linters and validators.
To Do list: add & remove
- Set up a new project with Webpack
- Create an index.html file and
- To-Do List placeholder (div or ul element).
- The index.html file must be set as a template using the HTML Webpack Plugin.
- Create an index.js file and set an array of some simple to do tasks (array of objects). Each task object contains three keys:
- description [string].
- completed [bool].
- index: [number].
- A function to iterate over the tasks array and populate an HTML list item element for each task.
- On page load render the dynamically created list of tasks in the dedicated placeholder. The list appear in order of the index values for each task.
- Create a style.css and set rules for the To-Do List. CSS must be loaded by Webpack Style/CSS Loader. -All hardcoded items deleted from the tasks array. List structure #1.
- A new JavaScript file for the new functionality created.
- A function for adding a new task is implemented
- A function for deleting a task is implemented
- A function for editing task descriptions. implemented
- By default new tasks wil have the property completed set to false and the property index set to the value of the new array length (i.e. if you're adding a 5th task to the list, the index of that task will be equal to 5).
- Deleting a task will update all remaining items' indexes, so they represent the current list order and are unique(i.e. if you're deleting the first task index 1 from the list, the index of the next task(2) will set to 1)..
- A new JavaScript file is added and imported as a module:
- It contain methods related to the status updates (completed: true / false).
- Add event listener to the checkbox (change).
- Items object's value for completed key will updated upon user actions.
- A function for the "Clear all completed" is implemented - button (filter() method used).
- The updated array of items will be stored in local storage, so the user gets the correct list of values after the page reloads (which means that any changes made to the list will be preserved).
- The output of the app
To get a local copy up and running, follow these steps.
Clone this repository to your desired folder:
cd my-folder git clone [email protected]:myaccount/my-project.git
In order to run this project you need:
- gitHub account;
- git installed on your OS.
https://github.com/microverseinc/linters-config/tree/master/html-css-js
- Installations required to run this project:
- Run the following command:
npm install webpack webpack-cli --save-dev
- Run the following command:
npm install --save-dev html-webpack-plugin
- Run the following command:
npm install --save-dev style-loader css-loader
- Run the following command:
npm install --save-dev webpack-dev-server
- Run the following command:
npm install --save-dev [email protected]
- Run the following command:
npm install --save-dev [email protected] [email protected] [email protected] [email protected]
- Run
npm install --save-dev [email protected] [email protected] [email protected] [email protected]
You can use this project by cloning it to your folder and changing index.html and styles.css files.
To run tests, run the following commands:
To track linter errors locally follow these steps:
Download all the dependencies run:
npm install
Track HTML linter errors run:
npx hint .
Track CSS linter errors run
npx stylelint "**/*.{css,scss}"
Track JavaScript linter errors run:
npx eslint .
You can redeploy this project by adding new lines of code to source files.
- GitHub: Benawi
To Do list: interactive list this will be added.
Contributions, issues, and feature requests are welcome!
Give me βοΈ If you like this project!
- I would like to thank Microverse program for providing me this great chance.
This project is MIT licensed.