From tslint 5, lint applies
no-unused-expression more strictly. This affects
test assertion written via
chai, as its
expect assertion is form of expression caught by lint.
tslint-no-unused-expression-chai provides drop-in replacement of rule
no-unused-expression to loosen lint checker for chai's assertion.
This module supports chai's
expect based assertion (i.e
"should" to the rule configuration, it also supports those assertios.
Other type of property based assertion still may not work.
This has a peer dependencies of
tslint@5.*.* and implicit dependency of
typescript, which will have to be installed as well
npm install --save-dev tslint-no-unused-expression-chai
You can configure tslint rules by replacing existing
"rules"://accepts all options of"no-unused-expression-chai": true..."rulesDirectory":"tslint-no-unused-expression-chai"...
Alternatively you can just extend the configuration preset provided by this package. It disables
no-unused-expression and enables
Building / Testing
Few npm scripts are supported for build / test code. As this rule is simple override to default rules, it doesn't have own unit test coverage but borrows test fixture from original rule.
build: Transpiles code to ES5 commonjs to
test: Run tests.
lint: Run lint over all codebases
lint:staged: Run lint only for staged changes. This'll be executed automatically with precommit hook.
commit: Commit wizard to write commit message