Add CI checking for css files

This commit is contained in:
Chocobo1 2021-05-27 15:29:46 +08:00
parent 553ba0437b
commit 5d4f1ddc01
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
4 changed files with 64 additions and 0 deletions

27
.github/workflows/ci.yaml vendored Normal file
View File

@ -0,0 +1,27 @@
name: CI
on: [pull_request, push]
jobs:
main:
runs-on: ubuntu-20.04
steps:
- name: checkout repository
uses: actions/checkout@v2
- name: setup nodejs
uses: actions/setup-node@v2
with:
node-version: '14'
- name: install tools
run: npm install
- name: lint code
run: npm run lint
- name: format code
run: |
npm run format
git diff --exit-code

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules
package-lock.json

17
.stylelintrc.json Normal file
View File

@ -0,0 +1,17 @@
{
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-order"
],
"rules": {
"color-hex-length": null,
"comment-empty-line-before": null,
"comment-whitespace-inside": null,
"declaration-colon-newline-after": null,
"function-name-case": null,
"length-zero-no-unit": null,
"no-descending-specificity": null,
"value-keyword-case": null,
"order/properties-alphabetical-order": true
}
}

18
package.json Normal file
View File

@ -0,0 +1,18 @@
{
"name": "qBittorrent-website",
"description": "qBittorrent website",
"repository": {
"type": "git",
"url": "https://github.com/qbittorrent/qBittorrent-website.git"
},
"scripts": {
"format": "prettier --write **.css",
"lint": "stylelint **/*.css"
},
"devDependencies": {
"prettier": "*",
"stylelint": "*",
"stylelint-config-standard": "*",
"stylelint-order": "*"
}
}