eslint --fix

This commit is contained in:
David Baker 2021-07-01 20:43:05 +01:00
parent e3201eb20f
commit ee9be5438e
6 changed files with 301 additions and 344 deletions

View file

@ -1,15 +0,0 @@
# autogenerated file: run scripts/generate-eslint-error-ignore-file to update.
src/Markdown.js
src/NodeAnimator.js
src/components/structures/RoomDirectory.js
src/components/views/rooms/MemberList.js
src/utils/DMRoomMap.js
src/utils/MultiInviter.js
test/components/structures/MessagePanel-test.js
test/components/views/dialogs/InteractiveAuthDialog-test.js
test/mock-clock.js
src/component-index.js
test/end-to-end-tests/node_modules/
test/end-to-end-tests/element/
test/end-to-end-tests/synapse/

View file

@ -45,7 +45,7 @@
"start:all": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n build,reskindex \"yarn start:build\" \"yarn reskindex:watch\"", "start:all": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n build,reskindex \"yarn start:build\" \"yarn reskindex:watch\"",
"start:build": "babel src -w -s -d lib --verbose --extensions \".ts,.js\"", "start:build": "babel src -w -s -d lib --verbose --extensions \".ts,.js\"",
"lint": "yarn lint:types && yarn lint:js && yarn lint:style", "lint": "yarn lint:types && yarn lint:js && yarn lint:style",
"lint:js": "eslint --max-warnings 0 --ignore-path .eslintignore.errorfiles src test", "lint:js": "eslint --max-warnings 0 src test",
"lint:types": "tsc --noEmit --jsx react", "lint:types": "tsc --noEmit --jsx react",
"lint:style": "stylelint 'res/css/**/*.scss'", "lint:style": "stylelint 'res/css/**/*.scss'",
"test": "jest", "test": "jest",

View file

@ -1,23 +0,0 @@
#!/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 -f json src test |
jq -r '.[] | select((.errorCount + .warningCount) > 0) | .filePath' |
sed -e 's/.*matrix-react-sdk\///';
} > "$out"
# also append rules from eslintignore file
cat .eslintignore >> $out

View file

@ -120,7 +120,6 @@ describe('MessagePanel', function() {
return events; return events;
} }
// make a collection of events with some member events that should be collapsed // make a collection of events with some member events that should be collapsed
// with a MemberEventListSummary // with a MemberEventListSummary
function mkMelsEvents() { function mkMelsEvents() {

View file

@ -48,23 +48,22 @@ const j$ = {};
j$.Clock = function() { j$.Clock = function() {
function Clock(global, delayedFunctionSchedulerFactory, mockDate) { function Clock(global, delayedFunctionSchedulerFactory, mockDate) {
let self = this, const self = this;
realTimingFunctions = { const realTimingFunctions = {
setTimeout: global.setTimeout, setTimeout: global.setTimeout,
clearTimeout: global.clearTimeout, clearTimeout: global.clearTimeout,
setInterval: global.setInterval, setInterval: global.setInterval,
clearInterval: global.clearInterval, clearInterval: global.clearInterval,
}, };
fakeTimingFunctions = { const fakeTimingFunctions = {
setTimeout: setTimeout, setTimeout: setTimeout,
clearTimeout: clearTimeout, clearTimeout: clearTimeout,
setInterval: setInterval, setInterval: setInterval,
clearInterval: clearInterval, clearInterval: clearInterval,
}, };
installed = false, let installed = false;
delayedFunctionScheduler, let delayedFunctionScheduler;
timer; let timer;
self.install = function() { self.install = function() {
if (!originalTimingFunctionsIntact()) { if (!originalTimingFunctionsIntact()) {
@ -181,7 +180,6 @@ j$.Clock = function() {
return Clock; return Clock;
}(); }();
j$.DelayedFunctionScheduler = function() { j$.DelayedFunctionScheduler = function() {
function DelayedFunctionScheduler() { function DelayedFunctionScheduler() {
const self = this; const self = this;
@ -328,7 +326,6 @@ j$.DelayedFunctionScheduler = function() {
return DelayedFunctionScheduler; return DelayedFunctionScheduler;
}(); }();
j$.MockDate = function() { j$.MockDate = function() {
function MockDate(global) { function MockDate(global) {
const self = this; const self = this;
@ -418,4 +415,3 @@ export function clock() {
return _clock; return _clock;
} }