Repository navigation
style(lib): implements Neostandard for codebase styling guide - #250
Merged
Merged
Conversation
bjohansebas
self-requested a review
April 1, 2026 17:55
UlisesGascon
approved these changes
Jun 13, 2026
| run: ${{ matrix.node-version == '18' && 'npm test' || 'npm run test-ci' }} | ||
|
|
||
| - name: Lint code | ||
| if: matrix.node-version >= '22' |
Member
There was a problem hiding this comment.
I am comfortable with this workaround! We just need the linter to run once "technically"
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds and implements Neostandard for styling the codebase. It changes no behaviors, including how we were linting markdown files, no rules have been deprecated/eliminated in this migration, they now just live under Neostandard's implementation (or added explicitly in one case).
It follows the same conventions used in
iconv-liteexcept for quotes (iconv-liteuses double quotes).ESlint dependencies needed upgrading and/or removal, for instance the old
eslint-plugin-markdownhas been replaced by@eslint/markdownandeslinthas been upgraded to version 9.xI removed
.eslintrc.ymland.eslintignorefiles and replaced them witheslint.config.mjsto follow the new ESlint version formats.The config:
neostandard()as the base ruleset, covers all previously configured rules exceptno-consoleno-console: erroris kept explicitly (neostandard intentionally omits it as a project preference)describe,test,expect,beforeAll, etc.) declared fortest/**/*.jscoverage/,.nyc_output/) moved from.eslintignoreinto the config@eslint/markdown'sprocessorconfig (equivalent to the oldplugin:markdown/recommended+processor: 'markdown/markdown') to lint JS code blocks inside.mdfilesno-path-concat(removed from ESLint 9 core) is now enforced asn/no-path-concatviaeslint-plugin-neol-last,no-trailing-spaces, etc.) are now under the@stylistic/prefix, managed by@stylistic/eslint-pluginno-multiple-empty-linesis now slightly stricter: also enforcesmaxBOF: 0(no empty lines at the beginning of a file)n/handle-callback-erris newly enforced by Neostandard (was not in the previous config)For the code style changes:
eslint --fixfollowingiconv-litestyle.lib/hbs.jsandlib/async.jsto comply with neostandard'scamelcaserule:else ifbrace style inlib/async.jsmoved to same line as closing}(@stylistic/brace-style)/\-/g→/-/ginlib/hbs.js(no-useless-escape)cb('Async Title')→cb(null, 'Async Title')intest/async_helpers.test.js(n/no-callback-literal)closes #224
edit: One (or two) big caveats I realized only after opening the PR:
A new version of Vite (version 7) is being used under the hood by
vitest, and since it uses rolldown which uses thestyleTextAPI fromnode:utilthat was only added in Node.js 20.12, it was breaking CI on Node 18 and 19. To fix this I tried pinningvitestto a specific version, but the true fix was actually to overrideviteto version6.0.0.Another issue is Neostandard transitively depends on
find-up, which in its current version is an ESM-only package. Node.js only gained the ability to require() ESM modules in version 22, so loading neostandard's config crashes on anything older, the fix was to skip the linting step completely for Node versions < 22.Let me know your thoughts about this, I didn't want to drop support for some Node.js versions just because of devDependencies. But I'm not sure exactly how to proceed @UlisesGascon @bjohansebas.