Skip to content

Commit

Permalink
[#213][CSS/Pre-commit] Add stylelint and remove csslint.
Browse files Browse the repository at this point in the history
This is the (main) reason they are not compatible:
CSSLint/csslint#792.
  • Loading branch information
pishoyg committed Oct 8, 2024
1 parent dd5ee96 commit 21dd272
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 48 deletions.
40 changes: 0 additions & 40 deletions .csslintrc

This file was deleted.

12 changes: 8 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ repos:
types: [file]

# CSS
- repo: https://github.com/pre-commit/mirrors-csslint
rev: v1.0.5
- repo: local
hooks:
- id: csslint
- id: stylelint
name: stylelint
entry: npx stylelint
language: system
types: [css]
args: [--fix, --color, --report-invalid-scope-disables, --report-needless-disables]

- repo: local
hooks:
Expand All @@ -87,7 +91,7 @@ repos:
name: json-tool
entry: pre-commit/json-tool.sh
language: system
files: (.csslintrc|\.json)$
files: \.json$
types: [file]
exclude: tsconfig\.json$

Expand Down
5 changes: 5 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"stylelint-config-standard"
]
}
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ bin_install: FORCE
npm_install: FORCE
npm install \
--save-dev \
"typescript"
"typescript" \
"stylelint"

pip_install: requirements.txt
python -m pip install --upgrade pip $${PIP_FLAGS}
Expand Down
6 changes: 3 additions & 3 deletions stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source .helpers
# shellcheck disable=SC2016
readonly COMMIT_MESSAGE='[Stats] Run `make stats`.'

readonly KNOWN_EXTENSIONS="Makefile css csslintrc env_INFO helpers gitignore yamlfmt yamllint json mjs keylayout md plist py sh strings txt yaml toml ts html"
readonly KNOWN_EXTENSIONS="Makefile css env_INFO helpers gitignore yamlfmt yamllint json mjs keylayout md plist py sh strings txt yaml toml ts html"
readonly KNOWN_EXTENSIONS_ARCHIVE="gitignore java js md proto py sh sql vba"
readonly KNOWN_ARCHIVE_SUBDIRS="bible dictionary ipa-transliteration unicode-converters"

Expand Down Expand Up @@ -229,7 +229,7 @@ LOC_DOT=$(loc . -name ".gitignore" )
LOC_KEYBOARD_LAYOUT=$(loc . -a \( -name "*.keylayout" -o -name "*.plist" -o -name "*.strings" \) )
LOC_TXT=$(loc . -name "*.txt")
LOC_TS=$(loc . -name "*.ts")
LOC_JSON=$(loc . -a \( -name "*.json" -o -name ".csslintrc" \) )
LOC_JSON=$(loc . -name "*.json" )
LOC_HTML=$(loc . -name "*.html")
readonly TOTAL_BY_LANG="$((
Expand Down Expand Up @@ -261,7 +261,7 @@ FOC_DOT=$(foc_count . -name ".gitignore" )
FOC_KEYBOARD_LAYOUT=$(foc_count . -a \( -name "*.keylayout" -o -name "*.plist" -o -name "*.strings" \) )
FOC_TXT=$(foc_count . -name "*.txt")
FOC_TS=$(foc_count . -name "*.ts")
FOC_JSON=$(foc_count . -a \( -name "*.json" -o -name ".csslintrc" \) )
FOC_JSON=$(foc_count . -name "*.json" )
FOC_HTML=$(foc_count . -name "*.html")
readonly TOTAL_FOC="$((
Expand Down

0 comments on commit 21dd272

Please sign in to comment.