NPM exit code 1

the problem that build is succeeded

  1. I’ve tried
test:
  pre:
    - set -eo pipefail && npm run lint
  1. and tried luck with npm run lint || exit 1 # Manually Failing a Deployment - #2 by alexey

  2. and process.exit(1); since my codebase in js

  3. and moved script to dependencies: post as proposed here https://discuss.circleci.com/t/fail-fast-stop-running-tests-on-first-failure/1356/8?u=andreishostik

  4. and finally wrote a script as described here Build not failing even test exit with code 1

dependencies:
  post:
    - |
      set -e
      exitcode=$?
      npm run lint
      if [ "$exitcode" != "0" ]; then exit 1; fi

in spec - https://circleci.com/docs/1.0/manually/#overview - you can find an info about exit codes:

Failing commands (those with a non-zero exit code) will cause the whole build to fail, and you’ll receive a notification

but it’s not like it was described, unfortunately I cannot provide a link to a build as the project is private only an screenshot:

External Media

as you can see a lint task returns exit 1 but build doesn’t fail. from another side I’ve tried return exit code 1 directly, and finally it works:

External Media

but not in script :angry: wtf

…it drives me nuts