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

Lint-fixing examples can break them #33

Open
edg2s opened this issue May 19, 2020 · 1 comment
Open

Lint-fixing examples can break them #33

edg2s opened this issue May 19, 2020 · 1 comment

Comments

@edg2s
Copy link
Member

edg2s commented May 19, 2020

In plugin-mediawiki we have two tests:

new OO.ui.ButtonWidget( { classes: ["foo"] } )
new OO.ui.ButtonWidget( { "classes": ["foo"] } )

The quoted key case gets fixed to be identical to the one above.

In this particular case it can just be noDoc'd but in other cases this may not be appropriate.

Lint-fixing can be turned off globally but that too may not be desirable.

Possible solutions:

  • Add a per rule noDocFix option
  • Restrict fixing to just whitespace fixes
  • Have a mode where eslint-docgen reports lint errors in examples, but doesn't fix them. Properly this would be a pre-processing plugin.
  • Warn when duplicate tests are detected
@edg2s
Copy link
Member Author

edg2s commented May 27, 2020

Added "Warn when duplicate tests are detected". This warning could suggest possible solutions.

edg2s added a commit that referenced this issue May 30, 2020
edg2s added a commit that referenced this issue May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant