balena-io-modules/node-balena-lint

balena-lint --fix wiped files

Opened this issue · 0 comments

Version: 6.1.1

npx balena-lint --fix seems to have wiped a number of files clean after encountering a syntax error in one of the files:

> @balena/jellyfish-plugin-default@18.0.0 lint-fix /home/josh/git/product-os/jellyfish-plugin-default
> balena-lint --fix lib test

SyntaxError: Expression expected. (28:2)
  26 |                  actions,
  27 |          }),
> 28 |  }
     |  ^
  29 | }
  30 |
    at e (/home/josh/git/product-os/jellyfish-plugin-default/node_modules/prettier/parser-typescript.js:1:322)
    at /home/josh/git/product-os/jellyfish-plugin-default/node_modules/prettier/parser-typescript.js:22:3248894
    at Object.parse (/home/josh/git/product-os/jellyfish-plugin-default/node_modules/prettier/parser-typescript.js:22:3248927)
    at Object.parse$a [as parse] (/home/josh/git/product-os/jellyfish-plugin-default/node_modules/prettier/index.js:13684:19)
    at coreFormat (/home/josh/git/product-os/jellyfish-plugin-default/node_modules/prettier/index.js:15215:16)
    at formatWithCursor$1 (/home/josh/git/product-os/jellyfish-plugin-default/node_modules/prettier/index.js:15455:14)
    at /home/josh/git/product-os/jellyfish-plugin-default/node_modules/prettier/index.js:60228:12
    at Object.format (/home/josh/git/product-os/jellyfish-plugin-default/node_modules/prettier/index.js:60248:12)
    at /home/josh/git/product-os/jellyfish-plugin-default/node_modules/@balena/lint/build/balena-lint.js:94:44
    at async Promise.all (index 89) {
  loc: { start: { line: 28, column: 2 } },
  codeFrame: '\x1B[0m \x1B[90m 26 |\x1B[39m \t\t\tactions\x1B[33m,\x1B[39m\x1B[0m\n' +
    '\x1B[0m \x1B[90m 27 |\x1B[39m \t\t})\x1B[33m,\x1B[39m\x1B[0m\n' +
    '\x1B[0m\x1B[31m\x1B[1m>\x1B[22m\x1B[39m\x1B[90m 28 |\x1B[39m \t}\x1B[0m\n' +
    '\x1B[0m \x1B[90m    |\x1B[39m \t\x1B[31m\x1B[1m^\x1B[22m\x1B[39m\x1B[0m\n' +
    '\x1B[0m \x1B[90m 29 |\x1B[39m }\x1B[0m\n' +
    '\x1B[0m \x1B[90m 30 |\x1B[39m\x1B[0m'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @balena/jellyfish-plugin-default@18.0.0 lint-fix: `balena-lint --fix lib test`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @balena/jellyfish-plugin-default@18.0.0 lint-fix script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.