Skip to content

Commit

Permalink
Run lintwithexclusions on travis builds
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Raimist <[email protected]>
  • Loading branch information
aaronraimist committed Oct 13, 2018
1 parent 59cdb38 commit 8b73afc
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .eslintignore.errorfiles
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# autogenerated file: run scripts/generate-eslint-error-ignore-file to update.

src/components/structures/VectorHomePage.js
src/vector/index.js
src/vector/modernizr.js
test/app-tests/joining.js
test/app-tests/loading.js
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ install:
# clone the deps with depth 1: we know we will only ever need that one
# commit.
- scripts/fetch-develop.deps.sh --depth 1 && npm install
script:
- npm run test
- npm run lintwithexclusions
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"start:prod": "npm run build:js-sdk && npm run build:react-sdk && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n js-sdk,react-sdk,reskindex,res,riot-js \"npm run start:js-sdk:prod\" \"npm run start:react-sdk:prod\" \"npm run reskindex:watch\" \"npm run start:res\" \"npm run start:js:prod\"",
"lint": "eslint src/",
"lintall": "eslint src/ test/",
"lintwithexclusions": "eslint --max-warnings 20 --ignore-path .eslintignore.errorfiles src test",
"clean": "rimraf lib webapp electron_app/dist",
"prepublish": "npm run clean && npm run build:compile",
"test": "karma start --single-run=true --autoWatch=false --browsers ChromeHeadless",
Expand Down
21 changes: 21 additions & 0 deletions scripts/generate-eslint-error-ignore-file
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
#
# generates .eslintignore.errorfiles to list the files which have errors in,
# so that they can be ignored in future automated linting.

out=.eslintignore.errorfiles

cd `dirname $0`/..

echo "generating $out"

{
cat <<EOF
# autogenerated file: run scripts/generate-eslint-error-ignore-file to update.
EOF

./node_modules/.bin/eslint --no-ignore -f json src test |
jq -r '.[] | select((.errorCount) > 0) | .filePath' |
sed -e 's/.*riot-web\///';
} > "$out"
4 changes: 2 additions & 2 deletions src/vector/platform/VectorBasePlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export default class VectorBasePlatform extends BasePlatform {
// This needs to be in in a try block as it will throw
// if there are more than 100 badge count changes in
// its internal queue
let bgColor = "#d00",
notif = this.notificationCount;
let bgColor = "#d00";
let notif = this.notificationCount;

if (this.errorDidOccur) {
notif = notif || "×";
Expand Down

0 comments on commit 8b73afc

Please sign in to comment.