The new ones are spurrious unused-variable warnings for things only used
in types; we need to figure out how to fix these at some point, but this
doesn't represent an actually regression and I don't want to debug it
right now.
The number of warnings is up by 3, because each use of globalGrains
triggers another undefined variable warning.
eslint had actually detected 4 additional warnings; this also fixes the
one we can easily do something about.
As-written the function is called with nothing bound to `this`, so this
would probably just throw an exception. But clearly the intent was to
use the parameter.
Caught this via an unused variable warning.
A migration is just a function that takes a SandstormDb and a backend,
but the majority of these functions don't actually use the backend.
This patch updates our eslint config to allow silencing an unused
argument warning by prefixing the argument with an underscore, then uses
this throughout migrations.js. This way we can start cutting down on
the noise.
This also re-enables the remaining eslint:recommended rules, in
warn-only mode. Ideally these will all be gone someday, but in the
meantime let's have CI tell us if we're getting colder.
Fixes#3188
Nothing of substance has really changed in the bodies of the tests
themselves; they are the same except for some find & replace changes
like:
s/test.isTrue/chai.assert.isOk/g
...but they pass now.
This also adds explicit imports & exports for the `SandstormPermissions`
global, and adds a side-effect only import of another module to the
tests. This was done now because:
* Unless we pass `--full-app` to `meteor test`, meteor does not
implicitly load all of our modules.
* Passing `--full-app` runs into problems trying to start the smtp
server on startup, because our code is written to assume it was passed
FDs by the gateway, but `meteor test` is running it in a more
conventional fashion.
* It was easier to just fix the imports (which is what we want to do
long term anyway) than to fight with `--full-app`.
This also turns the tests back on in CI.
These issues were caught by eslint and fixed:
- In a couple places were were setting global variables without
explicitly declaring them. We now actually declare variables for
these. One such case was of the form 'Foo = class Foo {', and is
now just 'class Foo {', since the assignment was redundant anyway.
- A few files that used said globals did not explicitly import them; now
they do.
- In once place we were using what is apparently deprecated syntax
for octal literals. We now use the current 0oXXX syntax.