From 5d213bc6980f39a13ef5b8bb736a6ea572773340 Mon Sep 17 00:00:00 2001 From: bryans-go Date: Sat, 12 Oct 2024 12:35:06 +0530 Subject: [PATCH 1/5] lint and format setup Signed-off-by: bryans-go --- .github/workflows/format.yml | 7 +++++-- .github/workflows/lint.yml | 13 +++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 74e3862..0b85c6c 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,6 +1,9 @@ name: Format on: + push: + branches: + - main pull_request: branches: - main @@ -16,11 +19,11 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: '16' # Use the Node.js version your project requires + node-version: '16' - name: Install dependencies run: npm install - name: Run Prettier to check formatting run: npm run prettier -- --check - continue-on-error: false # Fail the workflow if formatting issues are found + continue-on-error: false diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f144430..e880dfd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,12 +1,15 @@ -name: Lint and Format +name: Lint on: + push: + branches: + - main pull_request: branches: - main jobs: - lint-and-format: + lint: runs-on: ubuntu-latest steps: @@ -16,13 +19,11 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: '16' # or whichever version your project requires + node-version: '16' - name: Install dependencies run: npm install - - name: Run Prettier to check formatting - run: npm run format -- --check - - name: Run ESLint to check for linting issues run: npm run lint + continue-on-error: false From 674d29705716be4c9e1d3118bc17b53a1cf35d26 Mon Sep 17 00:00:00 2001 From: bryans-go Date: Sat, 12 Oct 2024 12:37:00 +0530 Subject: [PATCH 2/5] fix Signed-off-by: bryans-go --- .github/workflows/format.yml | 2 +- .github/workflows/lint.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 0b85c6c..8437d2a 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: '16' + node-version: '20' - name: Install dependencies run: npm install diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e880dfd..79ce8c2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: '16' + node-version: '20' - name: Install dependencies run: npm install From 8a96dc84c9c777aa02bdc74d1c1982ebed70a8d0 Mon Sep 17 00:00:00 2001 From: bryans-go Date: Sat, 12 Oct 2024 12:44:41 +0530 Subject: [PATCH 3/5] fix lint Signed-off-by: bryans-go --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index a9b006b..19b8339 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "format": "prettier --write .", + "prettier": "prettier --check .", "lint": "eslint ." }, "keywords": [], From 52b5daa3b92e9f871385a0b48a891614f821bd5b Mon Sep 17 00:00:00 2001 From: bryans-go Date: Sat, 12 Oct 2024 12:50:00 +0530 Subject: [PATCH 4/5] add format to guide Signed-off-by: bryans-go --- CONTRIBUTING.md | 10 ++++++++++ README.md | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f11e667..0ff6873 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,6 +33,16 @@ npm run lint This command will execute ESLint on your project files and report any errors or warnings. +### Running the Formatter + +To format your code, run the following command: + +```bash +npm run format +``` + +This command will execute Prettier on your project files and apply consistent formatting according to the rules defined in your configuration. + ## Maintainers This project is actively maintained by: diff --git a/README.md b/README.md index 0f5c1ef..adef21e 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,16 @@ npm run lint This command will execute ESLint on your project files and report any errors or warnings. +### Running the Formatter + +To format your code, run the following command: + +```bash +npm run format +``` + +This command will execute Prettier on your project files and apply consistent formatting according to the rules defined in your configuration. + ## Contributing to Hacktoberfest 2024 🎉 ![hecktoberfest](https://github.com/user-attachments/assets/9352e904-6b2d-495e-8140-1437e385ffdb) From cc03b4468ef8495f67544c891d740e4f776d4ffb Mon Sep 17 00:00:00 2001 From: bryans-go Date: Sat, 12 Oct 2024 14:24:41 +0530 Subject: [PATCH 5/5] fix lint Signed-off-by: bryans-go --- script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script.js b/script.js index cd9cd73..1787956 100644 --- a/script.js +++ b/script.js @@ -28,13 +28,14 @@ function addTodo() { updateTodoList(); } +// eslint-disable-next-line no-unused-vars function deleteTodo(index) { // Remove the specific todo from the list todoList.splice(index, 1); localStorage.setItem('todoList', JSON.stringify(todoList)); updateTodoList(); } - +// eslint-disable-next-line no-unused-vars function editTodo(index) { let inputNameElement = document.querySelector('.js-name-input'); let inputDateElement = document.querySelector('.js-date-input');