You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Introduce markdown lint
* Add extension to devcontainer.json
* Organize rule configuration
* try introducing CI step
* Configure formatter
* Just add similar to eslint
* update config
* Fix: MD001/heading-increment/header-increment Heading levels should only increment by one level at a time
* fix: MD030/list-marker-space Spaces after list markers
* fix: MD040/fenced-code-language Fenced code blocks should have a language specified
* Fix: MD051/link-fragments Link fragments should be valid
* Create rules to enforce eventualy
* Fix: no-emphasis-as-heading/no-emphasis-as-header Emphasis used instead of a heading
* fix: MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines
* Disable stylistic rule
* Add TODO
* Add note in config
* fix: GH002/no-generic-link-text Avoid using generic link text like or :
* update config
* Add exceptions for Link for generic text
* Update to @joshblack suggestion
* Update CONTRIBUTING.md
Copy file name to clipboardExpand all lines: README.md
+1-5
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ yarn add @primer/react
40
40
41
41
## Roadmap
42
42
43
-
You can track our roadmap progress in the [Roadmap Project Board](https://github.com/primer/react/projects/3), see more detail in the [quarterly planning Discussions](https://github.com/primer/react/discussions?discussions_q=%5BRoadmap%5D), and find a list of all the current epic tracking issues[here](https://github.com/primer/react/discussions/997).
43
+
You can track our roadmap progress in the [Roadmap Project Board](https://github.com/primer/react/projects/3), see more detail in the [quarterly planning Discussions](https://github.com/primer/react/discussions?discussions_q=%5BRoadmap%5D), and find a [list of all the current epic tracking issues](https://github.com/primer/react/discussions/997).
44
44
45
45
## Contributing
46
46
@@ -51,7 +51,3 @@ We love collaborating with folks inside and outside of GitHub and welcome contri
51
51
## New Component Proposals
52
52
53
53
We welcome and encourage new component proposals from internal GitHub teams! Our best work comes from collaborating directly with the teams using Primer React Components in their projects. If you'd like to kick off a new component proposal, please submit an issue using the [component proposal issue template](https://github.com/primer/react/issues/new?template=new-component-proposal.md) and we will get in touch!
We use the [React configuration](https://github.com/github/eslint-plugin-github/blob/master/lib/configs/react.js) from [GitHub's eslint plugin](https://github.com/github/eslint-plugin-github) to lint our JavaScript. To check your work before pushing, run:
113
115
114
116
```sh
@@ -130,6 +132,14 @@ npm run lint -- --fix
130
132
131
133
**Protip:**`npm run lint -- --quiet` (or `npx eslint --quiet ...`) will suppress warnings so that you can focus on fixing errors.
132
134
135
+
#### Markdownlint
136
+
137
+
We use [markdownlint](https://github.com/markdownlint/markdownlint) to lint Markdown files, using [GitHub's markdownlint-github configuration](https://github.com/github/markdownlint-github). To check your work before pushing, run:
138
+
139
+
```sh
140
+
npm run lint:md
141
+
```
142
+
133
143
### TypeScript support
134
144
135
145
Primer React is written in TypeScript. We include type definitions in our built artifacts. To check types, run the `type-check` test script:
@@ -212,10 +222,4 @@ Make sure to run `npm install` from inside the `docs/` subfolder _as well as_ th
212
222
213
223
Ensure you are using the latest minor of Node.js for the major version specified in the `.nvmrc` file. For example, if `.nvmrc` contains `8`, make sure you're using the latest version of Node.js with the major version of 8.
Copy file name to clipboardExpand all lines: contributor-docs/adrs/adr-004-children-as-api.md
+8-13
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,16 @@ _Note: Consumer is used multiple times on this page. It refers to the developers
12
12
13
13
## Decision:
14
14
15
-
16
15
1. Prefer using children for “content”
17
16
18
17
2. For composite components, the API should be decided by how much customisation is available for children.
19
18
20
19
For components that have design decisions baked in, should use strict props. For example, the color of the icon inside a Button component is decided by the `variant` prop on the Button. The API does not allow for changing that.
On the other hand, if we want consumers to have more control over children, a composite API is the better choice.
@@ -38,7 +39,7 @@ On the other hand, if we want consumers to have more control over children, a co
38
39
39
40
With React, `children` is the out-of-the-box way for putting [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#phrasing_content) inside your component. By using `children` instead of our own custom prop, we can make the API “predictable” for its consumers.
@@ -62,7 +63,7 @@ import {CheckIcon} from '@primer/octicons-react'
62
63
render(
63
64
<Flash variant="success">
64
65
<CheckIcon /> Changes saved!
65
-
</Flash>
66
+
</Flash>,
66
67
)
67
68
```
68
69
@@ -149,8 +150,6 @@ When intentionally going off the happy path, developers can still drop down an a
149
150
150
151
_Sidenote: We might want to name this prop `leadingIcon`, even if there is no `trailingIcon`. Consistent names across components plays a big role in making the API predictable._
151
152
152
-
153
-
154
153
---
155
154
156
155
<br/>
@@ -233,7 +232,7 @@ We use this pattern as well in `Button`, `Button.Counter` is a restricted versio
Copy file name to clipboardExpand all lines: contributor-docs/adrs/adr-008-experimental-components.md
+4-7
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Proposed
8
8
9
9
## Context
10
10
11
-
####Recap: Drafts
11
+
### Recap: Drafts
12
12
13
13
As we work on new components (or rewrites of old components), we often need to start with a "prototype"[^1] and not include them in the semantically versioned (semver-ed) main bundle.
14
14
@@ -39,8 +39,6 @@ The approach that has served us well since Dec 2021 has been "drafts" (along wit
39
39
40
40
We want to enable feature teams to contribute to Primer. We also want to make it clear which contributions haven't been evaluated by our high standards for Primer components.
41
41
42
-
43
-
44
42
45
43
46
44
## Decision
@@ -53,17 +51,16 @@ The approach that has served us well since Dec 2021 has been "drafts" (along wit
53
51
54
52
This will help in sharing experimental components between the monolith and projects outside of monolith. The ownership and responsibility of maintenance will be shared by multiple teams (including primer).
55
53
56
-
####Risks:
54
+
### Risks:
57
55
58
56
This will require improvements in the development and publishing workflow for experimental components. Without making that investment, we could create more friction and make contributions more difficult.
59
57
60
-
61
58
62
59
63
60
#### Other options considered
64
61
65
-
1. The code for experimental components should live in a new repository code `github.com/primer/react-candidates` to support different conventions and processes for experimental components and convey shared ownership between primer and product teams.
66
-
62
+
1. The code for experimental components should live in a new repository code `github.com/primer/react-candidates` to support different conventions and processes for experimental components and convey shared ownership between primer and product teams.
63
+
67
64
Keeping experimental components in primer _org_ suggests that the primer _team_ would take up maintenance of these components while they are still candidates (bugs, a11y remedial, etc.). This will be a new parallel workstream for the team and with our current team size, we might not be able to give it the required attention.
68
65
69
66
2. The code for experimental components should live inside the monolith in [github/github/modules/react-shared](https://github.com/github/github/tree/master/app/assets/modules/react-shared) instead of a new repository.
0 commit comments