-
Notifications
You must be signed in to change notification settings - Fork 72
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 code examples #864
Comments
I've actually enabled eslint on code blocks last week via #861, so this should be done already (for js/json/ts code blocks at least) Note that this introduces a new problem, we often don't have fully valid code in the code blocks so as part of that PR I had to move some JSON code blocks to
I don't think that would be possible, not without too much hustle. If we want that, the code blocks should be moved to regular code files with proper extension and included in the markdown (as we do with some examples in crawlee). Using this approach would also unlock any other kind of linting, including whatever we want to use on python code. |
@B4nan - Oh, cool! Let's keep this open to make sure we add Python. But JS is a huge step. |
Hi, sorry for the late answer, I had to overlook this. We use Ruff for the Python projects (which is both linter & formatter). I did a quick research and unfortunately, neither linting nor code formatting of markdown code blocks is supported, yet. Here is the open issue - astral-sh/ruff#3792. In the opened issue someone links the PR astral-sh/ruff#9030. However, it only adds support for linting & formatting the code blocks inside Python docstrings, not code blocks in markdown documents. |
Every code example should be linted (+editorconfig applied) to follow Apify code formatting guidelines.
The text was updated successfully, but these errors were encountered: