Skip to content
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

add some rules #3

Open
6 of 9 tasks
anbraten opened this issue May 31, 2021 · 6 comments
Open
6 of 9 tasks

add some rules #3

anbraten opened this issue May 31, 2021 · 6 comments

Comments

@anbraten
Copy link
Contributor

anbraten commented May 31, 2021

@lukashass
Copy link
Member

@lukashass
Copy link
Member

declare variable before using it

Isn't this handled by typescript?

@anbraten
Copy link
Contributor Author

anbraten commented Jul 1, 2021

declare variable before using it

Isn't this handled by typescript?

@lukashass It wasn't the last time I checked it. Anyways, Typescript should not be responsible for these kind of code quality checking as that stops the build from passing which is quite annoying while developing.

@anbraten
Copy link
Contributor Author

anbraten commented Jul 1, 2021

@anbraten What do you think of https://eslint.org/docs/rules/func-style#expression?

@lukashass IDK. The first sample seems to be quite restrictive and would require us to change a lot of code as we often use function xyz(){] inside vue setup.

@lukashass
Copy link
Member

declare variable before using it

Isn't this handled by typescript?

@lukashass It wasn't the last time I checked it. Anyways, Typescript should not be responsible for these kind of code quality checking as that stops the build from passing which is quite annoying while developing.

@anbraten Should be handled by eslint now (978fb72).

@lukashass
Copy link
Member

@anbraten What do you think of https://eslint.org/docs/rules/func-style#expression?

@lukashass IDK. The first sample seems to be quite restrictive and would require us to change a lot of code as we often use function xyz(){] inside vue setup.

Just though it would be nice for consistency and this would have fixed some "use before define" issues as well:

The primary difference between function declarations and function expressions is that declarations are hoisted to the top of the scope in which they are defined, which allows you to write code that uses the function before its declaration.

But that is now restricted by @typescript-eslint/no-use-before-define

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants