-
-
Notifications
You must be signed in to change notification settings - Fork 681
feat(no-this-in-before-router-enter): create rule #1506
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
feat(no-this-in-before-router-enter): create rule #1506
Conversation
c283697
to
683c70a
Compare
683c70a
to
2870d51
Compare
## Rule Details | ||
|
||
Bad: | ||
```js |
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.
Should be html or vue.
|
||
## Rule Details | ||
|
||
Bad: |
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.
Use <eslint-code-block>
like any other docs to build your docs for online demos. You can try it locally with the npm run docs:watch
command.
> This rule prevents usage this in the "beforeRouteEnter" because this is undefined there. https://router.vuejs.org/guide/advanced/navigation-guards.html#in-component-guards | ||
|
||
## Rule Details | ||
|
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.
Could you write a description of the rule here? Documents should automatically update their headers and footers with the npm run update
command.
## When Not To Use It | ||
|
||
Give a short description of when it would be appropriate to turn off this rule. | ||
|
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.
If there is no content, delete it.
## When Not To Use It | |
Give a short description of when it would be appropriate to turn off this rule. |
filename: 'ValidComponent.vue', | ||
errors: [ | ||
{ | ||
message: rule.errorMessage |
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.
Would you test the location of the error, including line
and column
? Also, test the message
as text.
Co-authored-by: Yosuke Ota <[email protected]>
Co-authored-by: Yosuke Ota <[email protected]>
Update lib/rules/no-this-in-before-route-enter.js Co-authored-by: Yosuke Ota <[email protected]> Update docs/rules/no-this-in-before-route-enter.md Co-authored-by: Yosuke Ota <[email protected]>
…yslawjanpietrzak/eslint-plugin-vue into feat/no-this-in-before-route-enter
@ota-meshi I applied all of your suggestions. Thanks a lot for for it, it is my first PR so it was very helpful. |
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.
LGTM! Thank you for your contribution!
I would like to include this rule in the next release.
close #1417