From fe17202b2fa95f08ac4337a1700833f462f7d9e4 Mon Sep 17 00:00:00 2001 From: bryans-go Date: Sat, 12 Oct 2024 11:57:32 +0530 Subject: [PATCH 1/2] add workflows Signed-off-by: bryans-go --- .github/workflows/format.yml | 26 +++++++++++++++++++ .../{lint-and-format.yml => lint.yml} | 0 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/format.yml rename .github/workflows/{lint-and-format.yml => lint.yml} (100%) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..fa6ba68 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,26 @@ +name: Format + +on: + pull_request: + branches: + - main + +jobs: + format: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' # Use the Node.js version your project requires + + - 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 diff --git a/.github/workflows/lint-and-format.yml b/.github/workflows/lint.yml similarity index 100% rename from .github/workflows/lint-and-format.yml rename to .github/workflows/lint.yml From 5d29dd2ac300e42b60b64701da469602fb71cb73 Mon Sep 17 00:00:00 2001 From: bryans-go Date: Sat, 12 Oct 2024 12:02:33 +0530 Subject: [PATCH 2/2] update readme file Signed-off-by: bryans-go --- .github/workflows/format.yml | 4 ++-- CONTRIBUTING.md | 17 +++++++++++++++++ README.md | 17 +++++++++++++++++ eslint.config.mjs | 10 +++++----- 4 files changed, 41 insertions(+), 7 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index fa6ba68..74e3862 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -16,11 +16,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' # Use the Node.js version your project requires - 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 # Fail the workflow if formatting issues are found diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c15646..f11e667 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,6 +16,23 @@ Once you've forked the repository, clone it to your local machine. git clone https://github.com/YOUR-USERNAME/To-Do-List.git ``` +## Linting and Formatting + +This project uses **ESLint** and **Prettier** to ensure code quality and consistency. + +- **ESLint** helps identify and fix problems in your JavaScript code. +- **Prettier** automatically formats your code to follow consistent styling rules. + +### Running the Linter + +To check your code for issues, run the following command: + +```bash +npm run lint +``` + +This command will execute ESLint on your project files and report any errors or warnings. + ## Maintainers This project is actively maintained by: diff --git a/README.md b/README.md index 9aa8a83..0f5c1ef 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,23 @@ Open `index.html` in your browser to use the application. - **Edit a Task:** Click the edit icon next to the task, make your changes, and save. - **Delete a Task:** Click the delete icon next to the task. +## Linting and Formatting + +This project uses **ESLint** and **Prettier** to ensure code quality and consistency. + +- **ESLint** helps identify and fix problems in your JavaScript code. +- **Prettier** automatically formats your code to follow consistent styling rules. + +### Running the Linter + +To check your code for issues, run the following command: + +```bash +npm run lint +``` + +This command will execute ESLint on your project files and report any errors or warnings. + ## Contributing to Hacktoberfest 2024 🎉 ![hecktoberfest](https://github.com/user-attachments/assets/9352e904-6b2d-495e-8140-1437e385ffdb) diff --git a/eslint.config.mjs b/eslint.config.mjs index 73ef86f..925b6de 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -3,10 +3,10 @@ import pluginJs from '@eslint/js'; export default [ { - files: ["**/*.js"], - languageOptions: { - globals: globals.browser - } + files: ['**/*.js'], + languageOptions: { + globals: globals.browser, + }, }, - pluginJs.configs.recommended + pluginJs.configs.recommended, ];