Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
Update Prettier config
Browse files Browse the repository at this point in the history
Disable semicolons and trailing commas.
  • Loading branch information
remcohaszing committed Nov 24, 2023
1 parent 4788d17 commit 3d58fa6
Show file tree
Hide file tree
Showing 19 changed files with 156 additions and 155 deletions.
3 changes: 2 additions & 1 deletion .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
proseWrap: always
semi: false
singleQuote: true
trailingComma: all
trailingComma: none
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,29 @@ For example, given a file named `example.mdx` with the following contents:
The following script:

```js
import { readFile } from 'node:fs/promises';
import { readFile } from 'node:fs/promises'

import { compile } from '@mdx-js/mdx';
import remarkMdxImages from 'remark-mdx-images';
import { compile } from '@mdx-js/mdx'
import remarkMdxImages from 'remark-mdx-images'

const { contents } = await compile(await readFile('example.mdx'), {
jsx: true,
remarkPlugins: [remarkMdxImages],
});
console.log(contents);
remarkPlugins: [remarkMdxImages]
})
console.log(contents)
```

Roughly yields:

```jsx
import kittens from './kittens.png';
import kittens from './kittens.png'

export default function MDXContent() {
return (
<p>
<img alt="Very cute kittens" src={kittens} title="Meow!" />
</p>
);
)
}
```

