Repository: remarkjs/react-remark Branch: main Commit: 39553e5f5c9e Files: 17 Total size: 35.8 KB Directory structure: gitextract_o57pck0s/ ├── .github/ │ └── workflows/ │ ├── gh-page.yml │ └── main.yml ├── .gitignore ├── .husky/ │ └── pre-commit ├── .storybook/ │ └── main.ts ├── LICENSE ├── package.json ├── readme.md ├── src/ │ └── index.ts ├── stories/ │ ├── remark-component.stories.tsx │ ├── remark-hook-async.stories.tsx │ └── remark-hook-sync.stories.tsx ├── test/ │ ├── __snapshots__/ │ │ ├── remark-component.test.tsx.snap │ │ └── remark-hook.test.ts.snap │ ├── remark-component.test.tsx │ └── remark-hook.test.ts └── tsconfig.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/workflows/gh-page.yml ================================================ name: Deploy to GitHub pages on: push: branches: [main] jobs: build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 with: persist-credentials: false - name: Use Node uses: actions/setup-node@v3 with: node-version: 16 - name: Use cached node_modules uses: actions/cache@v3 with: path: node_modules key: nodeModules-${{ hashFiles('**/package-lock.json') }} restore-keys: | nodeModules- - name: Install dependencies run: npm ci env: CI: true - name: Build storybook run: npm run build-storybook - name: Deploy to GitHub pages uses: JamesIves/github-pages-deploy-action@releases/v3 with: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} BRANCH: gh-pages FOLDER: storybook-static CLEAN: true SINGLE_COMMIT: true ================================================ FILE: .github/workflows/main.yml ================================================ name: CI on: push: branches: [main] pull_request: branches: [main] jobs: build: strategy: matrix: platform: [ubuntu-latest, windows-latest, macos-latest] node-version: [12, 14, 16] name: '${{ matrix.platform }}: node.js ${{ matrix.node-version }}' runs-on: ${{ matrix.platform }} steps: - name: Begin CI... uses: actions/checkout@v3 - name: Use Node uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Use cached node_modules uses: actions/cache@v3 with: path: node_modules key: nodeModules-${{ hashFiles('**/package-lock.json') }} restore-keys: | nodeModules- - name: Install dependencies run: npm ci env: CI: true - name: Lint if: ${{ matrix.platform != 'windows-latest' }} run: npm run lint env: CI: true - name: Test run: npm test -- --ci --coverage --maxWorkers=2 env: CI: true - name: Build run: npm run build env: CI: true ================================================ FILE: .gitignore ================================================ *.log .DS_Store node_modules .cache dist/ storybook-static/ coverage/ ================================================ FILE: .husky/pre-commit ================================================ #!/bin/sh . "$(dirname "$0")/_/husky.sh" npm run lint ================================================ FILE: .storybook/main.ts ================================================ module.exports = { stories: ["../stories/**/*"], addons: ['@storybook/addon-essentials'], }; ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2020 Christian Murphy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: package.json ================================================ { "version": "2.1.0", "name": "react-remark", "description": "Renders Markdown as React components", "author": "Christian Murphy ", "license": "MIT", "repository": "remarkjs/react-remark", "bugs": "https://github.com/remarkjs/react-remark/issues", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" }, "main": "dist/index.js", "module": "dist/react-remark.esm.js", "typings": "dist/index.d.ts", "sideEffects": false, "files": [ "dist", "src" ], "engines": { "node": ">=10" }, "scripts": { "start": "tsdx watch", "build": "tsdx build", "test": "tsdx test", "lint": "tsdx lint", "prepare": "tsdx build", "postinstall": "husky install", "prepublishOnly": "pinst --disable", "postpublish": "pinst --enable", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook" }, "peerDependencies": { "react": ">=16.8" }, "dependencies": { "rehype-react": "^6.0.0", "remark-parse": "^9.0.0", "remark-rehype": "^8.0.0", "unified": "^9.0.0" }, "devDependencies": { "@babel/core": "^7.0.0", "@storybook/addon-essentials": "^6.0.0", "@storybook/react": "^6.0.0", "@testing-library/jest-dom": "^5.0.0", "@testing-library/react": "^12.0.0", "@testing-library/react-hooks": "^7.0.0", "@types/react": "^17.0.0", "@types/react-dom": "^17.0.0", "husky": "^7.0.0", "katex": "^0.13.0", "pinst": "^2.0.0", "react": "^17.0.0", "react-dom": "^17.0.0", "react-test-renderer": "^17.0.0", "rehype-katex": "^5.0.0", "rehype-raw": "^5.0.0", "rehype-sanitize": "^4.0.0", "remark-gfm": "^1.0.0", "remark-math": "^4.0.0", "tsdx": "^0.14.0", "typescript": "^3.0.0" }, "prettier": { "printWidth": 80, "semi": true, "singleQuote": true, "trailingComma": "es5" }, "renovate": { "extends": [ "config:base", ":preserveSemverRanges" ] } } ================================================ FILE: readme.md ================================================ # react-remark [![CI](https://github.com/remarkjs/react-remark/workflows/CI/badge.svg?branch=main)](https://github.com/remarkjs/react-remark/actions?query=workflow%3ACI) [![Downloads](https://img.shields.io/npm/dm/react-remark.svg)](https://www.npmjs.com/package/react-remark) [![Size](https://img.shields.io/bundlephobia/minzip/react-remark.svg)](https://bundlephobia.com/result?p=react-remark) **react-remark** offers a [React hook](https://reactjs.org/docs/hooks-intro.html) and [React component](https://reactjs.org/docs/glossary.html#components) based way of rendering [markdown](https://commonmark.org/) into [React](https://reactjs.org) using [remark](https://github.com/remarkjs/remark) ## Installation _npm_ ``` npm install --save react-remark ``` _yarn_ ``` yarn add react-remark ``` ## Usage ### As a hook #### Render static content ```tsx import React, { useEffect } from 'react'; import { useRemark } from 'react-remark'; const ExampleComponent = () => { const [reactContent, setMarkdownSource] = useRemark(); useEffect(() => { setMarkdownSource('# markdown header'); }, []); return reactContent; }; export default ExampleComponent; ``` #### Using input and events to update ```tsx import React from 'react'; import { useRemark } from 'react-remark'; const ExampleComponent = () => { const [reactContent, setMarkdownSource] = useRemark(); return ( <> setMarkdownSource(currentTarget.value)} /> {reactContent} ); }; export default ExampleComponent; ``` ### Server side rendering ```tsx import React from 'react'; import { useRemarkSync } from 'react-remark'; const ExampleComponent = () => { const reactContent = useRemarkSync('# markdown header'); return reactContent; }; export default ExampleComponent; ``` :notebook: Note that some remark plugins are async, these plugins will error if used with `useRemarkSync`. [More examples of usage as hook in storybook.](https://remarkjs.github.io/react-remark/?path=/story/remark-hook) ### As a component #### Render static content ```tsx import React, { useState } from 'react'; import { Remark } from 'react-remark'; const ExampleComponent = () => ( {` # header 1. ordered 2. list `} ); export default ExampleComponent; ``` #### Using input and events to update ```tsx import React, { useState } from 'react'; import { Remark } from 'react-remark'; const ExampleComponent = () => { const [markdownSource, setMarkdownSource] = useState(''); return ( <> setMarkdownSource(currentTarget.value)} /> {markdownSource} ); }; export default ExampleComponent; ``` [More examples of usage as component in storybook.](https://remarkjs.github.io/react-remark/?path=/story/remark-component) ## Examples A set of runnable examples are provided through storybook at . The source for the story files can be found in [_/stories_](./stories). ## Architecture ``` react-remark +---------------------------------------------------------------------------------------------------------------------------------------------+ | | | +----------+ +----------------+ +---------------+ +----------------+ +--------------+ | | | | | | | | | | | | | | -markdown->+ remark +-mdast->+ remark plugins +-mdast->+ remark-rehype +-hast->+ rehype plugins +-hast->+ rehype-react +-react elements-> | | | | | | | | | | | | | | +----------+ +----------------+ +---------------+ +----------------+ +--------------+ | | | +---------------------------------------------------------------------------------------------------------------------------------------------+ ``` relevant links: [markdown](https://commonmark.org), [remark](https://github.com/remarkjs/remark), [mdast](https://github.com/syntax-tree/mdast), [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md), [remark-rehype](https://github.com/remarkjs/remark-rehype), [hast](https://github.com/syntax-tree/hast), [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md), [rehype-react](https://github.com/rehypejs/rehype-react) ## Options - `remarkParseOptions` (Object) - configure how Markdown is parsed, same as [`remark-parse` options](https://github.com/remarkjs/remark/tree/main/packages/remark-parse#options) - `remarkPlugins` (Array) - [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md) or [custom plugins](https://unifiedjs.com/learn/guide/create-a-plugin) to transform markdown content before it is translated to HTML (hast) - `remarkToRehypeOptions` (Object) - configure how Markdown (mdast) is translated into HTML (hast), same as [`remark-rehype` options](https://github.com/remarkjs/remark-rehype#api) - `rehypePlugins` (Array) - [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md) or [custom plugins](https://unifiedjs.com/learn/guide/create-a-plugin) to transform HTML (hast) before it is translated to React elements. - `rehypeReactOptions` (Object) - configure how HTML (hast) is translated into React elements, same as [`rehype-react` options](https://github.com/rehypejs/rehype-react#options) ### Pass options to hook ```tsx import React, { Fragment } from 'react'; import { useRemark } from 'react-remark'; import remarkGemoji from 'remark-gemoji'; import rehypeSlug from 'rehype-slug'; import rehypeAutoLinkHeadings from 'rehype-autolink-headings'; // ... const [reactContent, setMarkdownSource] = useRemark({ remarkPlugins: [remarkGemoji], remarkToRehypeOptions: { allowDangerousHtml: true }, rehypePlugins: [rehypeSlug, rehypeAutoLinkHeadings], rehypeReactOptions: { components: { p: (props) =>

, }, }, }); ``` ### Pass options to component ```tsx import React, { Fragment } from 'react'; import { Remark } from 'react-remark'; import remarkGemoji from 'remark-gemoji'; import rehypeSlug from 'rehype-slug'; import rehypeAutoLinkHeadings from 'rehype-autolink-headings'; // ...

, }, }} > {markdownSource} ; ``` ================================================ FILE: src/index.ts ================================================ import { FunctionComponent, Fragment, ReactElement, createElement, useState, useEffect, useCallback, } from 'react'; import unified, { PluggableList } from 'unified'; import remarkParse, { RemarkParseOptions } from 'remark-parse'; import { Options as RemarkRehypeOptions } from 'mdast-util-to-hast'; import remarkToRehype from 'remark-rehype'; import rehypeReact, { Options as RehypeReactOptions } from 'rehype-react'; type PartialBy = Omit & Partial>; export interface UseRemarkSyncOptions { remarkParseOptions?: RemarkParseOptions; remarkToRehypeOptions?: RemarkRehypeOptions; rehypeReactOptions?: PartialBy< RehypeReactOptions, 'createElement' >; remarkPlugins?: PluggableList; rehypePlugins?: PluggableList; } export const useRemarkSync = ( source: string, { remarkParseOptions, remarkToRehypeOptions, rehypeReactOptions, remarkPlugins = [], rehypePlugins = [], }: UseRemarkOptions = {} ): ReactElement => unified() .use(remarkParse, remarkParseOptions) .use(remarkPlugins) .use(remarkToRehype, remarkToRehypeOptions) .use(rehypePlugins) .use(rehypeReact, { createElement, Fragment, ...rehypeReactOptions, } as RehypeReactOptions) .processSync(source).result as ReactElement; export interface UseRemarkOptions extends UseRemarkSyncOptions { onError?: (err: Error) => void; } export const useRemark = ({ remarkParseOptions, remarkToRehypeOptions, rehypeReactOptions, remarkPlugins = [], rehypePlugins = [], onError = () => {}, }: UseRemarkOptions = {}): [ReactElement | null, (source: string) => void] => { const [reactContent, setReactContent] = useState(null); const setMarkdownSource = useCallback((source: string) => { unified() .use(remarkParse, remarkParseOptions) .use(remarkPlugins) .use(remarkToRehype, remarkToRehypeOptions) .use(rehypePlugins) .use(rehypeReact, { createElement, Fragment, ...rehypeReactOptions, } as RehypeReactOptions) .process(source) .then((vfile) => setReactContent(vfile.result as ReactElement)) .catch(onError); }, []); return [reactContent, setMarkdownSource]; }; export interface RemarkProps extends UseRemarkOptions { children: string; } export const Remark: FunctionComponent = ({ children, ...useRemarkOptions }: RemarkProps) => { const [reactContent, setMarkdownSource] = useRemark(useRemarkOptions); useEffect(() => { setMarkdownSource(children); }, [children, setMarkdownSource]); return reactContent; }; ================================================ FILE: stories/remark-component.stories.tsx ================================================ import React from 'react'; import remarkGfm from 'remark-gfm'; import remarkMath from 'remark-math'; import rehypeKatex from 'rehype-katex'; import rehypeRaw from 'rehype-raw'; import rehypeSanitize from 'rehype-sanitize'; import 'katex/dist/katex.min.css'; import { Remark } from '../src'; export default { title: 'Remark Component', component: Remark, }; export const CommonMark = ({ content }) => {content}; CommonMark.args = { content: `# header 1. ordered 2. list * unordered * list`, }; export const GithubFlavoredMarkdown = ({ content }) => ( {content} ); GithubFlavoredMarkdown.args = { content: `# header | column 1 | column 2 | | -------- | -------- | | first | row | `, }; export const MarkdownWithMath = ({ content }) => ( {content} ); MarkdownWithMath.args = { content: `Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following equation. $$ L = \\frac{1}{2} \\rho v^2 S C_L $$`, }; export const MixedHTMLSanitized = ({ content }) => ( {content} ); MixedHTMLSanitized.args = { content: `# header mixed with html `, }; ================================================ FILE: stories/remark-hook-async.stories.tsx ================================================ import { useEffect } from 'react'; import remarkGfm from 'remark-gfm'; import remarkMath from 'remark-math'; import rehypeKatex from 'rehype-katex'; import rehypeRaw from 'rehype-raw'; import rehypeSanitize from 'rehype-sanitize'; import 'katex/dist/katex.min.css'; import { useRemarkSync } from '../src'; export default { title: 'Remark Hooks/sync and ssr with useRemarkSync', component: useRemarkSync, }; export const CommonMark = ({ content }) => { return useRemarkSync(content); }; CommonMark.args = { content: `# header 1. ordered 2. list * unordered * list`, }; export const GithubFlavoredMarkdown = ({ content }) => { return ( useRemarkSync(content, { remarkPlugins: [remarkGfm], }) || <> ); }; GithubFlavoredMarkdown.args = { content: `# header | column 1 | column 2 | | -------- | -------- | | first | row | `, }; export const MarkdownWithMath = ({ content }) => { return useRemarkSync(content, { remarkPlugins: [remarkMath], rehypePlugins: [rehypeKatex], }); }; MarkdownWithMath.args = { content: `Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following equation. $$ L = \\frac{1}{2} \\rho v^2 S C_L $$`, }; export const MixedHTMLSanitized = ({ content }) => { return useRemarkSync(content, { remarkToRehypeOptions: { allowDangerousHtml: true }, rehypePlugins: [rehypeRaw, rehypeSanitize], }); }; MixedHTMLSanitized.args = { content: `# header mixed with html`, }; ================================================ FILE: stories/remark-hook-sync.stories.tsx ================================================ import { useEffect } from 'react'; import remarkGfm from 'remark-gfm'; import remarkMath from 'remark-math'; import rehypeKatex from 'rehype-katex'; import rehypeRaw from 'rehype-raw'; import rehypeSanitize from 'rehype-sanitize'; import 'katex/dist/katex.min.css'; import { useRemark } from '../src'; export default { title: 'Remark Hooks/standard use with useRemark', component: useRemark, }; export const CommonMark = ({ content }) => { const [reactContent, setMarkdownSource] = useRemark(); useEffect(() => { setMarkdownSource(content); }, [content]); return reactContent || <>; }; CommonMark.args = { content: `# header 1. ordered 2. list * unordered * list`, }; export const GithubFlavoredMarkdown = ({ content }) => { const [reactContent, setMarkdownSource] = useRemark({ remarkPlugins: [remarkGfm], }); useEffect(() => { setMarkdownSource(content); }, [content]); return reactContent || <>; }; GithubFlavoredMarkdown.args = { content: `# header | column 1 | column 2 | | -------- | -------- | | first | row | `, }; export const MarkdownWithMath = ({ content }) => { const [reactContent, setMarkdownSource] = useRemark({ remarkPlugins: [remarkMath], rehypePlugins: [rehypeKatex], }); useEffect(() => { setMarkdownSource(content); }, [content]); return reactContent || <>; }; MarkdownWithMath.args = { content: `Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following equation. $$ L = \\frac{1}{2} \\rho v^2 S C_L $$`, }; export const MixedHTMLSanitized = ({ content }) => { const [reactContent, setMarkdownSource] = useRemark({ remarkToRehypeOptions: { allowDangerousHtml: true }, rehypePlugins: [rehypeRaw, rehypeSanitize], }); useEffect(() => { setMarkdownSource(content); }, [content]); return reactContent || <>; }; MixedHTMLSanitized.args = { content: `# header mixed with html`, }; ================================================ FILE: test/__snapshots__/remark-component.test.tsx.snap ================================================ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Remark should render content 1`] = `

