JSRocksHQ / slush-es20xx

Full ECMAScript.next development and deployment workflow.
Other
6 stars 1 forks source link

Lint before building #3

Closed UltCombo closed 9 years ago

UltCombo commented 9 years ago

Right now, we have separate build and test tasks. The test tasks does linting of the source files and executes the unit tests in the transpiled files.

We don't need to transpile before linting the source files, so I believe it would make more sense to lint the source files (run JSHint and JSCS) before transpiling and abort the task if the linting fails.

The main pros are that this will provide a faster linting feedback in watch mode (when we get watch mode working), as linting errors will cause the task to fail faster -- that is, without having to wait for the transpiling task to conclude before linting source files.

The only issue I see is that this may affect separation of concerns, as part of the tests would then be part of the build task. I'll probably split the test task into a smaller (internal) "lint" task, this way we can use it as part of the build and test tasks.

//cc @jaydson

UltCombo commented 9 years ago

If I do this, then our test task would be an alias to mochaTest, which is unnecessary. I'm trying to find a reason to keep build and test tasks separate, but I can't think of any compelling reason:

That is, unit tests must build first, and builds should be tested. It might simplify things to have just one task.