{"id":15365726,"url":"https://github.com/tunnckocore/flow-reporter-codeframe","last_synced_at":"2026-03-08T00:33:02.723Z","repository":{"id":33677758,"uuid":"144349083","full_name":"tunnckoCore/flow-reporter-codeframe","owner":"tunnckoCore","description":"⚡️ FlowType errors reporter similiar to ESLint's codeframe one :tada:","archived":false,"fork":false,"pushed_at":"2022-12-09T02:07:22.000Z","size":2165,"stargazers_count":3,"open_issues_count":15,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T07:42:52.233Z","etag":null,"topics":["cli","codeframe","error-reporting","errors","eslint","flow","flow-reporter","flowtype","reporter"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tunnckoCore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-11T02:28:29.000Z","updated_at":"2020-07-19T12:28:14.000Z","dependencies_parsed_at":"2023-01-15T02:15:18.770Z","dependency_job_id":null,"html_url":"https://github.com/tunnckoCore/flow-reporter-codeframe","commit_stats":null,"previous_names":["olstenlarck/flow-reporter-codeframe"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fflow-reporter-codeframe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fflow-reporter-codeframe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fflow-reporter-codeframe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fflow-reporter-codeframe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tunnckoCore","download_url":"https://codeload.github.com/tunnckoCore/flow-reporter-codeframe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249048713,"owners_count":21204306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","codeframe","error-reporting","errors","eslint","flow","flow-reporter","flowtype","reporter"],"created_at":"2024-10-01T13:15:43.273Z","updated_at":"2026-03-08T00:33:02.286Z","avatar_url":"https://github.com/tunnckoCore.png","language":"JavaScript","funding_links":["https://paypal.me/tunnckoCore/10","https://www.patreon.com/bePatron?u=5579781"],"categories":[],"sub_categories":[],"readme":"# flow-reporter-codeframe [![npm version][npmv-img]][npmv-url] [![github release][ghrelease-img]][ghrelease-url] [![License][license-img]][license-url]\n\n\u003e [@FlowType](https://flow.org) errors reporter similiar to ESLint's codeframe one\n\n\u003cdiv id=\"thetop\"\u003e\u003c/div\u003e\n\n[![Code style][codestyle-img]][codestyle-url]\n[![CircleCI linux build][linuxbuild-img]][linuxbuild-url]\n[![CodeCov coverage status][codecoverage-img]][codecoverage-url]\n[![DavidDM dependency status][dependencies-img]][dependencies-url]\n[![Renovate App Status][renovateapp-img]][renovateapp-url]\n[![Make A Pull Request][prs-welcome-img]][prs-welcome-url]\n[![Semantically Released][new-release-img]][new-release-url]\n\nIf you have any _how-to_ kind of questions, please read the [Contributing Guide](./CONTRIBUTING.md) and [Code of Conduct](./CODE_OF_CONDUCT.md) documents.  \nFor bugs reports and feature requests, [please create an issue][open-issue-url] or ping [@tunnckoCore](https://twitter.com/tunnckoCore) at Twitter.\n\n[![Conventional Commits][ccommits-img]][ccommits-url]\n[![Become a Patron][patreon-img]][patreon-url]\n[![Share Love Tweet][shareb]][shareu]\n[![NPM Downloads Weekly][downloads-weekly-img]][npmv-url]\n[![NPM Downloads Monthly][downloads-monthly-img]][npmv-url]\n[![NPM Downloads Total][downloads-total-img]][npmv-url]\n\nProject is [semantically](https://semver.org) \u0026 automatically released on [CircleCI][codecoverage-url] with [new-release][] and its [New Release](https://github.com/apps/new-release) GitHub App.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/olstenlarck/flow-reporter-codeframe\"\u003e\n    \u003cimg src=\"./media/demo.png\" width=\"85%\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Table of Contents\n- [Install](#install)\n- [CLI](#cli)\n- [API](#api)\n  * [flowReporter](#flowreporter)\n  * [.getDefaultOptions](#getdefaultoptions)\n- [Contributing](#contributing)\n  * [Follow the Guidelines](#follow-the-guidelines)\n  * [Support the project](#support-the-project)\n  * [OPEN Open Source](#open-open-source)\n  * [Wonderful Contributors](#wonderful-contributors)\n- [License](#license)\n\n## Install\nThis project requires [**Node.js**](https://nodejs.org) **\u003e=6.0.0**. Install it using \n[**yarn**](https://yarnpkg.com) or [**npm**](https://npmjs.com).  \n_We highly recommend to use Yarn when you think to contribute to this project._\n\n```bash\n$ yarn add flow-reporter-codeframe\n```\n\n## CLI\nUse `flow check` or `flow focus-check filename.js` and the json formatter.\n ```\n# general use\nflow check --json --json-version 2 | flow-reporter-codeframe\n # or\ncat report-file.txt | flow-reporter-codeframe\n # or generate report file\nflow check --json --json-version 2 \u003e flow-report.json\n # and pass that file to the reporter\nflow-reporter-codeframe flow-report.json\n```\n Optionally pass `--no-color` to disable colors - make note that we detect if it is\nrun on CI, so they are disabled there.\n Optionally, we can highlight the code, pass `--highlight-code` if you want to be more fancy. :)\nIf `--no-color` is passed, that's disabled automagically too.\n\n## API\n_Generated using [docks](http://npm.im/docks)._\n\n### [flowReporter](/src/index.js#L43)\nFormatting the `val` to look like ESLint's cool `codeframe` reporter.\nIt may be a bit more verbose and to have a bit more lines of code than\nthe Flow's default one, but that's not a bad thing.\n\nYou should provide valid report, which means that for now you are forced to\nuse `--json --json-version 2` flags if you want to use that reporter.\n\n**Params**\n- `val` **{string|object}** the Flow's JSON version 2 thingy, `--json` + `--json-version 2`\n- `opts` **{object}** optional options `color` and `highlightCode`\n\n**Returns**\n- `Promise` resolves to a `string` if there is errors, `undefined` if no errors\n\n**Examples**\n```javascript\nimport execa from 'execa';\nimport reporter from 'flow-reporter-codeframe';\n\nasync function main() {\n  try {\n    await execa('flow', ['check', '--json', '--json-version', '2']);\n  } catch (err) {\n    const output = await reporter(err.stdout);\n    console.log(output);\n  }\n}\n\nmain();\n```\n\n### [.getDefaultOptions](/src/index.js#L237)\nGet default options for the reporter. By default,\nwe have colors turned on, and highlighting code turned off.\n\n**Returns**\n- `object` containing `{ color: boolean, highlightCode: boolean }`\n\n**Examples**\n```javascript\nimport { getDefaultOptions } from 'flow-reporter-codeframe';\n\nconsole.log(getDefaultOptions());\n// =\u003e { color: true, highlightCode: false }\n```\n\n**[back to top](#thetop)**\n\n## Contributing\n\n### Follow the Guidelines\nPlease read the [Contributing Guide](./CONTRIBUTING.md) and [Code of Conduct](./CODE_OF_CONDUCT.md) documents for \nadvices.  \nFor bugs reports and feature requests, [please create an issue][open-issue-url] or ping \n[@tunnckoCore](https://twitter.com/tunnckoCore) at Twitter.\n\n### Support the project\n\n[Become a Partner or Sponsor?][patreon-url] :dollar: Check the **Partner**, **Sponsor** or **Omega-level** tiers! :tada: You can \nget your company logo, link \u0026 name on this file. It's also rendered on package's page in [npmjs.com][npmv-url] and \n[yarnpkg.com](https://yarnpkg.com/en/package/flow-reporter-codeframe) sites too! :rocket:\n\nNot financial support? Okey! [Pull requests](https://github.com/tunnckoCore/contributing#opening-a-pull-request), stars \nand all kind of [contributions](https://opensource.guide/how-to-contribute/#what-it-means-to-contribute) are always \nwelcome. :sparkles:\n\n### OPEN Open Source\n\nThis project is following [OPEN Open Source](http://openopensource.org) model\n\n\u003e Individuals making significant and valuable contributions are given commit-access to the project to \ncontribute as they see fit. This project is built on collective efforts and it's not strongly guarded by its founders.\n\nThere are a few basic ground-rules for its contributors\n\n1. Any **significant modifications** must be subject to a pull request to get feedback from other contributors.\n2. [Pull requests](https://github.com/tunnckoCore/contributing#opening-a-pull-request) to get feedback are \n_encouraged_ for any other trivial contributions, but are not required.\n3. Contributors should attempt to adhere to the prevailing code-style and development workflow.\n\n### Wonderful Contributors\nThanks to the hard work of these wonderful people this project is alive! It follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification.  \nDon't hesitate to add yourself to that list if you have made any contribution! ;) [See how, here](https://github.com/jfmengels/all-contributors-cli#usage).\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n| [\u003cimg src=\"https://avatars3.githubusercontent.com/u/5038030?v=4\" width=\"120px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eCharlike Mike Reagent\u003c/b\u003e\u003c/sub\u003e](https://tunnckocore.com)\u003cbr /\u003e[💻](https://github.com/olstenlarck/flow-reporter-codeframe/commits?author=olstenlarck \"Code\") [📖](https://github.com/olstenlarck/flow-reporter-codeframe/commits?author=olstenlarck \"Documentation\") [💬](#question-olstenlarck \"Answering Questions\") [👀](#review-olstenlarck \"Reviewed Pull Requests\") [🔍](#fundingFinding-olstenlarck \"Funding Finding\") |\n| :---: |\n\nConsider showing your [support](#support-the-project) to them. :sparkling_heart:\n\n## License\nCopyright (c) 2018-present, [contributors](#wonderful-contributors). Released under the [Apache-2.0 License][license-url].\n\n---\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on August 11, 2018._\n\n\u003c!-- Heading badges --\u003e\n[npmv-url]: https://www.npmjs.com/package/flow-reporter-codeframe\n[npmv-img]: https://badgen.net/npm/v/flow-reporter-codeframe?icon=npm\n\n[ghrelease-url]: https://github.com/tunnckoCore/flow-reporter-codeframe/releases/latest\n[ghrelease-img]: https://badgen.net/github/release/olstenlarck/flow-reporter-codeframe?icon=github\n\n[license-url]: https://github.com/tunnckoCore/flow-reporter-codeframe/blob/master/LICENSE\n[license-img]: https://badgen.net/npm/license/flow-reporter-codeframe\n\n\u003c!-- Front line badges --\u003e\n\n[codestyle-url]: https://github.com/tunnckoCore/eslint-config-esmc\n[codestyle-img]: https://badgen.net/badge/code%20style/airbnb/ff5a5f?icon=airbnb\n\n[linuxbuild-url]: https://circleci.com/gh/tunnckoCore/flow-reporter-codeframe/tree/master\n[linuxbuild-img]: https://badgen.net/circleci/github/tunnckoCore/flow-reporter-codeframe/master?label=build\u0026icon=circleci\n\n[codecoverage-url]: https://codecov.io/gh/tunnckoCore/flow-reporter-codeframe\n[codecoverage-img]: https://badgen.net/codecov/c/github/tunnckoCore/flow-reporter-codeframe?icon=codecov\n\n[dependencies-url]: https://david-dm.org/tunnckoCore/flow-reporter-codeframe\n[dependencies-img]: https://badgen.net/david/dep/tunnckoCore/flow-reporter-codeframe?label=deps\n\n[ccommits-url]: https://conventionalcommits.org/\n[ccommits-img]: https://badgen.net/badge/conventional%20commits/v1.0.0/dfb317\n\n[new-release-url]: https://github.com/tunnckoCore/new-release\n[new-release-img]: https://badgen.net/badge/semantically/released/05c5ff\n\n[downloads-weekly-img]: https://badgen.net/npm/dw/flow-reporter-codeframe\n[downloads-monthly-img]: https://badgen.net/npm/dm/flow-reporter-codeframe\n[downloads-total-img]: https://badgen.net/npm/dt/flow-reporter-codeframe\n\n[renovateapp-url]: https://renovatebot.com\n[renovateapp-img]: https://badgen.net/badge/renovate/enabled/green\n\n[prs-welcome-img]: https://badgen.net/badge/PRs/welcome/green\n[prs-welcome-url]: http://makeapullrequest.com\n\n[paypal-donate-url]: https://paypal.me/tunnckoCore/10\n[paypal-donate-img]: https://badgen.net/badge/$/support/purple\n\n[patreon-url]: https://www.patreon.com/bePatron?u=5579781\n[patreon-img]: https://badgen.net/badge/patreon/tunnckoCore/F96854?icon=patreon\n\n[patreon-sponsor-img]: https://badgen.net/badge/become/a%20sponsor/F96854?icon=patreon\n\n[shareu]: https://twitter.com/intent/tweet?text=https://github.com/olstenlarck/flow-reporter-codeframe\u0026via=tunnckoCore\n[shareb]: https://badgen.net/badge/twitter/share/1da1f2?icon=twitter\n[open-issue-url]: https://github.com/olstenlarck/flow-reporter-codeframe/issues/new\n[author-link]: https://tunnckocore.com\n\n[new-release]: https://github.com/tunnckoCore/new-release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fflow-reporter-codeframe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftunnckocore%2Fflow-reporter-codeframe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fflow-reporter-codeframe/lists"}