Skip to content

Commit

Permalink
Make TSLint issues be warnings, not errors, when running src-docs (#…
Browse files Browse the repository at this point in the history
…1538)

Now that we've merged #1529, all TypeScript files will trigger lint
warnings if their formatting needs updating with Prettier (which can be
done by fixing with the linter). So far, so good.

However, the Webpack config for `src-docs` pulls in the project's
TypesScript and TSLint settings, meaning that Webpack won't compile any TS
files that have lint problems. We don't need checking at this stage to be
so strict, because the pre-commit hook and general lint task already check
everything.

So, in order to stop docs development from being annoying, I've customised
the TSLint settings when running `src-docs` so that lint problems are now
warnings, instead of errors. They'll still have to get fixed before
committing.
  • Loading branch information
pugnascotia authored Feb 7, 2019
1 parent a353518 commit 60af5b9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

- Fixed `EuiSearchBar.Query` match_all query string must be `*` ([#1521](https://github.com/elastic/eui/pull/1521))
- Fixed `EuiSuperDatePicker` crashing with negative relative value ([#1537](https://github.com/elastic/eui/pull/1537))
- Make TSLint issues be warnings, not errors, when running `src-docs` ([#1537](https://github.com/elastic/eui/pull/1537))

## [`6.10.0`](https://github.com/elastic/eui/tree/v6.10.0)

Expand Down
2 changes: 2 additions & 0 deletions src-docs/tslint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extends: ../tslint.yaml
defaultSeverity: warning
2 changes: 1 addition & 1 deletion src-docs/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module.exports = {
// run TypeScript and tslint during webpack build
new ForkTsCheckerWebpackPlugin({
tsconfig: path.resolve(__dirname, '..', 'tsconfig.json'),
tslint: path.resolve(__dirname, '..', 'tslint.yaml'),
tslint: path.resolve(__dirname, 'tslint.yaml'),
async: false, // makes errors more visible, but potentially less performant
}),
],
Expand Down

0 comments on commit 60af5b9

Please sign in to comment.