[ci] check JavaScript code with biome tool#6711
Conversation
| [*.{py,sh,ps1,js,json,css}] | ||
| indent_size = 4 | ||
| line_length = 120 | ||
| max_line_length = 120 |
There was a problem hiding this comment.
| # Placeholder files | ||
| [{*.gitkeep,__init__.py}] | ||
| insert_final_newline = none |
There was a problem hiding this comment.
Unfortunately, biome fails to read the config here. Also, insert_final_newline=unset|off doesn't help.
configuration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× Failed to parse the .editorconfig file.
Caused by:
Custom("expected 'true' or 'false'")
Anyway, none is not allowed value in editorconfig, so these lines haven't actually worked.
| echo "Linting Python code" | ||
| bash ./.ci/lint-python.sh || exit 1 | ||
| echo "Linting Python and bash code" | ||
| bash ./.ci/lint-python-bash.sh || exit 1 |
There was a problem hiding this comment.
Due to recently added shellcheck in pre-commit hook.
| @@ -0,0 +1,21 @@ | |||
| { | |||
There was a problem hiding this comment.
biome toolbiome tool
jameslamb
left a comment
There was a problem hiding this comment.
Interesting! I'm so used to prettier in javascript projects, I'd never really tried anything else. biome looks interesting, and I'm glad we can install it from conda-forge.
I'm open to trying this, even though we only have about 70 lines of Javacsript in this repo... seems cheap to install and like it runs quickly. Thanks!
Yeah! I was really excited that we can avoid bringing nodejs ecosystem here for just one js-file (and some json-files). |
Co-authored-by: James Lamb <jaylamb20@gmail.com>
|
This pull request has been automatically locked since there has not been any recent activity since it was closed. |
biomeproject page: https://biomejs.dev/.I found it during reading the following article: https://blog.logrocket.com/eslint-adoption-guide/.
The most popular ESLint was too hard to configure (especially after the recent breaking changes: eslint/eslint#18391).
Some other alternatives like
standard,neostandardandjslintwere too aggressive with their feature of absence of configuration.So I think
biomeas all-in-one tool (linter+formatter) outside ofnodejsenvironment with easy configuration for non-frontenders is a good choice for LightGBM project.