Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix Lint problems with --fix in Firebase Functions

I'ved got a firebase Function code that has quite a lot of Lint problems. How can I fix these with --fix. It was shown at the end of the error message.

firebase deploy

/Users/xxx/firebase/functions/index.js
  16:1   error  Unexpected tab character                             no-tabs
  16:1   error  Expected indentation of 6 spaces but found 1 tab     indent
  .....
  69:1   error  Unexpected tab character                             no-tabs
  69:1   error  Expected indentation of 6 spaces but found 1 tab     indent
  69:5   error  Trailing spaces not allowed                          no-trailing-spaces
  69:5   error  Block must not be padded by blank lines              padded-blocks
  71:1   error  Trailing spaces not allowed                          no-trailing-spaces

✖ 157 problems (157 errors, 0 warnings)
  45 errors and 0 warnings potentially fixable with the `--fix` option.
like image 497
Axil Avatar asked Jun 26 '21 07:06

Axil


Video Answer


1 Answers

The error message probably is coming from eslint. You can run eslint directly:

$ (cd functions && npx eslint . --fix)
# or
$ (cd functions && node_modules/eslint/bin/eslint.js . --fix)
like image 76
Daniel L Avatar answered Nov 15 '22 00:11

Daniel L