Run stylelint through npm.

This commit is contained in:
Joachim Bauch 2021-11-11 14:10:40 +01:00
parent ee50387938
commit 0524682efb
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02
5 changed files with 2180 additions and 15 deletions

View file

@ -30,11 +30,21 @@ jobs:
stylelint:
runs-on: ubuntu-latest
container: nextcloudci/stylelint:stylelint-1
name: stylelint
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Lint
run: ./run-stylelint.sh
run: npm run stylelint

View file

@ -1,7 +1,16 @@
{
"extends": ["stylelint-config-standard-scss"],
"rules": {
"alpha-value-notation": null,
"color-function-notation": null,
"hue-degree-notation": null,
"indentation": null,
"media-feature-name-no-unknown": true,
"media-feature-name-no-vendor-prefix": null,
"property-no-unknown": true,
"property-no-vendor-prefix": null,
"selector-class-pattern": null,
"selector-id-pattern": null,
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-element-no-unknown": true,
"selector-type-no-unknown": true,

2154
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,8 @@
"scripts": {
"build": "NODE_ENV=production webpack --progress --config webpack.js",
"dev": "NODE_ENV=development webpack --config webpack.js",
"lint": "eslint src"
"lint": "eslint src",
"stylelint": "stylelint css/*.css css/*.scss"
},
"dependencies": {
"@jaames/iro": "5.5.2",
@ -20,6 +21,8 @@
"devDependencies": {
"copy-webpack-plugin": "6.4.1",
"eslint": "8.2.0",
"stylelint": "14.0.1",
"stylelint-config-standard-scss": "^2.0.1",
"webpack": "4.46.0",
"webpack-cli": "4.9.1"
}

View file

@ -1,11 +0,0 @@
#!/bin/sh
set -e
STYLELINT=$(which stylelint || true)
if [ -z "$STYLELINT" ]; then
echo "Can't find command \"stylelint\" in $PATH"
exit 1
fi
echo Checking stylesheets with $STYLELINT ...
find . -name "*.*css" -print0 | xargs -0 $STYLELINT