From 0987636281078962e8209d39a350e3bcef7b7d9f Mon Sep 17 00:00:00 2001 From: LimaSahibzada Date: Wed, 15 May 2024 23:29:23 +0430 Subject: [PATCH] added linters config --- .github/desktop.ini | Bin 0 -> 244 bytes .github/workflows/desktop.ini | Bin 0 -> 244 bytes .github/workflows/linters.yml | 56 ++++++++++++++++++++++++++++++++++ .hintrc | 18 +++++++++++ .stylelintrc.json | 22 +++++++++++++ 5 files changed, 96 insertions(+) create mode 100644 .github/desktop.ini create mode 100644 .github/workflows/desktop.ini create mode 100644 .github/workflows/linters.yml create mode 100644 .hintrc create mode 100644 .stylelintrc.json diff --git a/.github/desktop.ini b/.github/desktop.ini new file mode 100644 index 0000000000000000000000000000000000000000..49245f93911756a5076cb771e469c1d4253e157f GIT binary patch literal 244 zcmY+8y9&ZU5JgWd_z(F2Swyi=NTozlDO$P~A*>pRuDB|GzBf}CWSE`Dee4`??70wV z6-#ABQk2{{5jiqspnbHt;lY)HM!dj=J2_)xl+?!AX`j@+#H`il(k}39HAl{RD>-C8 wk0fj@q{BK-&q|zzxB8xy>Bgt_!PK6)esz{ptN$LoLm{1$>Z2SnVP>~}0eKQBUH||9 literal 0 HcmV?d00001 diff --git a/.github/workflows/desktop.ini b/.github/workflows/desktop.ini new file mode 100644 index 0000000000000000000000000000000000000000..49245f93911756a5076cb771e469c1d4253e157f GIT binary patch literal 244 zcmY+8y9&ZU5JgWd_z(F2Swyi=NTozlDO$P~A*>pRuDB|GzBf}CWSE`Dee4`??70wV z6-#ABQk2{{5jiqspnbHt;lY)HM!dj=J2_)xl+?!AX`j@+#H`il(k}39HAl{RD>-C8 wk0fj@q{BK-&q|zzxB8xy>Bgt_!PK6)esz{ptN$LoLm{1$>Z2SnVP>~}0eKQBUH||9 literal 0 HcmV?d00001 diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 0000000..5ead2d7 --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,56 @@ +name: Linters + +on: pull_request + +env: + FORCE_COLOR: 1 + +jobs: + lighthouse: + name: Lighthouse + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "18.x" + - name: Setup Lighthouse + run: npm install -g @lhci/cli@0.11.x + - name: Lighthouse Report + run: lhci autorun --upload.target=temporary-public-storage --collect.staticDistDir=. + webhint: + name: Webhint + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "18.x" + - name: Setup Webhint + run: | + npm install --save-dev hint@7.x + [ -f .hintrc ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/html-css/.hintrc + - name: Webhint Report + run: npx hint . + stylelint: + name: Stylelint + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "18.x" + - name: Setup Stylelint + run: | + npm install --save-dev stylelint@13.x stylelint-scss@3.x stylelint-config-standard@21.x stylelint-csstree-validator@1.x + [ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/html-css/.stylelintrc.json + - name: Stylelint Report + run: npx stylelint "**/*.{css,scss}" + nodechecker: + name: node_modules checker + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Check node_modules existence + run: | + if [ -d "node_modules/" ]; then echo -e "\e[1;31mThe node_modules/ folder was pushed to the repo. Please remove it from the GitHub repository and try again."; echo -e "\e[1;32mYou can set up a .gitignore file with this folder included on it to prevent this from happening in the future." && exit 1; fi diff --git a/.hintrc b/.hintrc new file mode 100644 index 0000000..59c08c2 --- /dev/null +++ b/.hintrc @@ -0,0 +1,18 @@ +{ + "connector": { + "name": "local", + "options": { + "pattern": ["**", "!.git/**", "!node_modules/**"] + } + }, + "extends": ["development"], + "formatters": ["stylish"], + "hints": [ + "button-type", + "disown-opener", + "html-checker", + "meta-charset-utf-8", + "meta-viewport", + "no-inline-styles:error" + ] +} diff --git a/.stylelintrc.json b/.stylelintrc.json new file mode 100644 index 0000000..dc50ca4 --- /dev/null +++ b/.stylelintrc.json @@ -0,0 +1,22 @@ +{ + "extends": ["stylelint-config-standard"], + "plugins": ["stylelint-scss", "stylelint-csstree-validator"], + "rules": { + "at-rule-no-unknown": null, + "scss/at-rule-no-unknown": [ + true, + { + "ignoreAtRules": [ + "tailwind", + "apply", + "variants", + "responsive", + "screen" + ] + } + ] + }, + "csstree/validator": true, + "ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css"] +} +