Skip to content

Commit fe11ae7

Browse files
committed
Run lintwithexclusions on travis builds
Signed-off-by: Aaron Raimist <aaron@raim.ist>
1 parent 70fe4f6 commit fe11ae7

File tree

5 files changed

+34
-2
lines changed

5 files changed

+34
-2
lines changed

.eslintignore.errorfiles

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# autogenerated file: run scripts/generate-eslint-error-ignore-file to update.
2+
3+
src/components/structures/VectorHomePage.js
4+
src/vector/index.js
5+
src/vector/modernizr.js
6+
test/app-tests/joining.js
7+
test/app-tests/loading.js

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ install:
2222
# clone the deps with depth 1: we know we will only ever need that one
2323
# commit.
2424
- scripts/fetch-develop.deps.sh --depth 1 && npm install
25+
script:
26+
- npm run test
27+
- npm run lintwithexclusions

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"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\"",
5555
"lint": "eslint src/",
5656
"lintall": "eslint src/ test/",
57+
"lintwithexclusions": "eslint --max-warnings 20 --ignore-path .eslintignore.errorfiles src test",
5758
"clean": "rimraf lib webapp electron_app/dist",
5859
"prepublish": "npm run clean && npm run build:compile",
5960
"test": "karma start --single-run=true --autoWatch=false --browsers ChromeHeadless",
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
#
3+
# generates .eslintignore.errorfiles to list the files which have errors in,
4+
# so that they can be ignored in future automated linting.
5+
6+
out=.eslintignore.errorfiles
7+
8+
cd `dirname $0`/..
9+
10+
echo "generating $out"
11+
12+
{
13+
cat <<EOF
14+
# autogenerated file: run scripts/generate-eslint-error-ignore-file to update.
15+
16+
EOF
17+
18+
./node_modules/.bin/eslint --no-ignore -f json src test |
19+
jq -r '.[] | select((.errorCount) > 0) | .filePath' |
20+
sed -e 's/.*riot-web\///';
21+
} > "$out"

src/vector/platform/VectorBasePlatform.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export default class VectorBasePlatform extends BasePlatform {
6060
// This needs to be in in a try block as it will throw
6161
// if there are more than 100 badge count changes in
6262
// its internal queue
63-
let bgColor = "#d00",
64-
notif = this.notificationCount;
63+
let bgColor = "#d00";
64+
let notif = this.notificationCount;
6565

6666
if (this.errorDidOccur) {
6767
notif = notif || "×";

0 commit comments

Comments
 (0)