Skip to content

Commit

Permalink
Feat: Lint minified JavaScript #1275
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed May 13, 2024
1 parent 41568d7 commit 11d2c82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
17 changes: 10 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ umask 0022
VERSION=$(grep " VERSION" CMakeLists.txt | sed 's/ VERSION //')
COPYRIGHT="myMPD ${VERSION} | (c) 2018-2024 Juergen Mang <[email protected]> | SPDX-License-Identifier: GPL-3.0-or-later | https://github.com/jcorporation/mympd"

MYMPD_MINIFY_JS="1"
if [ -f .git/HEAD ] && ! grep -q "master" .git/HEAD
# Minify JavaScript only for master branch
if [ -z "${MYMPD_MINIFY_JS+x}" ]
then
MYMPD_MINIFY_JS="0"
MYMPD_MINIFY_JS="1"
if [ -f .git/HEAD ] && ! grep -q "master" .git/HEAD
then
MYMPD_MINIFY_JS="0"
fi
fi

#check for command
Expand Down Expand Up @@ -1219,6 +1223,8 @@ run_eslint() {
then
return 1
fi
# Enforce minification of JavaScript
MYMPD_MINIFY_JS=1
createassets
rc=0
echo ""
Expand Down Expand Up @@ -1656,10 +1662,7 @@ case "$ACTION" in
echo " terms_export: Exports the terms to poeditor.com"
echo ""
echo "Check options:"
echo " check: runs cppcheck, flawfinder and clang-tidy on source files"
echo " following environment variables are respected"
echo " - CPPCHECKOPTS=\"-q --force --enable=warning\""
echo " - FLAWFINDEROPTS=\"-m3 --quiet --dataonly\""
echo " check: runs clang-tidy on source files"
echo " check_file: same as check, but for one file, second arg must be the file"
echo " check_docs checks the documentation for missing API methods"
echo " check_includes: checks for valid include paths"
Expand Down
3 changes: 2 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ export default [
"no-unused-vars": "off",
"no-useless-concat": "off",
"no-var": "error",
"prefer-const": "error"
"prefer-const": "error",
"jsdoc/require-jsdoc": "off"
}
}
];

0 comments on commit 11d2c82

Please sign in to comment.