Skip to content

Commit

Permalink
Fix linting (#1161)
Browse files Browse the repository at this point in the history
* Fix linting

* Fix error in remark formatter
  • Loading branch information
johno committed Jul 17, 2020
1 parent 577d48f commit 3ca8e0a
Show file tree
Hide file tree
Showing 36 changed files with 63 additions and 61 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Expand Up @@ -21,3 +21,5 @@ packages/remark-mdx
# tmp
examples/vue
packages/vue

readme.md
2 changes: 2 additions & 0 deletions docs/advanced/contributing.mdx
@@ -1 +1,3 @@
import Redirect from 'gatsby-theme-mdx/src/components/redirect'

<Redirect to="/contributing" />
2 changes: 2 additions & 0 deletions docs/advanced/custom-loader.mdx
@@ -1 +1,3 @@
import Redirect from 'gatsby-theme-mdx/src/components/redirect'

<Redirect to="/guides/custom-loader" />
2 changes: 2 additions & 0 deletions docs/advanced/retext-plugins.mdx
@@ -1 +1,3 @@
import Redirect from 'gatsby-theme-mdx/src/components/redirect'

<Redirect to="/advanced/using-plugins#using-retext-plugins" />
2 changes: 2 additions & 0 deletions docs/advanced/specification.mdx
@@ -1 +1,3 @@
import Redirect from 'gatsby-theme-mdx/src/components/redirect'

<Redirect to="/advanced/ast" />
2 changes: 2 additions & 0 deletions docs/advanced/sync-api.mdx
@@ -1 +1,3 @@
import Redirect from 'gatsby-theme-mdx/src/components/redirect'

<Redirect to="/advanced/api#sync-api" />
2 changes: 2 additions & 0 deletions docs/advanced/writing-a-plugin.mdx
@@ -1 +1,3 @@
import Redirect from 'gatsby-theme-mdx/src/components/redirect'

<Redirect to="/guides/custom-loader" />
2 changes: 2 additions & 0 deletions docs/editor-plugins.mdx
@@ -1 +1,3 @@
import Redirect from 'gatsby-theme-mdx/src/components/redirect'

<Redirect to="/editors" />
2 changes: 1 addition & 1 deletion docs/getting-started/index.mdx
@@ -1,6 +1,6 @@
import {Box} from '@rebass/emotion'

import TableOfComponents from './_table-of-components.mdx'
import TableOfComponents from './table-of-components.mdx'

# Getting Started

Expand Down
2 changes: 2 additions & 0 deletions docs/getting-started/typescript.mdx
@@ -1 +1,3 @@
import Redirect from 'gatsby-theme-mdx/src/components/redirect'

<Redirect to="/advanced/typescript" />
2 changes: 2 additions & 0 deletions docs/plugins.mdx
@@ -1 +1,3 @@
import Redirect from 'gatsby-theme-mdx/src/components/redirect'

<Redirect to="/advanced/plugins" />
2 changes: 2 additions & 0 deletions docs/syntax.mdx
@@ -1 +1,3 @@
import Redirect from 'gatsby-theme-mdx/src/components/redirect'

<Redirect to="/getting-started#syntax" />
2 changes: 1 addition & 1 deletion docs/table-of-components.mdx
@@ -1,4 +1,4 @@
import TableOfComponents from './getting-started/_table-of-components.mdx'
import TableOfComponents from './getting-started/table-of-components.mdx'

# Table of components

Expand Down
26 changes: 16 additions & 10 deletions examples/create-react-app/readme.md
Expand Up @@ -8,36 +8,42 @@ In the project directory, you can run:

### `npm start`

Runs the app in the development mode.<br>
Open <http://localhost:3000> to view it in the browser.
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
The page will reload if you make edits.<br />
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.<br>
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.<br>
Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br>
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
**Note: this is a one-way operation.
Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time.
This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them.
All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them.
At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
You don’t have to ever use `eject`.
The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature.
However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -17,7 +17,7 @@
},
"scripts": {
"build": "r -f cjs,esm -o dist --exclude 'babel-plugin-*,create-mdx,*loader,mdx,parcel-plugin-mdx,remark-*,*util'",
"clean": "lerna exec \"rimraf dist node_modules\"",
"clean": "lerna exec \"rimraf dist node_modules\" && gatsby clean",
"docs": "gatsby develop",
"docs-build": "gatsby build",
"docs-deploy": "now && now alias $(pbpaste) mdxjs.com && now alias $(pbpaste) www.mdxjs.com",
Expand Down
2 changes: 0 additions & 2 deletions packages/create-mdx/readme.md
Expand Up @@ -36,8 +36,6 @@ abide by its terms.

[MIT][] © [Compositor][] and [Vercel][]

<!-- Definitions -->

[build]: https://travis-ci.com/mdx-js/mdx
[build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master
[lerna]: https://lernajs.io/
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-theme-mdx/src/components/code-preview.js
Expand Up @@ -14,7 +14,7 @@ const transformCode = isMDX => src => {
let transpiledMDX
try {
transpiledMDX = mdx.sync(src, {skipExport: true})
} catch (e) {
} catch (_e) {
return ''
}

Expand Down
Expand Up @@ -18,7 +18,7 @@ const transformCode = src => {
skipExport: true,
remarkPlugins: [removeImports, removeExports]
})
} catch (e) {
} catch (_e) {
return ''
}

Expand Down
9 changes: 5 additions & 4 deletions packages/loader/readme.md
Expand Up @@ -29,14 +29,17 @@ module: {
}
```

The `renderer` option specifies a string that will be prepended to the generated source allowing for the use of any `createElement` implementation. By default, that string is:
The `renderer` option specifies a string that will be prepended to the generated
source allowing for the use of any `createElement` implementation.
By default, that string is:

```js
import React from 'react'
import {mdx} from '@mdx-js/react'
```

Using the `renderer` option, one can swap out React for another implementation. The example below wraps a generic JSX compatible function named `h`.
Using the `renderer` option, one can swap out React for another implementation.
The example below wraps a generic JSX compatible function named `h`.

```js
const renderer = `
Expand Down Expand Up @@ -89,8 +92,6 @@ abide by its terms.

[MIT][] © [Compositor][] and [Vercel][]

<!-- Definitions -->

[build]: https://travis-ci.com/mdx-js/mdx
[build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master
[lerna]: https://lernajs.io/
Expand Down
1 change: 0 additions & 1 deletion packages/mdx/mdx-hast-to-jsx.js
Expand Up @@ -144,7 +144,6 @@ MDXContent.isMDXComponent = true`
]
}).code

