Skip to content
Snippets Groups Projects
Unverified Commit aeec0f41 authored by Michael Kriese's avatar Michael Kriese Committed by GitHub
Browse files

chore: enforce ts as cast (#16164)

parent 07b98a90
No related branches found
No related tags found
No related merge requests found
......@@ -71,11 +71,17 @@ module.exports = {
// disallow direct `nock` module usage as it causes memory issues.
// disallow `parse-link-header` to allow override ENV https://github.com/thlorenz/parse-link-header#environmental-variables
// disallow `path` in favor of `upath`
'no-restricted-imports': [
2,
{ paths: ['nock', 'parse-link-header', 'path'] },
],
'@typescript-eslint/consistent-type-assertions': [
'error',
{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' },
],
// Makes no sense to allow type inference for expression parameters, but require typing the response
'@typescript-eslint/explicit-function-return-type': [
'error',
......
......@@ -11,6 +11,7 @@ Follow these best practices when you're working on our code.
- Always add unit tests for full code coverage
- Only use `istanbul` comments for unreachable code coverage that is needed for `codecov` completion
- Use descriptive `istanbul` comments
- Avoid cast or prefer `x as T` instead of `<T>x` cast.
```ts
// istanbul ignore next: can never happen
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment