Skip to content

ci: merge staging to master #17

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

Merged
merged 11 commits into from
May 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/functions/bin_lint.default.html
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ <h4 class="tsd-parameters-title">Parameters</h4>
<h5><span class="tsd-kind-parameter">argv</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = process.argv</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MatrixAI/js-eslint/blob/master/src/bin/lint.ts#L12">src/bin/lint.ts:12</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/MatrixAI/js-eslint/blob/master/src/bin/lint.ts#L31">src/bin/lint.ts:31</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
2 changes: 1 addition & 1 deletion docs/functions/utils.buildPatterns.html
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ <h5><span class="tsd-kind-property">files</span><span class="tsd-signature-symbo
<h5><span class="tsd-kind-property">ignore</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5></li></ul>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MatrixAI/js-eslint/blob/master/src/utils.ts#L205">src/utils.ts:205</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/MatrixAI/js-eslint/blob/master/src/utils.ts#L225">src/utils.ts:225</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
2 changes: 1 addition & 1 deletion docs/functions/utils.collectMarkdown.html
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</s

<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MatrixAI/js-eslint/blob/master/src/utils.ts#L92">src/utils.ts:92</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/MatrixAI/js-eslint/blob/master/src/utils.ts#L112">src/utils.ts:112</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
2 changes: 1 addition & 1 deletion docs/functions/utils.commandExists.html
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</

<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MatrixAI/js-eslint/blob/master/src/utils.ts#L105">src/utils.ts:105</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/MatrixAI/js-eslint/blob/master/src/utils.ts#L125">src/utils.ts:125</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
2 changes: 1 addition & 1 deletion docs/functions/utils.findUserESLintConfig.html
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</s

