New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: update typescript-eslint monorepo to v4 (major) #6233
Conversation
9554817
to
30b5b95
Compare
30b5b95
to
8518302
Compare
We need to replace |
@@ -40,6 +40,8 @@ describe('example-passport-login acceptance test', () => { | |||
*/ | |||
before(() => MockTestOauth2SocialApp.startMock()); | |||
after(MockTestOauth2SocialApp.stopMock); | |||
|
|||
// eslint-disable-next-line mocha/handle-done-callback | |||
before(async function setupApplication(this: Mocha.Context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a false alarm from mocha
plugin. The rule should only apply to done
instead of this
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please open a bug report for the mocha
plugin or perhaps send a pull request to fix the problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8518302
to
3061262
Compare
d6e0071
to
bbcc6fc
Compare
Regarding the first commit message:
Can you please wrap rule names in backticks to make them easier to read + get better formatting in the generated changelog?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good, I have few comments to discuss. PTAL 👇🏻
* } | ||
* ``` | ||
*/ | ||
'mocha/handle-done-callback': 'off', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to disable this rule in @loopback/eslint-config
, to fix the problem for all consumers, including our loopback4-example-shopping and the IBM products we are working on.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially had the change in eslint-config
but I think it's too invasive. The usage of (this: Mocha.Context)
signature is probably not very common. I prefer to leave it out for now.
@@ -7,6 +7,7 @@ import {generateUniqueId} from './unique-id'; | |||
|
|||
export type BindingAddress<T = unknown> = string | BindingKey<T>; | |||
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | |||
export class BindingKey<ValueType> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which value is not used here? Is it ValueType
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Unused type parameters are checked now by the rule.
@@ -20,6 +20,7 @@ interface ResponseWithContent extends ResponseObject { | |||
} | |||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |||
function isResponseObject(c: any): c is ResponseWithContent { | |||
// eslint-disable-next-line no-prototype-builtins | |||
return !!c?.hasOwnProperty('content') && !!c.content; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly here.
return !!c?.hasOwnProperty('content') && !!c.content; | |
return c && Object.prototype.hasOwnProperty.call(c, 'content') && !!c.content; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
SourceWithRelations extends Entity, | ||
Target extends Entity | ||
>( | ||
export function flattenTargetsOfOneToOneRelation<Target extends Entity>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the first of two parameters can break existing code, we must be careful here.
I assume most places in our codebase are leveraging type inference provided by the compiler, so no change is needed there. The places passing two parameters (SourceWithRelations
, Target
) will be found by the compiler and trigger compilation errors, so that should be easy to handle too.
However: is flattenTargetsOfOneToOneRelation
a part of our public API? If yes, then we need to communicate this change to our users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did search references of flattenTargetsOfOneToOneRelation
and it's only used internally. There is no mentioning in our docs either. Please also note that even our code does not explicitly provide the generic parameter types.
For this case, I think it's fine to fix it without bearing the extra overhead.
53dbdad
to
bc0aa30
Compare
@bajtos PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏🏻
To make the auto-generated release notes more useful, I am proposing to change the first commit message from - chore: update typescript-eslint monorepo to v4
+ feat: update typescript-eslint monorepo to v4 At the moment, https://github.com/strongloop/loopback-next/blob/master/packages/eslint-config/CHANGELOG.md is full of "version bump only" entries, completely hiding the actual changes we are making in some of the releases. |
Signed-off-by: Renovate Bot <bot@renovateapp.com>
…lint 4.x BREAKING CHANGE: typescript-eslint 4.x introduces some breaking changes. The following are impacted: - decorator functions are correctly honored as usage of defined variables - @typescript-eslint/no-shadow replaces no-shadow Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
The mocha plugin incorretly reports the following signature as a violation of `mocha/handle-done-callback` (misinterpreting `this` as `done`). ```ts before(async function setupApplication(this: Mocha.Context) { this.timeout(6000); // ... }); ``` See lo1tuma/eslint-plugin-mocha#270 Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
bc0aa30
to
d7a1e6a
Compare
This PR contains the following updates:
^3.10.1
->^4.0.1
^3.10.1
->^4.0.1
^3.10.1
->^4.0.1
^3.10.1
->^4.0.1
Release Notes
typescript-eslint/typescript-eslint
v4.0.1
Compare Source
Bug Fixes
v4.0.0
Compare Source
Bug Fixes
Features
ts-expect-error
toallow-with-description
(#2351) (a3f163a), closes #2146strictNullChecks
turned on (#2345) (9273441)consistent-type-imports
rule (#2367) (58b1c2d)BREAKING CHANGES
typescript-estree: - removes the ability to supply a
RegExp
toprojectFolderIgnoreList
, and changes the meaning of the string value from a regex to a glob.Removed AST_NODE_TYPES.Import. This is a minor breaking change as the node type that used this was removed ages ago.
eslint-plugin: Default rule options is a breaking change.
3.10.1 (2020-08-25)
Bug Fixes
Renovate configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻️ Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by WhiteSource Renovate. View repository job log here.