diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index b64731a0..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,14 +0,0 @@ -/* eslint-env node */ -require('@rushstack/eslint-patch/modern-module-resolution') - -module.exports = { - root: true, - 'extends': [ - 'plugin:vue/vue3-essential', - 'eslint:recommended', - '@vue/eslint-config-prettier/skip-formatting' - ], - parserOptions: { - ecmaVersion: 'latest' - } -} diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 798c6f87..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "npm" - directory: "/" - target-branch: "master" - schedule: - interval: "weekly" - open-pull-requests-limit: 20 - versioning-strategy: "increase" - pull-request-branch-name: - separator: "-" - labels: - - "Dependabot" - commit-message: - prefix: "update" - - ignore: - - dependency-name: "*" - update-types: ["version-update:semver-major"] diff --git a/.github/greetings.yml b/.github/greetings.yml deleted file mode 100644 index c3453779..00000000 --- a/.github/greetings.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Greetings - -on: - issues: - types: [opened] - pull_request: - branches: [master] - types: [opened] - - -jobs: - check_for_first_interaction: - runs-on: ubuntu-latest - steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Welcome to the community πŸŽ‰, folks like you make Open Source meaningful. Firstly, thanks a lot for taking the time to go through the COC and CG and creating the issue according to the template. Hopefully, you have a good time over here. We will review your issue soon and take the necessary steps' - pr-message: 'Welcome to the community πŸŽ‰, folks like you fuel Open Source. Thanks for making your first PR Hope it follows CONTRIBUTING.md. We will review your PR soon, thanks for your time' diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 06262f30..d307c73d 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -121,4 +121,4 @@ jobs: github_api_call POST "issues/${pr_number}/comments" "{\"body\":\"$message\"}" echo "PR validation completed. Exit code: $exit_code" - exit $exit_code + exit $exit_code \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5a64e90f..1cb88642 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -103,6 +103,14 @@ Our website uses the following libraries: - [vue-i18n](https://www.npmjs.com/package/vue-i18n): This is an internationalization plugin for Vue.js - [vue-router](https://www.npmjs.com/package/vue-router): Vue Router is the official routing library for Vue.js +## Code Lint + +It's important to check your code for potential errors and adherence to coding standards. You can do this by running the linter with the following command: + +```bash +npm run lint +``` + ## Code Style Before push your contribution, ensure that your code is properly formatted. You can automatically @@ -137,6 +145,7 @@ pull request or create an issue. β”œβ”€β”€ SECURITY.md: A document detailing the security practices of the project, including how to report vulnerabilities and security issues β”œβ”€β”€ babel.config.cjs: Configuration file for Babel, a JavaScript compiler, specifying how to transform modern JavaScript code into a backward-compatible version β”œβ”€β”€ default.conf: Nginx configuration file, specifying settings such as ports, routes, and other parameters +β”œβ”€β”€ eslint.config.cjs: Configuration file for ESLint β”œβ”€β”€ index.html: The main HTML file that serves as the entry point for the web application, containing the structure and layout of the webpage β”œβ”€β”€ package.json: A file that contains metadata about the project, including dependencies, scripts, and project configuration for Node.js applications β”œβ”€β”€ public diff --git a/README.md b/README.md index 565c3385..d4c7036f 100644 --- a/README.md +++ b/README.md @@ -25,14 +25,14 @@ cd ihr-website Note: - you can use [nvm](https://github.com/nvm-sh/nvm) to switch between node versions as per your need -Install all the npm packages. Go to root directory and type the following command to install all npm packages +#### Install all the npm packages. ```bash npm install ``` -For compilations and hot-reloads in development +#### For compilations and hot-reloads in development ```bash npm run dev @@ -50,6 +50,12 @@ npm run build npm run lint ``` +#### To format files + +```bash +npm run format +``` + ## Deploy with Docker To deploy the project with Docker, follow these steps: @@ -79,10 +85,11 @@ Replace `` with the port on your host machine where you want to expos First off, thanks for taking the time to contribute! πŸŽ‰πŸŽ‰ -When contributing to this repository, please first discuss the change you wish to make via issue with the maintainers of this repository before making a change. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. +Before you start, please follow these guidelines: -1. Solve the issues which are listed -2. Create your own issue and then send PR. +1. **Solve Existing Issues**: If you find an existing issue that you would like to work on, please discuss it with the maintainers before starting to solve it. This ensures that everyone is on the same page regarding the approach and scope of the solution. +2. **Create a New Issue**: If you have an idea for a new feature or have identified a bug that is not listed, please discuss it with the maintainers before creating a new issue. Providing context and details will help us understand the importance of your suggestion. +3. **Pull Requests (PRs)**: Please note that PRs that are not assigned to contributors and are not related to an open issue will be closed automatically. Please refer to the project's style and contribution guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow. The basic workflow: diff --git a/eslint.config.cjs b/eslint.config.cjs new file mode 100644 index 00000000..9b5ab0d9 --- /dev/null +++ b/eslint.config.cjs @@ -0,0 +1,36 @@ + +const globals = require("globals") +const pluginVue = require("eslint-plugin-vue") +const js = require("@eslint/js") + + +module.exports = [ + ...pluginVue.configs['flat/recommended'], + { + files: ["**/*.{vue,js,jsx,cjs,mjs}"], + ignores: ["**/tests/*"], + languageOptions: { + ecmaVersion: 2022, + sourceType: "module", + globals: { + ...globals.browser, + ...globals.node, + myCustomGlobal: "readonly" + }, + }, + rules: { + "vue/no-v-html": "off", + "vue/multi-word-component-names": "off", + "vue/require-prop-types": "off", + "vue/require-default-prop": "off", + "vue/no-template-shadow": "off", + "vue/require-explicit-emits": "off", + "vue/no-useless-template-attributes": "off", + "vue/return-in-emits-validator": "off", + "vue/no-side-effects-in-computed-properties": "off", + "vue/no-v-text-v-html-on-component": "off", + // ...js.configs.recommended.rules, + + }, + } +] diff --git a/package.json b/package.json index b27678aa..11e2ea25 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", - "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore", + "lint": "npx eslint --format stylish --fix", "format": "prettier --write src/", "test": "jest --verbose" }, @@ -29,12 +29,13 @@ }, "devDependencies": { "@babel/preset-env": "^7.26.0", + "@eslint/js": "^9.14.0", "@quasar/vite-plugin": "^1.8.0", - "@rushstack/eslint-patch": "^1.10.4", "@vitejs/plugin-vue": "^5.1.4", "@vue/eslint-config-prettier": "^10.1.0", "eslint": "^9.14.0", "eslint-plugin-vue": "^9.30.0", + "globals": "^15.12.0", "jest": "^29.7.0", "joi": "^17.13.3", "prettier": "^3.3.3", diff --git a/src/App.vue b/src/App.vue index aecb9155..a2806008 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,7 +9,7 @@ import LocalStorageBanner from './components/LocalStorageBanner.vue' let scrollPosition = ref(0) const showScrollTopButton = () => { - return scrollPosition > 0 + return scrollPosition.value > 0 } const scrollToTop = () => { @@ -20,7 +20,7 @@ const scrollToTop = () => { } const updateScrollPosition = () => { - scrollPosition = window.scrollY + scrollPosition.value = window.scrollY } onMounted(() => { @@ -33,19 +33,19 @@ onBeforeUnmount(() => {