Commit 9a555221 authored by Mark Florian's avatar Mark Florian

Merge branch 'slashmanov/restrict-private-instance-next-tick' into 'master'

Add an eslint rule to restrict component instance $nextTick usage

See merge request gitlab-org/gitlab!79108
parents 6803d6a7 2c3fad40
......@@ -95,7 +95,8 @@ rules:
order: ignore
overrides:
- files:
- '**/spec/**/*'
- 'ee/spec/frontend*/**/*'
- 'spec/frontend*/**/*'
rules:
'@gitlab/require-i18n-strings': off
'@gitlab/no-runtime-template-compiler': off
......@@ -103,6 +104,8 @@ overrides:
- error
- selector: CallExpression[callee.object.name=/(wrapper|vm)/][callee.property.name="setData"]
message: 'Avoid using "setData" on VTU wrapper'
- selector: MemberExpression[object.type!='ThisExpression'][property.type='Identifier'][property.name='$nextTick']
message: 'Using $nextTick from a component instance is discouraged. Import nextTick directly from the Vue package.'
- files:
- 'config/**/*'
- 'scripts/**/*'
......
......@@ -121,7 +121,7 @@ describe('IDE clientside preview', () => {
it('pings usage success', async () => {
dispatchCodesandboxReady();
await wrapper.vm.$nextTick();
await nextTick();
expect(storeClientsideActions.pingUsage).toHaveBeenCalledTimes(2);
expect(storeClientsideActions.pingUsage).toHaveBeenCalledWith(
expect.anything(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment