Skip to content

Commit

Permalink
Breaking: Updating several dependencies
Browse files Browse the repository at this point in the history
algoliasearch, ejs,express, highlight, hint, lodash  and moments. removing request
  • Loading branch information
vidorteg authored Aug 29, 2024
2 parents ba78342 + 8a18e5c commit 634914a
Show file tree
Hide file tree
Showing 24 changed files with 1,526 additions and 1,811 deletions.
5 changes: 0 additions & 5 deletions docs/about/faq/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ <h2 id=is-there-a-plugin-for-my-favorite-editor>Is there a plugin for my favorit
currently available. It utilizes the <a target="_blank" href="https://microsoft.github.io/language-server-protocol/" >Language Server Protocol</a>
which makes it suitable for porting to other editors if there’s
community interest.</p>
<h2 id=is-there-an-online-service>Is there an online service?<a href="#is-there-an-online-service" class="headerlink" title="Is there an online service?"></a></h2><p>Yes! You can scan an online website in <a href="https://webhint.io/scanner/" >here</a>.</p>
<p>If you have any feedback on the results page, please open an
issue in the <a target="_blank" href="https://github.com/webhintio/webhint.io/issues/new" >website repository</a>. If the issue is
related to the results themselves, then open an issue in the <a target="_blank" href="https://github.com/webhintio/hint/issues/new" >webhint
repository</a>.</p>
<h2 id=what-is-the-logo>What is the logo?<a href="#what-is-the-logo" class="headerlink" title="What is the logo?"></a></h2><p>Our logo is Nellie the narwhal. Narwhals are not only <a target="_blank" href="https://www.youtube.com/watch?v=ykwqXuMPsoc" >awesome</a> but have one of the best sonars in the animal kingdom.</p>
<p><a target="_blank" href="http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0162069" >Narwhal echolocation beams may be the most directional of any
species</a>.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
&#125;;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">CSSParser</span> <span class="hljs-keyword">extends</span> <span class="hljs-title class_ inherited__">Parser</span>&lt;<span class="hljs-title class_">StyleEvents</span>&gt; &#123;
<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params">engine: Engine&lt;StyleEvents&gt;</span>) &#123;
<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params"><span class="hljs-attr">engine</span>: <span class="hljs-title class_">Engine</span>&lt;<span class="hljs-title class_">StyleEvents</span>&gt;</span>) &#123;
<span class="hljs-variable language_">super</span>(engine, <span class="hljs-string">&#x27;css&#x27;</span>);
<span class="hljs-comment">// ...</span>
&#125;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ <h2 id=how-do-we-write-the-hint>How do we write the hint?<a href="#how-do-we-wri
<span class="hljs-attr">scope</span>: <span class="hljs-title class_">HintScope</span>.<span class="hljs-property">any</span>
&#125;

<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params">context: HintContext</span>) &#123;
<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params"><span class="hljs-attr">context</span>: <span class="hljs-title class_">HintContext</span></span>) &#123;
<span class="hljs-keyword">const</span> stringToBeIncluded = <span class="hljs-string">`(c) webhint`</span>;
<span class="hljs-keyword">const</span> <span class="hljs-title function_">validateFooter</span> = (<span class="hljs-params">elementFound: ElementFound</span>) =&gt; &#123;
<span class="hljs-keyword">const</span> <span class="hljs-title function_">validateFooter</span> = (<span class="hljs-params"><span class="hljs-attr">elementFound</span>: <span class="hljs-title class_">ElementFound</span></span>) =&gt; &#123;
<span class="hljs-keyword">const</span> &#123; element, resource &#125; = elementFound;
<span class="hljs-keyword">const</span> footerHTML = element.<span class="hljs-property">outerHTML</span>;

Expand Down Expand Up @@ -150,15 +150,15 @@ <h2 id=how-do-we-config-the-hint>How do we config the hint?<a href="#how-do-we-c
<span class="hljs-attr">scope</span>: <span class="hljs-title class_">HintScope</span>.<span class="hljs-property">any</span>
&#125;

<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params">context: HintContext</span>) &#123;
<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params"><span class="hljs-attr">context</span>: <span class="hljs-title class_">HintContext</span></span>) &#123;
<span class="hljs-keyword">let</span> stringToBeIncluded;

<span class="hljs-keyword">const</span> <span class="hljs-title function_">loadHintConfigs</span> = (<span class="hljs-params"></span>) =&gt; &#123;
<span class="hljs-comment">// Load Config options.</span>
stringToBeIncluded = (context.<span class="hljs-property">hintOptions</span> &amp;&amp; context.<span class="hljs-property">hintOptions</span>.<span class="hljs-property">stringToBeIncluded</span>) || <span class="hljs-string">`(c) webhint`</span>;
&#125;;

<span class="hljs-keyword">const</span> <span class="hljs-title function_">validateFooter</span> = <span class="hljs-keyword">async</span> (<span class="hljs-params">elementFound: ElementFound</span>) =&gt; &#123; <span class="hljs-comment">/* ... */</span> &#125;;
<span class="hljs-keyword">const</span> <span class="hljs-title function_">validateFooter</span> = <span class="hljs-keyword">async</span> (<span class="hljs-params"><span class="hljs-attr">elementFound</span>: <span class="hljs-title class_">ElementFound</span></span>) =&gt; &#123; <span class="hljs-comment">/* ... */</span> &#125;;

<span class="hljs-title function_">loadHintConfigs</span>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@ <h2 id=evaluate-javascript-in-the-page-context>Evaluate JavaScript in the page c
return true;
&#125;())`</span>;

context.evaluate(script);</pre></td></tr></table></figure><figure class="highlight js"><table><tr><td class="code"><pre><span class="hljs-keyword">const</span> script =
context.<span class="hljs-title function_">evaluate</span>(script);</pre></td></tr></table></figure><figure class="highlight js"><table><tr><td class="code"><pre><span class="hljs-keyword">const</span> script =
<span class="hljs-string">`(function() &#123;
return Promise.resolve(true);
&#125;())`</span>;

context.evaluate(script);</pre></td></tr></table></figure><p>The following does not:</p>
context.<span class="hljs-title function_">evaluate</span>(script);</pre></td></tr></table></figure><p>The following does not:</p>
<figure class="highlight js"><table><tr><td class="code"><pre><span class="hljs-keyword">const</span> script = <span class="hljs-string">`return true;`</span>;

context.evaluate(script);</pre></td></tr></table></figure><figure class="highlight js"><table><tr><td class="code"><pre><span class="hljs-keyword">const</span> script = <span class="hljs-string">`return Promise.resolve(true);`</span>;
context.<span class="hljs-title function_">evaluate</span>(script);</pre></td></tr></table></figure><figure class="highlight js"><table><tr><td class="code"><pre><span class="hljs-keyword">const</span> script = <span class="hljs-string">`return Promise.resolve(true);`</span>;

context.evaluate(script);</pre></td></tr></table></figure><h2 id=ignore-connectors>Ignore connectors<a href="#ignore-connectors" class="headerlink" title="Ignore connectors"></a></h2><p>If your hint does not work properly with certain connectors you can
context.<span class="hljs-title function_">evaluate</span>(script);</pre></td></tr></table></figure><h2 id=ignore-connectors>Ignore connectors<a href="#ignore-connectors" class="headerlink" title="Ignore connectors"></a></h2><p>If your hint does not work properly with certain connectors you can
use the property <code>ignoreConnectors</code> so it is not run when they are used.</p>
<figure class="highlight ts"><table><tr><td class="code"><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">MyHint</span> <span class="hljs-keyword">implements</span> <span class="hljs-title class_">IHint</span> &#123;
<span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">readonly</span> <span class="hljs-attr">meta</span>: <span class="hljs-title class_">HintMetadata</span> = &#123;
<span class="hljs-attr">id</span>: <span class="hljs-string">&#x27;my-hint&#x27;</span>,
<span class="hljs-attr">ignoredConnectors</span>: [<span class="hljs-string">&#x27;jsdom&#x27;</span>]
&#125;

<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params">context: HintContext</span>) &#123;
<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params"><span class="hljs-attr">context</span>: <span class="hljs-title class_">HintContext</span></span>) &#123;
<span class="hljs-comment">// Your code here</span>
&#125;
&#125;</pre></td></tr></table></figure><h2 id=interact-with-other-services>Interact with other services<a href="#interact-with-other-services" class="headerlink" title="Interact with other services"></a></h2><p>You can develop a hint that integrates with other services. <code>webhint</code>
Expand All @@ -67,11 +67,11 @@ <h2 id=evaluate-javascript-in-the-page-context>Evaluate JavaScript in the page c
<figure class="highlight ts"><table><tr><td class="code"><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">MyHint</span> <span class="hljs-keyword">implements</span> <span class="hljs-title class_">IHint</span> &#123;
<span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">readonly</span> <span class="hljs-attr">meta</span>: <span class="hljs-title class_">HintMetadata</span> = &#123; <span class="hljs-attr">id</span>: <span class="hljs-string">&#x27;my-hint&#x27;</span> &#125;

<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params">context: HintContext</span>) &#123;
<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params"><span class="hljs-attr">context</span>: <span class="hljs-title class_">HintContext</span></span>) &#123;
<span class="hljs-comment">/** The promise that represents the connection to the online service. */</span>
<span class="hljs-keyword">let</span> <span class="hljs-attr">promise</span>: <span class="hljs-title class_">Promise</span>&lt;<span class="hljs-built_in">any</span>&gt;;

<span class="hljs-keyword">const</span> <span class="hljs-title function_">start</span> = (<span class="hljs-params">data: ScanStartEvent</span>) =&gt; &#123;
<span class="hljs-keyword">const</span> <span class="hljs-title function_">start</span> = (<span class="hljs-params"><span class="hljs-attr">data</span>: <span class="hljs-title class_">ScanStartEvent</span></span>) =&gt; &#123;
<span class="hljs-comment">// Initialize promise to service here but do not return it.</span>
promise = <span class="hljs-keyword">new</span> <span class="hljs-title class_">MyService</span>();
&#125;;
Expand Down Expand Up @@ -114,12 +114,12 @@ <h2 id=validate-javascript>Validate JavaScript<a href="#validate-javascript" cla
<span class="hljs-attr">worksWithLocalFiles</span>: <span class="hljs-literal">true</span>
&#125;

<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params">context: HintContext</span>) &#123;
<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params"><span class="hljs-attr">context</span>: <span class="hljs-title class_">HintContext</span></span>) &#123;
<span class="hljs-keyword">let</span> validPromise;
<span class="hljs-keyword">const</span> errorsOnly = context.<span class="hljs-property">hintOptions</span> &amp;&amp; context.<span class="hljs-property">hintOptions</span>[<span class="hljs-string">&#x27;errors-only&#x27;</span>] || <span class="hljs-literal">false</span>;
<span class="hljs-keyword">let</span> html;

<span class="hljs-keyword">const</span> <span class="hljs-title function_">onParseJavascript</span> = (<span class="hljs-params">scriptParse: ScriptParse</span>) =&gt; &#123;
<span class="hljs-keyword">const</span> <span class="hljs-title function_">onParseJavascript</span> = (<span class="hljs-params"><span class="hljs-attr">scriptParse</span>: <span class="hljs-title class_">ScriptParse</span></span>) =&gt; &#123;
<span class="hljs-keyword">const</span> results = linter.<span class="hljs-title function_">verify</span>(scriptParse.<span class="hljs-property">sourceCode</span>, &#123; <span class="hljs-attr">hints</span>: &#123; <span class="hljs-attr">semi</span>: <span class="hljs-number">2</span> &#125; &#125;);

<span class="hljs-keyword">for</span> (<span class="hljs-keyword">const</span> result <span class="hljs-keyword">of</span> results) &#123;
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/contributor-guide/how-to/connector/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h2 id=develop-a-full-connector>Develop a “full” connector<a href="#develop-
<span class="hljs-comment">/** Download an external resource using ` customHeaders` if needed. */</span>
<span class="hljs-title function_">fetchContent</span>(<span class="hljs-attr">target</span>: <span class="hljs-variable constant_">URL</span> | <span class="hljs-built_in">string</span>, customHeaders?: <span class="hljs-built_in">object</span>): <span class="hljs-title class_">Promise</span>&lt;<span class="hljs-title class_">NetworkData</span>&gt;;
<span class="hljs-comment">/** Evaluates the given JavaScript `code` asynchronously in the target. */</span>
evaluate(<span class="hljs-attr">code</span>: <span class="hljs-built_in">string</span>): <span class="hljs-title class_">Promise</span>&lt;<span class="hljs-built_in">any</span>&gt;;
<span class="hljs-title function_">evaluate</span>(<span class="hljs-attr">code</span>: <span class="hljs-built_in">string</span>): <span class="hljs-title class_">Promise</span>&lt;<span class="hljs-built_in">any</span>&gt;;
<span class="hljs-comment">/** Finds all the nodes that match the given query. */</span>
<span class="hljs-title function_">querySelectorAll</span>(<span class="hljs-attr">query</span>: <span class="hljs-built_in">string</span>): <span class="hljs-title class_">HTMLElement</span>[];
&#125;</pre></td></tr></table></figure><h2 id=how-to-test-a-full-connector>How to test a “full” connector<a href="#how-to-test-a-full-connector" class="headerlink" title="How to test a “full” connector"></a></h2><p>To make sure your connector is a “full” connector, it has to pass the
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/contributor-guide/how-to/hint/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ <h2 id=how-hints-work>How hints work<a href="#how-hints-work" class="headerlink"
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">MyNewHint</span> <span class="hljs-keyword">implements</span> <span class="hljs-title class_">IHint</span> &#123;
<span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">readonly</span> <span class="hljs-attr">meta</span>: <span class="hljs-title class_">HintMetadata</span> = &#123;&#125;

<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params">context: HintContext</span>) &#123;
<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params"><span class="hljs-attr">context</span>: <span class="hljs-title class_">HintContext</span></span>) &#123;
<span class="hljs-comment">// Your code here.</span>

<span class="hljs-keyword">const</span> <span class="hljs-title function_">validateFetchEnd</span> = (<span class="hljs-params">fetchEnd: FetchEnd</span>) =&gt; &#123;
<span class="hljs-keyword">const</span> <span class="hljs-title function_">validateFetchEnd</span> = (<span class="hljs-params"><span class="hljs-attr">fetchEnd</span>: <span class="hljs-title class_">FetchEnd</span></span>) =&gt; &#123;
<span class="hljs-comment">// Code to validate the hint on the event fetch::end.</span>
&#125;;

<span class="hljs-keyword">const</span> <span class="hljs-title function_">validateElement</span> = (<span class="hljs-params">element: ElementFound</span>) =&gt; &#123;
<span class="hljs-keyword">const</span> <span class="hljs-title function_">validateElement</span> = (<span class="hljs-params"><span class="hljs-attr">element</span>: <span class="hljs-title class_">ElementFound</span></span>) =&gt; &#123;
<span class="hljs-comment">// Code to validate the hint on the event element::element-type.</span>
&#125;;

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/contributor-guide/how-to/parser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">CustomParser</span> <span class="hljs-keyword">extends</span> <span class="hljs-title class_ inherited__">Parser</span> &#123;

<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params">engine: Engine</span>) &#123;
<span class="hljs-keyword">public</span> <span class="hljs-title function_">constructor</span>(<span class="hljs-params"><span class="hljs-attr">engine</span>: <span class="hljs-title class_">Engine</span></span>) &#123;
<span class="hljs-variable language_">super</span>(engine, <span class="hljs-string">&#x27;&lt;parser_name&gt;&#x27;</span>);

<span class="hljs-comment">/*
Expand All @@ -19,7 +19,7 @@
<span class="hljs-variable language_">this</span>.<span class="hljs-property">engine</span>.<span class="hljs-title function_">on</span>(<span class="hljs-string">&#x27;fetch::end::resource&#x27;</span>, <span class="hljs-variable language_">this</span>.<span class="hljs-property">onFetchEnd</span>);
&#125;

<span class="hljs-keyword">public</span> <span class="hljs-keyword">async</span> <span class="hljs-title function_">onFetchEnd</span>(<span class="hljs-params">data: FetchEnd</span>) &#123;
<span class="hljs-keyword">public</span> <span class="hljs-keyword">async</span> <span class="hljs-title function_">onFetchEnd</span>(<span class="hljs-params"><span class="hljs-attr">data</span>: <span class="hljs-title class_">FetchEnd</span></span>) &#123;
<span class="hljs-comment">/*
* Your magic to detect if the parser understands the content here
* You probably want to check the contentType first
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/user-guide/concepts/formatters/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<ul>
<li><p><a target="_blank" href="https://npmjs.com/package/@hint/formatter-json" ><code>@hint/formatter-json</code></a> does a <code>JSON.stringify()</code> of
the results. Output is not user friendly:</p>
<p><img src="/static/images/json-output-2bb9d2f869.png" alt="Example output for the json formatter"></p>
<p><img src="/static/images/json-output-6f15a72cc8.png" alt="Example output for the json formatter"></p>
</li>
<li><p><a target="_blank" href="https://npmjs.com/package/@hint/formatter-stylish" ><code>@hint/formatter-stylish</code></a> prints the results in
table format indicating the resource, line, and column:</p>
Expand Down
Loading

0 comments on commit 634914a

Please sign in to comment.