<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MatrixAI/js-eslint/blob/master/src/utils.ts#L72">src/utils.ts:72</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/MatrixAI/js-eslint/blob/master/src/utils.ts#L92">src/utils.ts:92</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
2 changes: 1 addition & 1 deletion docs/functions/utils.resolveMatrixConfig.html
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ <h5><span class="tsd-kind-parameter">repoRoot</span>: <span class="tsd-signature
<h4 class="tsd-returns-title">Returns <a href="../types/types.MatrixAILintCfg.html" class="tsd-signature-type tsd-kind-type-alias">MatrixAILintCfg</a></h4>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MatrixAI/js-eslint/blob/master/src/utils.ts#L130">src/utils.ts:130</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/MatrixAI/js-eslint/blob/master/src/utils.ts#L150">src/utils.ts:150</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
4 changes: 3 additions & 1 deletion docs/functions/utils.runESLint.html
Original file line number Diff line number Diff line change
@@ -24,11 +24,13 @@ <h1>Function runESLint</h1></div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><span class="tsd-kind-parameter">__namedParameters</span>: <span class="tsd-signature-symbol">{ </span><br/><span>    </span><span class="tsd-kind-property">configPath</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><span class="tsd-kind-property">fix</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></h5>
<h5><span class="tsd-kind-parameter">__namedParameters</span>: <span class="tsd-signature-symbol">{ </span><br/><span>    </span><span class="tsd-kind-property">configPath</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><span class="tsd-kind-property">explicitGlobs</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><span class="tsd-kind-property">fix</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-property">config<wbr/>Path</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span></h5></li>
<li class="tsd-parameter">
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-property">explicit<wbr/>Globs</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5></li>
<li class="tsd-parameter">
<h5><span class="tsd-kind-property">fix</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5></li></ul></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
<ul>
30 changes: 9 additions & 21 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -33,38 +33,28 @@ <h2>@matrixai/lint</h2></div>
<tr>
<th>Flag</th>
<th>Description</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td><em>(no flag)</em></td>
<td>Uses built-in Matrix AI ESLint config</td>
<td></td>
<td></td>
</tr>
<tr>
<td><code>--fix</code></td>
<td>Enables auto-fixing via ESLint and Prettier</td>
<td></td>
<td></td>
</tr>
<tr>
<td><code>--user-config</code></td>
<td>Uses detected `eslint.config.[c</td>
<td>m</td>
<td>t]js` from the project root if found</td>
<td>Uses detected `eslint.config.[js,mjs,cjs,ts] from the project root if found</td>
</tr>
<tr>
<td><code>--config &lt;path&gt;</code></td>
<td>Explicitly use a custom ESLint config file</td>
<td></td>
<td></td>
</tr>
</tbody></table>
<a id="md:examples" class="tsd-anchor"></a><h3><a href="#md:examples">Examples</a></h3><pre><code class="language-sh"><span class="hl-0">matrixai-lint</span><span class="hl-1"> </span><span class="hl-3">--fix</span><br/><span class="hl-0">matrixai-lint</span><span class="hl-1"> </span><span class="hl-3">--user-config</span><br/><span class="hl-0">matrixai-lint</span><span class="hl-1"> </span><span class="hl-3">--config</span><span class="hl-1"> </span><span class="hl-2">./eslint.config.js</span><span class="hl-1"> </span><span class="hl-3">--fix</span>
</code><button>Copy</button></pre>
<a id="md:typescript-support" class="tsd-anchor"></a><h2><a href="#md:typescript-support">TypeScript Support</a></h2><p>The linter is TypeScript-aware and **requires a **<strong><code>tsconfig.json</code></strong> to determine which files to lint and how to parse them.</p>
<a id="md:typescript-support" class="tsd-anchor"></a><h3><a href="#md:typescript-support">TypeScript Support</a></h3><p>The linter is TypeScript-aware and requires a <code>tsconfig.json</code> to determine which files to lint and how to parse them.</p>
<p>By default:</p>
<ul>
<li>It looks for <code>tsconfig.json</code> in the project root</li>
@@ -95,10 +85,10 @@ <h2>@matrixai/lint</h2></div>
<blockquote>
<p>⚠ If a path in <code>forceInclude</code> is not included in any of the <code>tsconfigPaths</code>, TypeScript will throw a parsing error.</p>
</blockquote>
<a id="md:eslint-config-override" class="tsd-anchor"></a><h2><a href="#md:eslint-config-override">ESLint Config Override</a></h2><p>You can use your own ESLint config by one of the following methods:</p>
<a id="md:1-inline-custom-config" class="tsd-anchor"></a><h3><a href="#md:1-inline-custom-config">1. Inline Custom Config</a></h3><pre><code class="language-sh"><span class="hl-0">matrixai-lint</span><span class="hl-1"> </span><span class="hl-3">--config</span><span class="hl-1"> </span><span class="hl-2">./eslint.config.js</span>
<a id="md:eslint-config-override" class="tsd-anchor"></a><h3><a href="#md:eslint-config-override">ESLint Config Override</a></h3><p>You can use your own ESLint config by one of the following methods:</p>
<a id="md:1-inline-custom-config" class="tsd-anchor"></a><h4><a href="#md:1-inline-custom-config">1. Inline Custom Config</a></h4><pre><code class="language-sh"><span class="hl-0">matrixai-lint</span><span class="hl-1"> </span><span class="hl-3">--config</span><span class="hl-1"> </span><span class="hl-2">./eslint.config.js</span>
</code><button>Copy</button></pre>
<a id="md:2-auto-detect-with---user-config" class="tsd-anchor"></a><h3><a href="#md:2-auto-detect-with---user-config">2. Auto-detect with <code>--user-config</code></a></h3><pre><code class="language-sh"><span class="hl-0">matrixai-lint</span><span class="hl-1"> </span><span class="hl-3">--user-config</span>
<a id="md:2-auto-detect-with---user-config" class="tsd-anchor"></a><h4><a href="#md:2-auto-detect-with---user-config">2. Auto-detect with <code>--user-config</code></a></h4><pre><code class="language-sh"><span class="hl-0">matrixai-lint</span><span class="hl-1"> </span><span class="hl-3">--user-config</span>
</code><button>Copy</button></pre>
<p>This will look for a valid eslint.config file in the project root.</p>
<p>Valid config filenames:</p>
@@ -108,7 +98,7 @@ <h2>@matrixai/lint</h2></div>
<li><code>eslint.config.mjs</code></li>
<li><code>eslint.config.ts</code></li>
</ul>
<a id="md:3-extend-the-base-config" class="tsd-anchor"></a><h3><a href="#md:3-extend-the-base-config">3. Extend the base config</a></h3><pre><code class="language-ts"><span class="hl-5">// eslint.config.js</span><br/><span class="hl-6">import</span><span class="hl-1"> </span><span class="hl-7">matrixai</span><span class="hl-1"> </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;@matrixai/lint/config&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-6">export</span><span class="hl-1"> </span><span class="hl-6">default</span><span class="hl-1"> [</span><br/><span class="hl-1"> ...</span><span class="hl-7">matrixai</span><span class="hl-1">,</span><br/><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">rules:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-2">&#39;@typescript-eslint/no-explicit-any&#39;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&#39;error&#39;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&#39;no-console&#39;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&#39;off&#39;</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">];</span>
<a id="md:3-extend-the-base-config" class="tsd-anchor"></a><h4><a href="#md:3-extend-the-base-config">3. Extend the base config</a></h4><pre><code class="language-ts"><span class="hl-5">// eslint.config.js</span><br/><span class="hl-6">import</span><span class="hl-1"> </span><span class="hl-7">matrixai</span><span class="hl-1"> </span><span class="hl-6">from</span><span class="hl-1"> </span><span class="hl-2">&#39;@matrixai/lint/config&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-6">export</span><span class="hl-1"> </span><span class="hl-6">default</span><span class="hl-1"> [</span><br/><span class="hl-1"> ...</span><span class="hl-7">matrixai</span><span class="hl-1">,</span><br/><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-7">rules:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-2">&#39;@typescript-eslint/no-explicit-any&#39;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&#39;error&#39;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&#39;no-console&#39;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&#39;off&#39;</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">];</span>
</code><button>Copy</button></pre>
<a id="md:development" class="tsd-anchor"></a><h2><a href="#md:development">Development</a></h2><p>Run <code>nix develop</code>, and once you&#39;re inside, you can use:</p>
<pre><code class="language-sh"><span class="hl-5"># install (or reinstall packages from package.json)</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">install</span><br/><span class="hl-5"># build the dist</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">build</span><br/><span class="hl-5"># run the repl (this allows you to import from ./src)</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">tsx</span><br/><span class="hl-5"># run the tests</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">test</span><br/><span class="hl-5"># lint the source code</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">lint</span><br/><span class="hl-5"># automatically fix the source</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">lintfix</span>
@@ -156,17 +146,15 @@ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon
<li>
<ul>
<li><a href="#md:cli-options"><span>CLI <wbr/>Options</span></a></li>
<li><a href="#md:examples"><span>Examples</span></a></li></ul></li>
<li><a href="#md:examples"><span>Examples</span></a></li>
<li><a href="#md:typescript-support"><span>Type<wbr/>Script <wbr/>Support</span></a></li>
<li>
<ul>
<li><a href="#md:working-with-multiple-tsconfigs"><span>Working with multiple tsconfigs</span></a></li></ul></li>
<li><a href="#md:working-with-multiple-tsconfigs"><span>Working with multiple tsconfigs</span></a></li>
<li><a href="#md:eslint-config-override"><span>ESLint <wbr/>Config <wbr/>Override</span></a></li>
<li>
<ul>
<li><a href="#md:1-inline-custom-config"><span>1. <wbr/>Inline <wbr/>Custom <wbr/>Config</span></a></li>
<li><a href="#md:2-auto-detect-with---user-config"><span>2. <wbr/>Auto-<wbr/>detect with --user-<wbr/>config</span></a></li>
<li><a href="#md:3-extend-the-base-config"><span>3. <wbr/>Extend the base config</span></a></li></ul></li>
<li><a href="#md:3-extend-the-base-config"><span>3. <wbr/>Extend the base config</span></a></li></ul></li></ul></li>
<li><a href="#md:development"><span>Development</span></a></li>
<li>
<ul>
4 changes: 3 additions & 1 deletion docs/modules/types.html
Original file line number Diff line number Diff line change
@@ -22,7 +22,8 @@ <h1>Module types</h1></div><aside class="tsd-sources">
<h3 class="tsd-index-heading uppercase">Index</h3>
<section class="tsd-index-section">
<h3 class="tsd-index-heading">Type Aliases</h3>
<div class="tsd-index-list"><a href="../types/types.MatrixAILintCfg.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>MatrixAILint<wbr/>Cfg</span></a>
<div class="tsd-index-list"><a href="../types/types.CLIOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>CLIOptions</span></a>
<a href="../types/types.MatrixAILintCfg.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>MatrixAILint<wbr/>Cfg</span></a>
<a href="../types/types.RawMatrixCfg.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Raw<wbr/>Matrix<wbr/>Cfg</span></a>
</div></section></section></section></div>
<div class="col-sidebar">
@@ -51,6 +52,7 @@ <h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</op
<details class="tsd-index-accordion" open data-key="types"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg><a href="types.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>types</span></a></summary>
<div class="tsd-accordion-details">
<ul class="tsd-nested-navigation">
<li><a href="../types/types.CLIOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>CLIOptions</span></a></li>
<li><a href="../types/types.MatrixAILintCfg.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>MatrixAILint<wbr/>Cfg</span></a></li>
<li><a href="../types/types.RawMatrixCfg.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Raw<wbr/>Matrix<wbr/>Cfg</span></a></li></ul></div></details></li>
<li><a href="utils.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>utils</span></a></li></ul></nav></div></div></div>
67 changes: 67 additions & 0 deletions docs/types/types.CLIOptions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>CLIOptions | @matrixai/lint</title><meta name="description" content="Documentation for @matrixai/lint"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
<div class="tsd-toolbar-contents container">
<div class="table-cell" id="tsd-search" data-base="..">
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
<div class="field">
<div id="tsd-toolbar-links"></div></div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@matrixai/lint</a></div>
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
<div class="container container-main">
<div class="col-content">
<div class="tsd-page-title">
<ul class="tsd-breadcrumb">
<li><a href="../index.html">@matrixai/lint</a></li>
<li><a href="../modules/types.html">types</a></li>
<li><a href="types.CLIOptions.html">CLIOptions</a></li></ul>
<h1>Type alias CLIOptions</h1></div>
<div class="tsd-signature"><span class="tsd-kind-type-alias">CLIOptions</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span>    </span><span class="tsd-kind-property">config</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><span class="tsd-kind-property">eslint</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><span class="tsd-kind-property">fix</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><span class="tsd-kind-property">shell</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><span class="tsd-kind-property">userConfig</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-property">config</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span></h5></li>
<li class="tsd-parameter">
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-property">eslint</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5></li>
<li class="tsd-parameter">
<h5><span class="tsd-kind-property">fix</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5></li>
<li class="tsd-parameter">
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-property">shell</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5></li>
<li class="tsd-parameter">
<h5><span class="tsd-kind-property">user<wbr/>Config</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5></li></ul></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MatrixAI/js-eslint/blob/master/src/types.ts#L11">src/types.ts:11</a></li></ul></aside></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)" id="icon-chevronDown"></path></svg>Settings</h3></summary>
<div class="tsd-accordion-details">
<div class="tsd-filter-visibility">
<h4 class="uppercase">Member Visibility</h4><form>
<ul id="tsd-filter-options">
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
<div class="tsd-theme-toggle">
<h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div>
<div class="site-menu">
<nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@matrixai/lint</span></a>
<ul class="tsd-small-nested-navigation">
<li><a href="../modules/bin_lint.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>bin/lint</span></a></li>
<li><a href="../modules/configs_js.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>configs/js</span></a></li>
<li><a href="../modules/plugins_eslint_plugin_matrixai.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>plugins/eslint-<wbr/>plugin-<wbr/>matrixai</span></a></li>
<li><a href="../modules/rules_no_aliased_imports.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>rules/no-<wbr/>aliased-<wbr/>imports</span></a></li>
<li>
<details class="tsd-index-accordion" open data-key="types"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg><a href="../modules/types.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>types</span></a></summary>
<div class="tsd-accordion-details">
<ul class="tsd-nested-navigation">
<li><a href="types.CLIOptions.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>CLIOptions</span></a></li>
<li><a href="types.MatrixAILintCfg.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>MatrixAILint<wbr/>Cfg</span></a></li>
<li><a href="types.RawMatrixCfg.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Raw<wbr/>Matrix<wbr/>Cfg</span></a></li></ul></div></details></li>
<li><a href="../modules/utils.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>utils</span></a></li></ul></nav></div></div></div>
<div class="tsd-generator">
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
<div class="overlay"></div></body></html>
3 changes: 2 additions & 1 deletion docs/types/types.MatrixAILintCfg.html
Original file line number Diff line number Diff line change
@@ -52,7 +52,8 @@ <h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</op
<details class="tsd-index-accordion" open data-key="types"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg><a href="../modules/types.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>types</span></a></summary>
<div class="tsd-accordion-details">
<ul class="tsd-nested-navigation">
<li><a href="types.MatrixAILintCfg.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>MatrixAILint<wbr/>Cfg</span></a></li>
<li><a href="types.CLIOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>CLIOptions</span></a></li>
<li><a href="types.MatrixAILintCfg.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>MatrixAILint<wbr/>Cfg</span></a></li>
<li><a href="types.RawMatrixCfg.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Raw<wbr/>Matrix<wbr/>Cfg</span></a></li></ul></div></details></li>
<li><a href="../modules/utils.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>utils</span></a></li></ul></nav></div></div></div>
<div class="tsd-generator">
3 changes: 2 additions & 1 deletion docs/types/types.RawMatrixCfg.html
Original file line number Diff line number Diff line change
@@ -52,7 +52,8 @@ <h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</op
<details class="tsd-index-accordion" open data-key="types"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg><a href="../modules/types.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>types</span></a></summary>
<div class="tsd-accordion-details">
<ul class="tsd-nested-navigation">
<li><a href="types.MatrixAILintCfg.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>MatrixAILint<wbr/>Cfg</span></a></li>
<li><a href="types.CLIOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>CLIOptions</span></a></li>
<li><a href="types.MatrixAILintCfg.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>MatrixAILint<wbr/>Cfg</span></a></li>
<li><a href="types.RawMatrixCfg.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Raw<wbr/>Matrix<wbr/>Cfg</span></a></li></ul></div></details></li>
<li><a href="../modules/utils.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>utils</span></a></li></ul></nav></div></div></div>
<div class="tsd-generator">
84 changes: 72 additions & 12 deletions package-lock.json
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@matrixai/lint",
"version": "0.1.0",
"version": "0.2.0",
"author": "Roger Qiu",
"description": "Org wide custom eslint rules",
"license": "Apache-2.0",
@@ -26,8 +26,8 @@
"build": "shx rm -rf ./dist && tsc -p ./tsconfig.build.json && shx chmod +x dist/bin/lint.js",
"postversion": "npm install --package-lock-only --ignore-scripts --silent",
"tsx": "tsx",
"lint": "test -f ./dist/bin/lint.js || npm run build && ./dist/bin/lint.js",
"lintfix": "sh -c 'test -f ./dist/bin/lint.js || npm run build && ./dist/bin/lint.js --fix'",
"lint": "test -f ./dist/bin/lint.js || npm run build && ./dist/bin/lint.js --eslint \"{src,scripts,tests}/**/*.{js,mjs,ts,mts,jsx,tsx}\" --shell src scripts tests",
"lintfix": "sh -c 'test -f ./dist/bin/lint.js || npm run build && ./dist/bin/lint.js --fix --eslint \"{src,scripts,tests}/**/*.{js,mjs,ts,mts,jsx,tsx}\"' --shell src scripts tests",
"lint-shell": "find ./src ./tests ./scripts -type f -regextype posix-extended -regex '.*\\.(sh)' -exec shellcheck {} +",
"docs": "shx rm -rf ./docs && typedoc --entryPointStrategy expand --gitRevision master --tsconfig ./tsconfig.build.json --out ./docs src",
"test": "node ./scripts/test.mjs"
@@ -38,11 +38,11 @@
"@typescript-eslint/eslint-plugin": "^8.27.0",
"@typescript-eslint/parser": "^8.27.0",
"@typescript-eslint/utils": "^8.26.1",
"eslint": "^9.18.0",
"eslint": ">=9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-tailwindcss": "^3.18.0"
@@ -52,9 +52,11 @@
"@swc/jest": "^0.2.29",
"@types/jest": "^29.5.2",
"@types/node": "^20.5.7",
"commander": "^13.1.0",
"jest": "^29.6.2",
"jest-extended": "^4.0.2",
"jest-junit": "^16.0.0",
"minimatch": "^10.0.1",
"prettier": "^3.0.0",
"shx": "^0.3.4",
"tsconfig-paths": "^3.9.0",
61 changes: 36 additions & 25 deletions src/bin/lint.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,45 @@
#!/usr/bin/env node
import type { CLIOptions } from '../types.js';
import os from 'node:os';
import path from 'node:path';
import process from 'node:process';
import childProcess from 'node:child_process';
import fs from 'node:fs';
import { Command } from 'commander';
import * as utils from '../utils.js';

const platform = os.platform();
const program = new Command();
const DEFAULT_SHELLCHECK_SEARCH_ROOTS = ['./src', './scripts', './tests'];

program
.name('matrixai-lint')
.description(
'Lint source files, scripts, and markdown with configured rules.',
)
.option('-f, --fix', 'Automatically fix problems')
.option(
'--user-config',
'Use user-provided ESLint config instead of built-in one',
)
.option('--config <path>', 'Path to explicit ESLint config file')
.option('--eslint <pat...>', 'Glob(s) to pass to ESLint')
.option('--shell <pat...>', 'Glob(s) to pass to shell-check')
.allowUnknownOption(true); // Optional: force rejection of unknown flags

/* eslint-disable no-console */
async function main(argv = process.argv) {
argv = argv.slice(2);
await program.parseAsync(argv);
const options = program.opts<CLIOptions>();

const fix = Boolean(options.fix);
const useUserConfig = Boolean(options.userConfig);
const explicitConfigPath: string | undefined = options.config;

const eslintPatterns: string[] | undefined = options.eslint;
const shellPatterns: string[] | undefined = options.shell;

let hadFailure = false;
let fix = false;
let useUserConfig = false;
let explicitConfigPath: string | undefined;
const restArgs: string[] = [];

while (argv.length > 0) {
const option = argv.shift()!;
switch (option) {
case '--fix':
fix = true;
break;
case '--user-config':
useUserConfig = true;
break;
case '--config':
explicitConfigPath = argv.shift(); // Grab the next token
break;
default:
restArgs.push(option);
}
}

// Resolve which config file to use
let chosenConfig: string | undefined;
@@ -59,14 +65,19 @@ async function main(argv = process.argv) {
}

try {
await utils.runESLint({ fix, configPath: chosenConfig });
await utils.runESLint({
fix,
configPath: chosenConfig,
explicitGlobs: eslintPatterns,
});
} catch (err) {
console.error(`ESLint failed: \n${err}`);
hadFailure = true;
}

const shellcheckDefaultSearchRoots = ['./src', './scripts', './tests'];
const searchRoots = shellcheckDefaultSearchRoots
const searchRoots = (
shellPatterns?.length ? shellPatterns : DEFAULT_SHELLCHECK_SEARCH_ROOTS
)
.map((p) => path.resolve(process.cwd(), p))
.filter((p) => fs.existsSync(p));

10 changes: 9 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -8,4 +8,12 @@ type RawMatrixCfg = Partial<{
forceInclude: unknown;
}>; // “might have these two keys, values are unknown”

export type { MatrixAILintCfg, RawMatrixCfg };
type CLIOptions = {
fix: boolean;
userConfig: boolean;
config?: string;
eslint?: string[];
shell?: string[];
};

export type { MatrixAILintCfg, RawMatrixCfg, CLIOptions };
44 changes: 32 additions & 12 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -11,52 +11,72 @@ import { ESLint } from 'eslint';
async function runESLint({
fix,
configPath,
explicitGlobs,
}: {
fix: boolean;
configPath?: string;
explicitGlobs?: string[];
}) {
const dirname = path.dirname(url.fileURLToPath(import.meta.url));
const defaultConfigPath = path.resolve(dirname, './configs/js.js');

const matrixaiLintConfig = resolveMatrixConfig();
const forceInclude = matrixaiLintConfig.forceInclude;
const tsconfigPaths = matrixaiLintConfig.tsconfigPaths;
// PATH A – user supplied explicit globs
if (explicitGlobs?.length) {
console.log('Linting with explicit patterns:');
explicitGlobs.forEach((g) => console.log(' ' + g));

const eslint = new ESLint({
overrideConfigFile: configPath || defaultConfigPath,
fix,
errorOnUnmatchedPattern: false,
warnIgnored: false,
ignorePatterns: [], // Trust caller entirely
});

await lintAndReport(eslint, explicitGlobs, fix);
return;
}

// PATH B – default behaviour (tsconfig + matrix config)
const { forceInclude, tsconfigPaths } = resolveMatrixConfig();

if (tsconfigPaths.length === 0) {
console.error('[matrixai-lint] ⚠ No tsconfig.json files found.');
}

console.log(`Found ${tsconfigPaths.length} tsconfig.json files:`);
tsconfigPaths.forEach((tsconfigPath) => console.log(' ' + tsconfigPath));
tsconfigPaths.forEach((p) => console.log(' ' + p));

const { files: lintFiles, ignore } = buildPatterns(
const { files: patterns, ignore: ignorePats } = buildPatterns(
tsconfigPaths[0],
forceInclude,
);

console.log('Linting files:');
lintFiles.forEach((file) => console.log(' ' + file));
patterns.forEach((p) => console.log(' ' + p));

const eslint = new ESLint({
overrideConfigFile: configPath || defaultConfigPath,
fix,
errorOnUnmatchedPattern: false,
warnIgnored: false,
ignorePatterns: ignore,
ignorePatterns: ignorePats,
});

const results = await eslint.lintFiles(lintFiles);
await lintAndReport(eslint, patterns, fix);
}

async function lintAndReport(eslint: ESLint, patterns: string[], fix: boolean) {
const results = await eslint.lintFiles(patterns);

if (fix) {
await ESLint.outputFixes(results);
}

const formatter = await eslint.loadFormatter('stylish');
const resultText = formatter.format(results);
console.log(resultText);

/* eslint-enable no-console */
console.log(formatter.format(results));
}
/* eslint-enable no-console */

/**
* Find the user's ESLint config file in the current working directory.