header

`; ================================================ FILE: test/__snapshots__/remark-hook.test.ts.snap ================================================ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`useRemark should render content 1`] = `

header

`; exports[`useRemark should support custom element renderer 1`] = `

heading

`; exports[`useRemark should support gfm through remark plugins 1`] = `

https://example.com

`; exports[`useRemark should support html through rehype plugins 1`] = `

example

`; exports[`useRemark should support math through remark and rehype plugins 1`] = `

Lift( L L ) can be determined by Lift Coefficient ( C L C_L

`; exports[`useRemarkSync should render content 1`] = `

header

`; exports[`useRemarkSync should support custom element renderer 1`] = `

heading

`; exports[`useRemarkSync should support gfm through remark plugins 1`] = `

https://example.com

`; exports[`useRemarkSync should support html through rehype plugins 1`] = `

example

`; exports[`useRemarkSync should support math through remark and rehype plugins 1`] = `

Lift( L L ) can be determined by Lift Coefficient ( C L C_L

`; ================================================ FILE: test/remark-component.test.tsx ================================================ import React from 'react'; import { render, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom/extend-expect'; import { Remark } from '../src'; describe('Remark', () => { it('should render content', async () => { const { container, getByText } = render(# header); await waitFor(() => { expect(getByText('header')).toBeInTheDocument(); }); expect(container.firstChild).toMatchSnapshot(); }); }); ================================================ FILE: test/remark-hook.test.ts ================================================ import { createElement } from 'react'; import type { ComponentPropsWithoutNode } from 'rehype-react'; import { renderHook, act } from '@testing-library/react-hooks'; import '@testing-library/jest-dom/extend-expect'; import remarkGfm from 'remark-gfm'; import rehypeRaw from 'rehype-raw'; import rehypeSanitize from 'rehype-sanitize'; import remarkMath from 'remark-math'; import rehypeKatex from 'rehype-katex'; import { useRemark, useRemarkSync } from '../src'; describe('useRemark', () => { it('should render content', async () => { const { result, waitForNextUpdate } = renderHook(() => useRemark()); act(() => { result.current[1]('# header'); }); await waitForNextUpdate(); expect(result.current[0]).toMatchSnapshot(); }); it('should support gfm through remark plugins', async () => { const { result, waitForNextUpdate } = renderHook(() => useRemark({ remarkPlugins: [remarkGfm] }) ); act(() => { result.current[1]('https://example.com'); }); await waitForNextUpdate(); expect(result.current[0]).toMatchSnapshot(); }); it('should support html through rehype plugins', async () => { const { result, waitForNextUpdate } = renderHook(() => useRemark({ remarkToRehypeOptions: { allowDangerousHtml: true }, rehypePlugins: [rehypeRaw, rehypeSanitize], }) ); act(() => { result.current[1]('example'); }); await waitForNextUpdate(); expect(result.current[0]).toMatchSnapshot(); }); it('should support math through remark and rehype plugins', async () => { const { result, waitForNextUpdate } = renderHook(() => useRemark({ remarkPlugins: [remarkMath], rehypePlugins: [rehypeKatex], }) ); act(() => { result.current[1]( 'Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following equation.' ); }); await waitForNextUpdate(); expect(result.current[0]).toMatchSnapshot(); }); it('should support custom element renderer', async () => { const { result, waitForNextUpdate } = renderHook(() => useRemark({ rehypeReactOptions: { components: { h1: (props: ComponentPropsWithoutNode) => createElement('h2', props), }, }, }) ); act(() => { result.current[1]('# heading'); }); await waitForNextUpdate(); expect(result.current[0]).toMatchSnapshot(); }); }); describe('useRemarkSync', () => { it('should render content', async () => { const { result } = renderHook(() => useRemarkSync('# header')); expect(result.current).toMatchSnapshot(); }); it('should support gfm through remark plugins', async () => { const { result } = renderHook(() => useRemarkSync('https://example.com', { remarkPlugins: [remarkGfm] }) ); expect(result.current).toMatchSnapshot(); }); it('should support html through rehype plugins', async () => { const { result } = renderHook(() => useRemarkSync('example', { remarkToRehypeOptions: { allowDangerousHtml: true }, rehypePlugins: [rehypeRaw, rehypeSanitize], }) ); expect(result.current).toMatchSnapshot(); }); it('should support math through remark and rehype plugins', async () => { const { result } = renderHook(() => useRemarkSync( 'Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following equation.', { remarkPlugins: [remarkMath], rehypePlugins: [rehypeKatex], } ) ); expect(result.current).toMatchSnapshot(); }); it('should support custom element renderer', async () => { const { result } = renderHook(() => useRemarkSync('# heading', { rehypeReactOptions: { components: { h1: (props: ComponentPropsWithoutNode) => createElement('h2', props), }, }, }) ); expect(result.current).toMatchSnapshot(); }); }); ================================================ FILE: tsconfig.json ================================================ { "include": ["src", "types"], "compilerOptions": { "module": "esnext", "lib": ["dom", "esnext"], "importHelpers": true, "declaration": true, "sourceMap": true, "rootDir": "./src", "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "moduleResolution": "node", "baseUrl": "./", "paths": { "@": ["./"], "*": ["src/*", "node_modules/*"] }, "jsx": "react", "esModuleInterop": true } }