// TODO: Remove layout props entirely
let layoutProps = 'const layoutProps = {'

if (exportNames.length !== 0) {
Expand Down
2 changes: 0 additions & 2 deletions packages/mdx/readme.md
Expand Up @@ -52,8 +52,6 @@ abide by its terms.

[MIT][] © [Compositor][] and [Vercel][]

<!-- Definitions -->

[build]: https://travis-ci.com/mdx-js/mdx
[build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master
[lerna]: https://lernajs.io/
Expand Down
2 changes: 0 additions & 2 deletions packages/parcel-plugin-mdx/readme.md
Expand Up @@ -44,8 +44,6 @@ abide by its terms.

[MIT][] © [Compositor][] and [Vercel][]

<!-- Definitions -->

[build]: https://travis-ci.com/mdx-js/mdx
[build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master
[lerna]: https://lernajs.io/
Expand Down
2 changes: 0 additions & 2 deletions packages/preact/readme.md
Expand Up @@ -61,8 +61,6 @@ abide by its terms.

[MIT][] © [Compositor][] and [Vercel][]

<!-- Definitions -->

[build]: https://travis-ci.com/mdx-js/mdx
[build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master
[lerna]: https://lernajs.io/
Expand Down
1 change: 0 additions & 1 deletion packages/preact/test/fixture.js
@@ -1,6 +1,5 @@
/* @jsx mdx */

// eslint-disable-next-line no-unused-vars
import {mdx} from '../src'

const Component = ({components}) => <p>{Object.keys(components).join(', ')}</p>
Expand Down
1 change: 0 additions & 1 deletion packages/preact/test/test.js
@@ -1,6 +1,5 @@
/* @jsx h */
import {render} from 'preact-render-to-string'
// eslint-disable-next-line
import {h} from 'preact'

import {MDXProvider} from '../src/context'
Expand Down
2 changes: 0 additions & 2 deletions packages/react/readme.md
Expand Up @@ -60,8 +60,6 @@ abide by its terms.

[MIT][] © [Compositor][] and [Vercel][]

<!-- Definitions -->

[build]: https://travis-ci.com/mdx-js/mdx
[build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master
[lerna]: https://lernajs.io/
Expand Down
2 changes: 0 additions & 2 deletions packages/react/test/fixture.js
@@ -1,6 +1,4 @@
/* @jsx mdx */

// eslint-disable-next-line no-unused-vars
import {mdx} from '../src'

const Component = ({components}) => <p>{Object.keys(components).join(', ')}</p>
Expand Down
6 changes: 3 additions & 3 deletions packages/remark-mdx-remove-exports/readme.md
Expand Up @@ -4,7 +4,9 @@
[![lerna][lerna-badge]][lerna]
[![Join the community on Spectrum][spectrum-badge]][spectrum]

Remove export nodes from the [MDXAST][]. This is useful for scenarios where the exports aren’t needed like an MDX playground.
Remove export nodes from the [MDXAST][].
This is useful for scenarios where the exports aren’t needed like an
MDX playground.

## Installation

Expand Down Expand Up @@ -74,8 +76,6 @@ abide by its terms.

[MIT][] © [John Otander][johno]

<!-- Definitions -->

[build]: https://travis-ci.com/mdx-js/mdx
[build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master
[lerna]: https://lernajs.io/
Expand Down
5 changes: 2 additions & 3 deletions packages/remark-mdx-remove-imports/readme.md
Expand Up @@ -4,7 +4,8 @@
[![lerna][lerna-badge]][lerna]
[![Join the community on Spectrum][spectrum-badge]][spectrum]

Remove import nodes from the [MDXAST][]. This is useful for scenarios where the imports aren’t needed like an MDX playground.
Remove import nodes from the [MDXAST][].
This is useful for scenarios where the imports aren’t needed, like an MDX playground.

## Installation

Expand Down Expand Up @@ -72,8 +73,6 @@ abide by its terms.

[MIT][] © [John Otander][johno]

<!-- Definitions -->

[build]: https://travis-ci.com/mdx-js/mdx
[build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master
[lerna]: https://lernajs.io/
Expand Down
2 changes: 0 additions & 2 deletions packages/remark-mdxjs/readme.md
Expand Up @@ -27,8 +27,6 @@ abide by its terms.

[MIT][] © [Titus Wormer][author] and [John Otander][author2]

<!-- Definitions -->

[build]: https://travis-ci.com/mdx-js/mdx
[build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master
[lerna]: https://lernajs.io/
Expand Down
2 changes: 0 additions & 2 deletions packages/test-util/readme.md
Expand Up @@ -6,8 +6,6 @@ Test utility functions used in [MDX][].

[MIT][] © [John Otander][author]

<!-- Definitions -->

[mit]: license
[mdx]: https://github.com/mdx-js/mdx
[author]: https://johno.com
2 changes: 0 additions & 2 deletions packages/util/readme.md
Expand Up @@ -12,8 +12,6 @@ yarn add @mdx-js/util

[MIT][] © [John Otander][author]

<!-- Definitions -->

[mit]: license
[mdx]: https://github.com/mdx-js/mdx
[author]: https://johno.com
2 changes: 0 additions & 2 deletions packages/vue-loader/readme.md
Expand Up @@ -66,8 +66,6 @@ abide by its terms.

[MIT][] © [Compositor][] and [Vercel][]

<!-- Definitions -->

[build]: https://travis-ci.com/mdx-js/mdx
[build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master
[lerna]: https://lernajs.io/
Expand Down
1 change: 0 additions & 1 deletion packages/vue/readme.md
Expand Up @@ -72,7 +72,6 @@ abide by its terms.

[MIT][] © [Compositor][] and [Vercel][]

<!-- Definitions -->
[build]: https://travis-ci.com/mdx-js/mdx
[build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master
[lerna]: https://lernajs.io/
Expand Down
22 changes: 10 additions & 12 deletions readme.md
Expand Up @@ -93,33 +93,31 @@ A nice example of this is [mdx-deck][], a great way to create slides with MDX.

## Sponsors

<!--lint ignore no-html maximum-line-length-->

<table>
<tr valign="top">
<td width="20%" align="center">
<a href="https://vercel.com"><img src="https://avatars1.githubusercontent.com/u/14985020?s=400&v=4"></a>
<br><br>🥇
<a href="https://vercel.com"><img src="https://avatars1.githubusercontent.com/u/14985020?s=400&v=4" /></a>
<br /><br />🥇
<a href="https://vercel.com">Vercel</a>
</td>
<td width="20%" align="center">
<a href="https://www.gatsbyjs.org"><img src="https://avatars1.githubusercontent.com/u/12551863?s=400&v=4"></a>
<br><br>🥇
<a href="https://www.gatsbyjs.org"><img src="https://avatars1.githubusercontent.com/u/12551863?s=400&v=4" /></a>
<br /><br />🥇
<a href="https://www.gatsbyjs.org">Gatsby</a>
</td>
<td width="20%" align="center">
<a href="https://www.netlify.com"><img src="https://avatars1.githubusercontent.com/u/7892489?s=400&v=4"></a>
<br><br>🥇
<a href="https://www.netlify.com"><img src="https://avatars1.githubusercontent.com/u/7892489?s=400&v=4" /></a>
<br /><br />🥇
<a href="https://www.netlify.com">Netlify</a>
</td>
<td width="20%" align="center">
<a href="https://www.holloway.com"><img src="https://avatars1.githubusercontent.com/u/35904294?s=400&v=4"></a>
<br><br>
<a href="https://www.holloway.com"><img src="https://avatars1.githubusercontent.com/u/35904294?s=400&v=4" /></a>
<br /><br />
<a href="https://www.holloway.com">Holloway</a>
</td>
<td width="20%" align="center">
<br><br><br><br>
<a href="https://opencollective.com/unified"><strong>You?</strong>
<br /><br /><br /><br />
<a href="https://opencollective.com/unified"><strong>You?</strong></a>
</td>
</tr>
</table>
Expand Down

0 comments on commit 3ca8e0a

Please sign in to comment.