Let eslint use .gitignore file

There is a well documented issue when using eslint with a folder that
already has subprojects checked out.  A quick perusing of the eslint
documentation shows that the eslintignore files happily accept a
.gitignore file as its input.  Considering there might be repos that
already have put a .eslintignore file in place, rely on that if it
exists, if it doesn't, fall back to .gitignore if it exists.

While here, this exposed another issue that we were missing the
--format=json command, and there were cases where eslint would make a
mistake.

Tested:
Ran on bmcweb repo with subprojects checked out.  Observed build
succeeded.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iafab1d4d9e80a093a13b4c5a758a1f68bc37138c
1 file changed