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

Improve documentation about TypeScript parser for ESLint #131

Open
mindyourlifeguide opened this issue Dec 13, 2022 · 6 comments
Open

Improve documentation about TypeScript parser for ESLint #131

mindyourlifeguide opened this issue Dec 13, 2022 · 6 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers preset:react

Comments

@mindyourlifeguide
Copy link

Rule effector/mandatory-scope-binding not working - no warnings/errors
Example: https://stackblitz.com/edit/effector-vite-react-template-2sj3r3?file=src%2Fapplication.tsx

@mindyourlifeguide mindyourlifeguide changed the title effector/mandatory-scope-binding not working Rule: effector/mandatory-scope-binding not working Dec 13, 2022
@igorkamyshev
Copy link
Member

As I see, you did scope binding in this case 👇

Screenshot 2022-12-14 at 05 18 06

What do you expect?

@mindyourlifeguide
Copy link
Author

Below i use event directly

@mindyourlifeguide
Copy link
Author

line 29

@igorkamyshev
Copy link
Member

ESLint does not run in your repro because it cannot parse the config file due to a typo.

Screenshot 2022-12-15 at 12 23 37

However, even if you fix it, ESLint will be still broken 🤗
Screenshot 2022-12-15 at 12 31 02

Also, Stackblitz by default does not highlight eslint issues, so I suggest running pnpm eslint src/**/*.{ts,tsx} to get a correct output.

The next issue with this repro is an invalid parser. effector/mandatory-scope-binding requires type information to run checks, so, you have to use @typescript-eslint/parser.

So, I've resolved all issues in the repro:

  1. Fix typo in eslint config
  2. Make eslint config plain JSON
  3. Add proper parser

Screenshot 2022-12-15 at 12 34 15

I assume, we can improve documentation to highlight the last issue about proper parser 🤗 thanks for the report.

@igorkamyshev igorkamyshev added documentation Improvements or additions to documentation good first issue Good for newcomers labels Dec 15, 2022
@mindyourlifeguide
Copy link
Author

But even after making changes, it doesn't work.

@igorkamyshev
Copy link
Member

You did not setup parser properly.

image

@igorkamyshev igorkamyshev changed the title Rule: effector/mandatory-scope-binding not working Improve documentation about TypeScript parser for ESLint Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers preset:react
Projects
None yet
Development

No branches or pull requests

2 participants