Skip to content

Commit f5c6132

Browse files
committed
Fix GFM features in mdx
Also turn on linting for mdx files and fix errors
1 parent dc3e5b4 commit f5c6132

File tree

23 files changed

+1907
-44
lines changed

23 files changed

+1907
-44
lines changed

.eslintrc.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const {getGlobals} = require('eslint-plugin-mdx/lib/helpers')
2+
13
module.exports = {
24
root: true,
35
ignorePatterns: ['.cache/', 'public/'],
@@ -10,7 +12,6 @@ module.exports = {
1012
'plugin:github/react',
1113
'plugin:primer-react/recommended',
1214
'plugin:react-hooks/recommended',
13-
'plugin:import/recommended',
1415
'prettier',
1516
],
1617
rules: {
@@ -19,11 +20,32 @@ module.exports = {
1920
'primer-react/no-system-props': ['error', {includeUtilityComponents: true}],
2021
},
2122
overrides: [
23+
{
24+
files: ['*.js'],
25+
extends: ['plugin:import/recommended'],
26+
},
2227
{
2328
files: ['src/shared.js'],
2429
rules: {
2530
'react/no-unescaped-entities': 'off',
2631
},
2732
},
33+
{
34+
files: ['*.mdx'],
35+
plugins: ['mdx', 'prettier'],
36+
extends: ['plugin:mdx/recommended'],
37+
parserOptions: {
38+
sourceType: 'module',
39+
},
40+
globals: getGlobals(['Index', 'Note', 'Prompt', 'PromptReply', 'Screenshot', 'Link', 'YouTube']),
41+
settings: {
42+
'import/resolver': 'webpack',
43+
},
44+
rules: {
45+
'no-irregular-whitespace': 'off',
46+
'jsx-a11y/anchor-has-content': 'off',
47+
'react/jsx-no-target-blank': 'off',
48+
},
49+
},
2850
],
2951
}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
!/content/
2424
!/CONTRIBUTING.md
2525
!/docs/
26-
!/gatsby-*.js
26+
!/gatsby-*
2727
!/jest*.js
2828
!/lib/
2929
!/LICENSE*
@@ -38,4 +38,5 @@
3838
!/static/
3939
!/tap-snapshots/
4040
!/test/
41+
!/webpack.config.js
4142
!/cli/

.reuse/dep5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Files: content/* static/*
77
Copyright: 2020 GitHub
88
License: CC-BY-4.0
99

10-
Files: scripts/* cli/* theme/* src/* .github/* *.md *.js *.json .*
10+
Files: scripts/* cli/* theme/* src/* .github/* *.md *.js *.mjs *.json .*
1111
Copyright: 2020 GitHub
1212
License: MIT

cli/lib/extract.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const whackAMoleReplace = (s, replacements) => {
1212
// a bit of whack-a-mole but is necessary since markdown in the CLI is
1313
// different from the mdx v2 we parse for the docs site
1414
for (const rep of replacements) {
15-
s = s.replace(rep, rep.replace(/([<>])/g, '\\$1').replace(/([{}])/g, '\\$1'))
15+
s = s.replace(rep, rep.replace(/([<>{}])/g, '\\$1'))
1616
}
1717
return s
1818
}
@@ -29,6 +29,7 @@ const unpackTarball = async ({release, cwd, dir}) => {
2929
return (
3030
whackAMoleReplace(s, [
3131
'{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}',
32+
'node/{process.version} {process.platform} {process.arch}',
3233
'Default: {prefix}/etc/npmrc',
3334
])
3435
// we cant remove all emails since all except this one are in code blocks

content/cli/v6/using-npm/config.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ Folders and executables are given a mode which is `0777` masked against this val
10681068

10691069
#### user-agent
10701070

1071-
- Default: node/{process.version} {process.platform} {process.arch}
1071+
- Default: node/\{process.version\} \{process.platform\} \{process.arch\}
10721072
- Type: String
10731073

10741074
Sets a User-Agent to the request header

content/getting-started/managing-your-npm-user-account/changing-your-npm-username.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: Changing your npm username
33
---
4-
import shared from '~/shared.js'
54

65
It is not currently possible to change your npm username. You'll need to
76
create a new account and migrate the data to the new account manually.

content/getting-started/troubleshooting/generating-and-locating-npm-debug.log-files.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: Generating and locating npm-debug.log files
33
redirect_from:
44
- /generating-and-locating-npm-debug-log-files
55
---
6-
import shared from '~/shared.js'
76

87
When a package fails to install or publish, the npm CLI will generate an `npm-debug.log` file. This log file can help you figure out what went wrong.
98

content/organizations/managing-organization-packages/configuring-your-npm-client-with-your-organization-settings.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: Configuring your npm client with your organization settings
33
redirect_from:
44
- /configuring-your-npm-client-with-your-org-settings
55
---
6-
import shared from '~/shared.js'
76

87
As an organization member, you can configure your npm client to:
98

content/packages-and-modules/contributing-packages-to-the-registry/about-semantic-versioning.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ For more information on semantic versioning syntax, see the [npm semver calculat
4747

4848
## Resources
4949

50-
<iframe src="https://www.youtube.com/embed/kK4Meix58R4" frameborder="0" allowfullscreen></iframe>
50+
<YouTube id="kK4Meix58R4" />
5151

5252

5353
[semver-calc]: https://semver.npmjs.com/

content/packages-and-modules/contributing-packages-to-the-registry/creating-node-js-modules.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ exports.printMsg = function() {
6565

6666
## Resources
6767

68-
<iframe src="https://www.youtube.com/embed/3I78ELjTzlQ" frameborder="0" allowfullscreen></iframe>
68+
<YouTube id="3I78ELjTzlQ" />
6969

7070

7171
[about-pkgs]: about-packages-and-modules

0 commit comments

Comments
 (0)