Skip to content

introduce mxlint.io functions for javascript rules - #90

Merged
xiwenc merged 6 commits into
mainfrom
feature/readfile
Jan 9, 2026
Merged

xiwenc merged 6 commits into
mainfrom
feature/readfile

Conversation

@xiwenc

@xiwenc xiwenc commented Jan 9, 2026 •

Copy link
Copy Markdown
Member

fixes #89

The mxlint object provides utility functions for JavaScript rules:

  • mxlint.io.readfile(path): Reads a file and returns its contents as a string.
    The path is resolved relative to the workingDirectory.
  • mxlint.io.listdir(path): Lists the contents of a directory and returns an array of filenames.
    The path is resolved relative to the workingDirectory.
  • mxlint.io.isdir(path): Returns true if the path is a directory, false otherwise.
    The path is resolved relative to the workingDirectory.

@github-actions

github-actions Bot commented Jan 9, 2026

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/mxlint/mxlint-cli/lint 67.03% (+2.58%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/mxlint/mxlint-cli/lint/lint_javascript.go 83.33% (+10.61%) 126 (+60) 105 (+57) 21 (+3) 🎉
github.com/mxlint/mxlint-cli/lint/rules.go 62.66% (+0.24%) 158 (+1) 99 (+1) 59 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/mxlint/mxlint-cli/lint/lint_javascript_test.go

@xiwenc
xiwenc merged commit 5fe0fe7 into main Jan 9, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow rules to read in other files within the project for nested processing

1 participant