fix all linting errors except 'no-use-before-define', since these might
cause merge conflicts if mixed in with the other error fixes.
fixed remaining linting errors.