Expand Down
12 changes: 6 additions & 6 deletions __fixtures__/alt/expected.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*@jsxRuntime automatic @jsxImportSource react*/
import __0___image_png__ from './image.png';
import __0___image_png__ from './image.png'
function _createMdxContent(props) {
const _components = {
img: 'img',
p: 'p',
...props.components,
};
...props.components
}
return (
<_components.p>
<_components.img alt="Alt text" src={__0___image_png__} />
</_components.p>
);
)
}
export default function MDXContent(props = {}) {
const { wrapper: MDXLayout } = props.components || {};
const { wrapper: MDXLayout } = props.components || {}
return MDXLayout ? (
<MDXLayout {...props}>
<_createMdxContent {...props} />
</MDXLayout>
) : (
_createMdxContent(props)
);
)
}
14 changes: 7 additions & 7 deletions __fixtures__/duplicate/expected.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*@jsxRuntime automatic @jsxImportSource react*/
import __0___image_png__ from './image.png';
import __1___image_jpg__ from './image.jpg';
import __0___image_png__ from './image.png'
import __1___image_jpg__ from './image.jpg'
function _createMdxContent(props) {
const _components = {
img: 'img',
p: 'p',
...props.components,
};
...props.components
}
return (
<>
<_components.p>
Expand All @@ -25,15 +25,15 @@ function _createMdxContent(props) {
<_components.img alt="" src={__1___image_jpg__} />
</_components.p>
</>
);
)
}
export default function MDXContent(props = {}) {
const { wrapper: MDXLayout } = props.components || {};
const { wrapper: MDXLayout } = props.components || {}
return MDXLayout ? (
<MDXLayout {...props}>
<_createMdxContent {...props} />
</MDXLayout>
) : (
_createMdxContent(props)
);
)
}
10 changes: 5 additions & 5 deletions __fixtures__/external-http/expected.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ function _createMdxContent(props) {
const _components = {
img: 'img',
p: 'p',
...props.components,
};
...props.components
}
return (
<_components.p>
<_components.img src="http://mdx-logo.now.sh" alt="" />
</_components.p>
);
)
}
export default function MDXContent(props = {}) {
const { wrapper: MDXLayout } = props.components || {};
const { wrapper: MDXLayout } = props.components || {}
return MDXLayout ? (
<MDXLayout {...props}>
<_createMdxContent {...props} />
</MDXLayout>
) : (
_createMdxContent(props)
);
)
}
10 changes: 5 additions & 5 deletions __fixtures__/external-https/expected.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ function _createMdxContent(props) {
const _components = {
img: 'img',
p: 'p',
...props.components,
};
...props.components
}
return (
<_components.p>
<_components.img src="https://mdx-logo.now.sh" alt="" />
</_components.p>
);
)
}
export default function MDXContent(props = {}) {
const { wrapper: MDXLayout } = props.components || {};
const { wrapper: MDXLayout } = props.components || {}
return MDXLayout ? (
<MDXLayout {...props}>
<_createMdxContent {...props} />
</MDXLayout>
) : (
_createMdxContent(props)
);
)
}
10 changes: 5 additions & 5 deletions __fixtures__/external-without-protocol/expected.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ function _createMdxContent(props) {
const _components = {
img: 'img',
p: 'p',
...props.components,
};
...props.components
}
return (
<_components.p>
<_components.img src="//mdx-logo.now.sh" alt="" />
</_components.p>
);
)
}
export default function MDXContent(props = {}) {
const { wrapper: MDXLayout } = props.components || {};
const { wrapper: MDXLayout } = props.components || {}
return MDXLayout ? (
<MDXLayout {...props}>
<_createMdxContent {...props} />
</MDXLayout>
) : (
_createMdxContent(props)
);
)
}
12 changes: 6 additions & 6 deletions __fixtures__/inline/expected.jsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/*@jsxRuntime automatic @jsxImportSource react*/
import __0___image_png__ from './image.png';
import __0___image_png__ from './image.png'
function _createMdxContent(props) {
const _components = {
img: 'img',
p: 'p',
...props.components,
};
...props.components
}
return (
<_components.p>
{'This is an inline image: '}
<_components.img alt="" src={__0___image_png__} />
{'. See?'}
</_components.p>
);
)
}
export default function MDXContent(props = {}) {
const { wrapper: MDXLayout } = props.components || {};
const { wrapper: MDXLayout } = props.components || {}
return MDXLayout ? (
<MDXLayout {...props}>
<_createMdxContent {...props} />
</MDXLayout>
) : (
_createMdxContent(props)
);
)
}
12 changes: 6 additions & 6 deletions __fixtures__/link/expected.jsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
/*@jsxRuntime automatic @jsxImportSource react*/
import __0___image_png__ from './image.png';
import __0___image_png__ from './image.png'
function _createMdxContent(props) {
const _components = {
a: 'a',
img: 'img',
p: 'p',
...props.components,
};
...props.components
}
return (
<_components.p>
<_components.a href="https://example.com">
<_components.img alt="" src={__0___image_png__} />
</_components.a>
</_components.p>
);
)
}
export default function MDXContent(props = {}) {
const { wrapper: MDXLayout } = props.components || {};
const { wrapper: MDXLayout } = props.components || {}
return MDXLayout ? (
<MDXLayout {...props}>
<_createMdxContent {...props} />
</MDXLayout>
) : (
_createMdxContent(props)
);
)
}
18 changes: 9 additions & 9 deletions __fixtures__/multiple/expected.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*@jsxRuntime automatic @jsxImportSource react*/
import __0___image_gif__ from './image.gif';
import __1___image_jpg__ from './image.jpg';
import __2___image_png__ from './image.png';
import __3___image_svg__ from './image.svg';
import __0___image_gif__ from './image.gif'
import __1___image_jpg__ from './image.jpg'
import __2___image_png__ from './image.png'
import __3___image_svg__ from './image.svg'
function _createMdxContent(props) {
const _components = {
img: 'img',
p: 'p',
...props.components,
};
...props.components
}
return (
<>
<_components.p>
Expand All @@ -27,15 +27,15 @@ function _createMdxContent(props) {
<_components.img alt="" src={__3___image_svg__} />
</_components.p>
</>
);
)
}
export default function MDXContent(props = {}) {
const { wrapper: MDXLayout } = props.components || {};
const { wrapper: MDXLayout } = props.components || {}
return MDXLayout ? (
<MDXLayout {...props}>
<_createMdxContent {...props} />
</MDXLayout>
) : (
_createMdxContent(props)
);
)
}
12 changes: 6 additions & 6 deletions __fixtures__/node-modules/expected.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*@jsxRuntime automatic @jsxImportSource react*/
import __0__browser_logos_chrome_chrome_png__ from '@browser-logos/chrome/chrome.png';
import __0__browser_logos_chrome_chrome_png__ from '@browser-logos/chrome/chrome.png'
function _createMdxContent(props) {
const _components = {
img: 'img',
p: 'p',
...props.components,
};
...props.components
}
return (
<_components.p>
<_components.img alt="" src={__0__browser_logos_chrome_chrome_png__} />
</_components.p>
);
)
}
export default function MDXContent(props = {}) {
const { wrapper: MDXLayout } = props.components || {};
const { wrapper: MDXLayout } = props.components || {}
return MDXLayout ? (
<MDXLayout {...props}>
<_createMdxContent {...props} />
</MDXLayout>
) : (
_createMdxContent(props)
);
)
}
12 changes: 6 additions & 6 deletions __fixtures__/relative-grandparent/expected.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*@jsxRuntime automatic @jsxImportSource react*/
import __0_______image_png__ from '../../image.png';
import __0_______image_png__ from '../../image.png'
function _createMdxContent(props) {
const _components = {
img: 'img',
p: 'p',
...props.components,
};
...props.components
}
return (
<_components.p>
<_components.img alt="" src={__0_______image_png__} />
</_components.p>
);
)
}
export default function MDXContent(props = {}) {
const { wrapper: MDXLayout } = props.components || {};
const { wrapper: MDXLayout } = props.components || {}
return MDXLayout ? (
<MDXLayout {...props}>
<_createMdxContent {...props} />
</MDXLayout>
) : (
_createMdxContent(props)
);
)
}
12 changes: 6 additions & 6 deletions __fixtures__/relative-parent/expected.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*@jsxRuntime automatic @jsxImportSource react*/
import __0____image_png__ from '../image.png';
import __0____image_png__ from '../image.png'
function _createMdxContent(props) {
const _components = {
img: 'img',
p: 'p',
...props.components,
};
...props.components
}
return (
<_components.p>
<_components.img alt="" src={__0____image_png__} />
</_components.p>
);
)
}
export default function MDXContent(props = {}) {
const { wrapper: MDXLayout } = props.components || {};
const { wrapper: MDXLayout } = props.components || {}
return MDXLayout ? (
<MDXLayout {...props}>
<_createMdxContent {...props} />
</MDXLayout>
) : (
_createMdxContent(props)
);
)
}
Loading

0 comments on commit 3d58fa6

Please sign in to comment.