mirror of
https://github.com/FreeTubeApp/FreeTube
synced 2024-11-23 10:21:59 +01:00
3db6f437c9
* Add Stylelint plugin and rule for evaluating use of logical properties * Implement stylelint-advised use of logical properties in SCSS files * Implement stylelint-advised use of logical properties in CSS files * Implement stylelint linting before each commit to any branch of the repo * Remove other Stylelint plugins so that we can add them in later one-by-one After discussing this with the FreeTube team, it seems that we are still undecided on which rules we want to be active, including ones currently enabled. As a stopgap fix, we disabled Stylelint checking in our pre-commit Git hook and our recommended > freetube@0.19.0 lint-fix > run-p eslint-fix lint-style-fix command. With this change, we will be using Stylelint in our > freetube@0.19.0 lint-fix > run-p eslint-fix lint-style-fix command, while giving us the flexibility to add in additional desired plugins and rules as separate efforts. * Add video player to .stylelintignore * Replace non-logical property usage in templates This is not enforced by the plugin at this time. * Remove use of logical properties from ft-video-player, & allow empty input when .stylelintignore files are changed * Update ft-video-player.css to disable use of logical property linter We want to avoid introducing directionality-specific properties that could muck up the video player. * Remove redundant/unnecessary scripts in package.json
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
# Refer for explanation to following link:
|
|
# https://github.com/evilmartians/lefthook/blob/master/docs/full_guide.md
|
|
pre-commit:
|
|
parallel: true
|
|
commands:
|
|
eslint:
|
|
# Only runs when any file with filename
|
|
# matching the glob is being committed
|
|
glob: "*.{js,vue}"
|
|
run: yarn run eslint --no-color {staged_files}
|
|
skip:
|
|
- rebase
|
|
stylelint:
|
|
glob: "*.{css,scss}"
|
|
run: yarn stylelint --no-color --allow-empty-input {staged_files}
|
|
skip:
|
|
- rebase
|
|
|
|
# EXAMPLE USAGE
|
|
#
|
|
# pre-push:
|
|
# commands:
|
|
# packages-audit:
|
|
# tags: frontend security
|
|
# run: yarn audit
|
|
# gems-audit:
|
|
# tags: backend security
|
|
# run: bundle audit
|
|
#
|
|
# pre-commit:
|
|
# parallel: true
|
|
# commands:
|
|
# eslint:
|
|
# glob: "*.{js,ts}"
|
|
# run: yarn eslint {staged_files}
|
|
# rubocop:
|
|
# tags: backend style
|
|
# glob: "*.rb"
|
|
# exclude: "application.rb|routes.rb"
|
|
# run: bundle exec rubocop --force-exclusion {all_files}
|
|
# govet:
|
|
# tags: backend style
|
|
# files: git ls-files -m
|
|
# glob: "*.go"
|
|
# run: go vet {files}
|
|
# scripts:
|
|
# "hello.js":
|
|
# runner: node
|
|
# "any.go":
|
|
# runner: go run
|