Summary: Bumps [eslint](https://github.com/eslint/eslint) from 8.17.0 to 8.21.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/eslint/eslint/releases">eslint's releases</a>.</em></p> <blockquote> <h2>v8.21.0</h2> <h2>Features</h2> <ul> <li><a href="7b43ea14a8"><code>7b43ea1</code></a> feat: Implement FlatESLint (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16149">#16149</a>) (Nicholas C. Zakas)</li> <li><a href="92bf49a4b3"><code>92bf49a</code></a> feat: improve the key width calculation in <code>key-spacing</code> rule (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16154">#16154</a>) (Nitin Kumar)</li> <li><a href="c4615421cb"><code>c461542</code></a> feat: add new <code>allowLineSeparatedGroups</code> option to the <code>sort-keys</code> rule (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16138">#16138</a>) (Nitin Kumar)</li> <li><a href="1cdcbca8a9"><code>1cdcbca</code></a> feat: add deprecation warnings for legacy API in <code>RuleTester</code> (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16063">#16063</a>) (Nitin Kumar)</li> </ul> <h2>Bug Fixes</h2> <ul> <li><a href="0396775527"><code>0396775</code></a> fix: lines-around-comment apply <code>allowBlockStart</code> for switch statements (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16153">#16153</a>) (Nitin Kumar)</li> </ul> <h2>Documentation</h2> <ul> <li><a href="2aadc93272"><code>2aadc93</code></a> docs: add anchors to headings inside docs content (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16134">#16134</a>) (Strek)</li> </ul> <h2>Chores</h2> <ul> <li><a href="8892511948"><code>8892511</code></a> chore: Upgrade to Espree 9.3.3 (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16173">#16173</a>) (Brandon Mills)</li> <li><a href="1233beea39"><code>1233bee</code></a> chore: switch to eslint-plugin-node's maintained fork (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16150">#16150</a>) (唯然)</li> <li><a href="97b95c068d"><code>97b95c0</code></a> chore: upgrade puppeteer v13 (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16151">#16151</a>) (唯然)</li> </ul> <h2>v8.20.0</h2> <h2>Features</h2> <ul> <li><a href="ca83178b18"><code>ca83178</code></a> feat: catch preprocess errors (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16105">#16105</a>) (JounQin)</li> </ul> <h2>Bug Fixes</h2> <ul> <li><a href="30be0ed4d8"><code>30be0ed</code></a> fix: no-warning-comments rule escapes special RegEx characters in terms (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16090">#16090</a>) (Lachlan Hunt)</li> <li><a href="bfe5e88409"><code>bfe5e88</code></a> fix: ignore spacing before <code>]</code> and <code>}</code> in comma-spacing (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16113">#16113</a>) (Milos Djermanovic)</li> </ul> <h2>Documentation</h2> <ul> <li><a href="845c4f4027"><code>845c4f4</code></a> docs: Add website team details (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16115">#16115</a>) (Nicholas C. Zakas)</li> <li><a href="5a0dfdb993"><code>5a0dfdb</code></a> docs: Link to blog post in no-constant-binary-expression (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16112">#16112</a>) (Jordan Eldredge)</li> <li><a href="bc692a9bf5"><code>bc692a9</code></a> docs: remove install command (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16084">#16084</a>) (Strek)</li> <li><a href="49ca3f0904"><code>49ca3f0</code></a> docs: don't show toc when content not found (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16095">#16095</a>) (Amaresh S M)</li> <li><a href="ba19e3f80a"><code>ba19e3f</code></a> docs: enhance 404 page UI (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16097">#16097</a>) (Amaresh S M)</li> <li><a href="a75d3b47b8"><code>a75d3b4</code></a> docs: remove unused meta.docs.category field in working-with-rules page (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16109">#16109</a>) (Brandon Scott)</li> <li><a href="cdc0206390"><code>cdc0206</code></a> docs: add formatters page edit link (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16094">#16094</a>) (Amaresh S M)</li> <li><a href="4d1ed22ded"><code>4d1ed22</code></a> docs: preselect default theme (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16098">#16098</a>) (Strek)</li> <li><a href="4b79612f0b"><code>4b79612</code></a> docs: add missing correct/incorrect containers (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16087">#16087</a>) (Milos Djermanovic)</li> <li><a href="09f6acbf21"><code>09f6acb</code></a> docs: fix UI bug on rules index and details pages (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16082">#16082</a>) (Deepshika S)</li> <li><a href="f5db264931"><code>f5db264</code></a> docs: remove remaining duplicate rule descriptions (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16093">#16093</a>) (Milos Djermanovic)</li> <li><a href="32a6b2a5ca"><code>32a6b2a</code></a> docs: Add scroll behaviour smooth (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16056">#16056</a>) (Amaresh S M)</li> </ul> <h2>Chores</h2> <ul> <li><a href="bbf8df41c9"><code>bbf8df4</code></a> chore: Mark autogenerated release blog post as draft (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16130">#16130</a>) (Nicholas C. Zakas)</li> <li><a href="eee43067f6"><code>eee4306</code></a> chore: update internal lint dependencies (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16088">#16088</a>) (Bryan Mishkin)</li> <li><a href="9615a42c9f"><code>9615a42</code></a> chore: update formatter examples template to avoid markdown lint error (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16085">#16085</a>) (Milos Djermanovic)</li> <li><a href="62541edf58"><code>62541ed</code></a> chore: fix markdown linting error (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16083">#16083</a>) (唯然)</li> </ul> <h2>v8.19.0</h2> <h2>Features</h2> <ul> <li><a href="7023628eb3"><code>7023628</code></a> feat: add importNames support for patterns in no-restricted-imports (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16059">#16059</a>) (Brandon Scott)</li> <li><a href="472c368136"><code>472c368</code></a> feat: fix handling of blockless <code>with</code> statements in indent rule (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16068">#16068</a>) (Milos Djermanovic)</li> </ul> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/eslint/eslint/blob/main/CHANGELOG.md">eslint's changelog</a>.</em></p> <blockquote> <p>v8.21.0 - August 1, 2022</p> <ul> <li><a href="7b43ea14a8"><code>7b43ea1</code></a> feat: Implement FlatESLint (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16149">#16149</a>) (Nicholas C. Zakas)</li> <li><a href="8892511948"><code>8892511</code></a> chore: Upgrade to Espree 9.3.3 (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16173">#16173</a>) (Brandon Mills)</li> <li><a href="92bf49a4b3"><code>92bf49a</code></a> feat: improve the key width calculation in <code>key-spacing</code> rule (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16154">#16154</a>) (Nitin Kumar)</li> <li><a href="c4615421cb"><code>c461542</code></a> feat: add new <code>allowLineSeparatedGroups</code> option to the <code>sort-keys</code> rule (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16138">#16138</a>) (Nitin Kumar)</li> <li><a href="1cdcbca8a9"><code>1cdcbca</code></a> feat: add deprecation warnings for legacy API in <code>RuleTester</code> (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16063">#16063</a>) (Nitin Kumar)</li> <li><a href="0396775527"><code>0396775</code></a> fix: lines-around-comment apply <code>allowBlockStart</code> for switch statements (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16153">#16153</a>) (Nitin Kumar)</li> <li><a href="2aadc93272"><code>2aadc93</code></a> docs: add anchors to headings inside docs content (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16134">#16134</a>) (Strek)</li> <li><a href="1233beea39"><code>1233bee</code></a> chore: switch to eslint-plugin-node's maintained fork (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16150">#16150</a>) (唯然)</li> <li><a href="97b95c068d"><code>97b95c0</code></a> chore: upgrade puppeteer v13 (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16151">#16151</a>) (唯然)</li> </ul> <p>v8.20.0 - July 16, 2022</p> <ul> <li><a href="bbf8df41c9"><code>bbf8df4</code></a> chore: Mark autogenerated release blog post as draft (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16130">#16130</a>) (Nicholas C. Zakas)</li> <li><a href="845c4f4027"><code>845c4f4</code></a> docs: Add website team details (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16115">#16115</a>) (Nicholas C. Zakas)</li> <li><a href="5a0dfdb993"><code>5a0dfdb</code></a> docs: Link to blog post in no-constant-binary-expression (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16112">#16112</a>) (Jordan Eldredge)</li> <li><a href="bc692a9bf5"><code>bc692a9</code></a> docs: remove install command (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16084">#16084</a>) (Strek)</li> <li><a href="30be0ed4d8"><code>30be0ed</code></a> fix: no-warning-comments rule escapes special RegEx characters in terms (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16090">#16090</a>) (Lachlan Hunt)</li> <li><a href="ca83178b18"><code>ca83178</code></a> feat: catch preprocess errors (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16105">#16105</a>) (JounQin)</li> <li><a href="49ca3f0904"><code>49ca3f0</code></a> docs: don't show toc when content not found (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16095">#16095</a>) (Amaresh S M)</li> <li><a href="ba19e3f80a"><code>ba19e3f</code></a> docs: enhance 404 page UI (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16097">#16097</a>) (Amaresh S M)</li> <li><a href="bfe5e88409"><code>bfe5e88</code></a> fix: ignore spacing before <code>]</code> and <code>}</code> in comma-spacing (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16113">#16113</a>) (Milos Djermanovic)</li> <li><a href="a75d3b47b8"><code>a75d3b4</code></a> docs: remove unused meta.docs.category field in working-with-rules page (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16109">#16109</a>) (Brandon Scott)</li> <li><a href="cdc0206390"><code>cdc0206</code></a> docs: add formatters page edit link (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16094">#16094</a>) (Amaresh S M)</li> <li><a href="4d1ed22ded"><code>4d1ed22</code></a> docs: preselect default theme (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16098">#16098</a>) (Strek)</li> <li><a href="4b79612f0b"><code>4b79612</code></a> docs: add missing correct/incorrect containers (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16087">#16087</a>) (Milos Djermanovic)</li> <li><a href="09f6acbf21"><code>09f6acb</code></a> docs: fix UI bug on rules index and details pages (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16082">#16082</a>) (Deepshika S)</li> <li><a href="f5db264931"><code>f5db264</code></a> docs: remove remaining duplicate rule descriptions (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16093">#16093</a>) (Milos Djermanovic)</li> <li><a href="32a6b2a5ca"><code>32a6b2a</code></a> docs: Add scroll behaviour smooth (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16056">#16056</a>) (Amaresh S M)</li> <li><a href="eee43067f6"><code>eee4306</code></a> chore: update internal lint dependencies (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16088">#16088</a>) (Bryan Mishkin)</li> <li><a href="9615a42c9f"><code>9615a42</code></a> chore: update formatter examples template to avoid markdown lint error (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16085">#16085</a>) (Milos Djermanovic)</li> <li><a href="62541edf58"><code>62541ed</code></a> chore: fix markdown linting error (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16083">#16083</a>) (唯然)</li> </ul> <p>v8.19.0 - July 1, 2022</p> <ul> <li><a href="7023628eb3"><code>7023628</code></a> feat: add importNames support for patterns in no-restricted-imports (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16059">#16059</a>) (Brandon Scott)</li> <li><a href="472c368136"><code>472c368</code></a> feat: fix handling of blockless <code>with</code> statements in indent rule (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16068">#16068</a>) (Milos Djermanovic)</li> <li><a href="fc81848238"><code>fc81848</code></a> fix: throw helpful exception when rule has wrong return type (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16075">#16075</a>) (Bryan Mishkin)</li> <li><a href="e88493395b"><code>e884933</code></a> chore: use <code>github-slugger</code> for markdown anchors (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16067">#16067</a>) (Strek)</li> <li><a href="02e9cb01e7"><code>02e9cb0</code></a> chore: revamp carbon ad style (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16078">#16078</a>) (Amaresh S M)</li> <li><a href="3ae0574fc7"><code>3ae0574</code></a> docs: Remove duplicate rule descriptions (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16052">#16052</a>) (Amaresh S M)</li> <li><a href="b6aee9591e"><code>b6aee95</code></a> chore: remove unwanted comments from rules markdown (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16054">#16054</a>) (Strek)</li> <li><a href="f50cf436aa"><code>f50cf43</code></a> docs: Add base href to each page to fix relative URLs (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16046">#16046</a>) (Nicholas C. Zakas)</li> <li><a href="6840940a76"><code>6840940</code></a> chore: correctly use .markdownlintignore in Makefile (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16060">#16060</a>) (Bryan Mishkin)</li> <li><a href="ae4b449719"><code>ae4b449</code></a> docs: make logo link clickable on small width screens (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16058">#16058</a>) (Milos Djermanovic)</li> <li><a href="280f898bff"><code>280f898</code></a> docs: use only fenced code blocks (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16044">#16044</a>) (Milos Djermanovic)</li> <li><a href="f5d63b9e15"><code>f5d63b9</code></a> docs: add listener only if element exists (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16045">#16045</a>) (Amaresh S M)</li> <li><a href="8b639ccb2f"><code>8b639cc</code></a> docs: add missing migrating-to-8.0.0 in the user guide (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16048">#16048</a>) (唯然)</li> <li><a href="b8e68c1f7e"><code>b8e68c1</code></a> docs: Update release process (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16036">#16036</a>) (Nicholas C. Zakas)</li> </ul> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="9c53ed4025"><code>9c53ed4</code></a> 8.21.0</li> <li><a href="fd404a5cb3"><code>fd404a5</code></a> Build: changelog update for 8.21.0</li> <li><a href="7b43ea14a8"><code>7b43ea1</code></a> feat: Implement FlatESLint (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16149">#16149</a>)</li> <li><a href="8892511948"><code>8892511</code></a> chore: Upgrade to Espree 9.3.3 (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16173">#16173</a>)</li> <li><a href="92bf49a4b3"><code>92bf49a</code></a> feat: improve the key width calculation in <code>key-spacing</code> rule (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16154">#16154</a>)</li> <li><a href="c4615421cb"><code>c461542</code></a> feat: add new <code>allowLineSeparatedGroups</code> option to the <code>sort-keys</code> rule (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16138">#16138</a>)</li> <li><a href="1cdcbca8a9"><code>1cdcbca</code></a> feat: add deprecation warnings for legacy API in <code>RuleTester</code> (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16063">#16063</a>)</li> <li><a href="0396775527"><code>0396775</code></a> fix: lines-around-comment apply <code>allowBlockStart</code> for switch statements (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16153">#16153</a>)</li> <li><a href="2aadc93272"><code>2aadc93</code></a> docs: add anchors to headings inside docs content (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16134">#16134</a>)</li> <li><a href="1233beea39"><code>1233bee</code></a> chore: switch to eslint-plugin-node's maintained fork (<a href="https://github-redirect.dependabot.com/eslint/eslint/issues/16150">#16150</a>)</li> <li>Additional commits viewable in <a href="https://github.com/eslint/eslint/compare/v8.17.0...v8.21.0">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `dependabot rebase` will rebase this PR - `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `dependabot merge` will merge this PR after your CI passes on it - `dependabot squash and merge` will squash and merge this PR after your CI passes on it - `dependabot cancel merge` will cancel a previously requested merge and block automerging - `dependabot reopen` will reopen this PR if it is closed - `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Pull Request resolved: https://github.com/facebook/flipper/pull/3958 Reviewed By: lblasa Differential Revision: D38315183 Pulled By: LukeDefeo fbshipit-source-id: 5903cc91d8de04c956c3bf4e0fdf8c99807fb452
js-flipper
This package exposes JavaScript bindings to talk from web / Node.js directly to flipper.
Installation
yarn add js-flipper
Usage
How to build Flipper plugins is explained in the flipper documentation: Creating a Flipper plugin. Building a Flipper plugin involves building a plugin for the Desktop app, and a plugin that runs on a Device (web or Node.js). This package is only needed for the plugin that runs on the device (web / Node.js), and wants to use the WebSocket connection to communicate to Flipper.
This package exposes a flipperClient. It has:
addPluginmethod. It accepts apluginparameter, that registers a client plugin and will fire the relevant callbacks if the corresponding desktop plugin is selected in the Flipper Desktop. The full plugin API is documented here.startmethod. It starts the client. It has two arguments:appName- (required) the name displayed in Flipperoptionswhich conforms to the interfaceinterface FlipperClientOptions { // Make the client connect to a different URL urlBase?: string; // Override WebSocket implementation (Node.js folks, it is for you!) websocketFactory?: (url: string) => FlipperWebSocket; // Override how errors are handled (it is simple `console.error` by default) onError?: (e: unknown) => void; // Timeout after which client tries to reconnect to Flipper reconnectTimeout?: number; // Set device ID. Default: random ID persisted to local storage. getDeviceId?: () => Promise<string> | string }
Example (web)
An example plugin can be found in FlipperTicTacToe.js.
The corresponding Desktop plugin ships by default in Flipper, so importing the
above file and dropping the <FlipperTicTacToe /> component somewhere in your
application should work out of the box.
The sources of the corresponding Desktop plugin can be found here.
Node.js
Node.js does not have a built-in WebSocket implementation. You need to install any implementation of WebSockets for Node.js that is compatible with the interface of the web version.
import flipperClient from 'js-flipper';
// Say, you decided to go with 'ws'
// https://github.com/websockets/ws
import WebSocket from 'ws';
// Start the client and pass some options
// You might ask yourself why there is the second argument `{ origin: 'localhost:' }`
// Flipper Desktop verifies the `Origin` header for every WS connection. You need to set it to one of the whitelisted values (see `VALID_WEB_SOCKET_REQUEST_ORIGIN_PREFIXES`).
flipperClient.start('My cool nodejs app', { websocketFactory: url => new WebSocket(url, {origin: 'localhost:'}) });
An example plugin should be somewhat similar to what we have for React. It is currently WIP (do not confuse with RIP!).