From 60af5b9cf2c79638f088a32e5945813c9e9846c5 Mon Sep 17 00:00:00 2001 From: Rory Hunter Date: Thu, 7 Feb 2019 09:53:28 +0000 Subject: [PATCH] Make TSLint issues be warnings, not errors, when running `src-docs` (#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. --- CHANGELOG.md | 1 + src-docs/tslint.yaml | 2 ++ src-docs/webpack.config.js | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 src-docs/tslint.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dc0a0c3f4b..17213042653 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src-docs/tslint.yaml b/src-docs/tslint.yaml new file mode 100644 index 00000000000..f0c8f9c1897 --- /dev/null +++ b/src-docs/tslint.yaml @@ -0,0 +1,2 @@ +extends: ../tslint.yaml +defaultSeverity: warning diff --git a/src-docs/webpack.config.js b/src-docs/webpack.config.js index 58f74afa948..19e5f186ee1 100644 --- a/src-docs/webpack.config.js +++ b/src-docs/webpack.config.js @@ -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 }), ],