Skip to content

Commit d75620d

Browse files
committed
set up more remark linters
1 parent 8d800c0 commit d75620d

17 files changed

+1813
-194
lines changed

.remarkignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CODE_OF_CONDUCT.md

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $ npm install
2323
$ npm start
2424
```
2525

26-
Once this is done you can visit http://localhost:8080/ to see the local copy of the website. As you edit files the
26+
Once this is done you can visit <http://localhost:8080/> to see the local copy of the website. As you edit files the
2727
website will automatically rebuild, and you can see the changes reflected in your browser.
2828

2929
### Running checks/tests

blog/2023-01-09-introducing-webcomponents-guide.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,4 @@ the [Learn][learn] section then your input would be invaluable to countless deve
102102
[learn]: /learn/
103103
[tutorials]: /tutorials/
104104
[blog]: /blog/
105-
106-
[issue]: {{ repository }}/issues/new
105+
[issue]: https://github.com/WebComponentsGuide/webcomponents.guide/issues/new

learn/components/autonomous-vs-customized-elements.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ In the [previous section][defining-a-component] we learned about _Autonomous Cus
77
Elements_. The most popular way to make elements is to use the _Autonomous Custom Element_ style, by making up your own
88
tag and extending `HTMLElement`. However, each style comes with different trade-offs.
99

10-
[defining-a-component]: /learn/components/
11-
1210
Choosing a type of component to build will depend on a lot of factors. _Autonomous Custom Elements_ give you a blank
1311
canvas to work with. _Customized Built-ins_ **extend** the element you're customizing. Here are some considerations to
1412
think about:
@@ -78,8 +76,6 @@ use _ShadowDOM_.
7876
_ShadowDOM_ also provides elements with the ability to choose how nested elements render. An ability that many
7977
_built-ins_ already have...
8078

81-
[shadowdom]: /learn/components/shadowdom
82-
8379
### Nesting & Semantics
8480

8581
Many _built-in_ elements will only allow certain tags to nest inside ([you can read more about _Content Categories_ on
@@ -96,10 +92,6 @@ _Autonomous Custom Elements_ allow any nested tag by default. This can be custom
9692
behavior is to allow any nested element. An element like `<fancy-button>` could include any _[flow
9793
content][flow-content]_ tags. It might be weird to see a `<fancy-button>` with an `<iframe>` nested inside.
9894

99-
[content-categories]: https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories
100-
[phrasing-content]: https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories#phrasing_content
101-
[flow-content]: https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories#flow_content
102-
10395
### Behavior & API
10496

10597
_Autonomous Custom Elements_ must extend from `HTMLElement`. They'll get all the methods and properties inherited from
@@ -136,12 +128,17 @@ universal and consistent. It's always worth getting comfortable with these tools
136128
using a variety of them. A lot of work has gone into making the _built-ins_ as accessible as possible by default, and so
137129
it can be a good idea to rely on those defaults.
138130

139-
[aria]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA
140-
141131
### Summary
142132

143133
This has all been a lot to go over. The truth is there's good reasons to pick customizing a _built-in_, but it should be
144134
carefully considered. If your element is substantially different from any existing element, then using an _Autonomous
145135
Custom Element_ is a good choice. To help drive your decision, here's a table summarizing the above information:
146136

147137
{% stub %}
138+
139+
[defining-a-component]: /learn/components/
140+
[shadowdom]: /learn/components/shadowdom
141+
[content-categories]: https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories
142+
[phrasing-content]: https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories#phrasing_content
143+
[flow-content]: https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories#flow_content
144+
[aria]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA

learn/components/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ message like `autonomous custom elements must extend HTMLElement`.
4444

4545
{% endtip %}
4646

47-
[lifecycle]: /learn/components/lifecycle-reference
48-
4947
## Customized Built-in Elements
5048

5149
_Customized Built-in_ elements are extensions to the browsers existing _built-in_ elements. For example if you wanted to
@@ -201,3 +199,4 @@ class MyElement extends HTMLElement {
201199
}
202200
}
203201
```
202+
[lifecycle]: /learn/components/lifecycle-reference

learn/components/initializing-your-component.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ or as logic during the _constructor_.
1616
Components might have some _state_, much of which can be assigned using [class fields][class-fields]. These could be
1717
public, private, or a combination of the two:
1818

19-
[class-fields]: /learn/javascript/classes
20-
2119
```js
2220
class StopWatchElement extends HTMLElement {
2321
static define(tag = "stop-watch") {
@@ -161,4 +159,5 @@ class StopWatchElement extends HTMLElement {
161159
}
162160
```
163161
162+
[class-fields]: /learn/javascript/classes
164163
[lifecycle]: /learn/components/lifecycle-reference/

learn/components/lifecycle-reference.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ so instead of inheriting from your class, the element will fall back to being an
5353

5454
{% endtip %}
5555

56-
[constructor]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/constructor
57-
5856
## `connectedCallback()`
5957

6058
The `connectedCallback()` is a "well known" method. It doesn't exist as part of native JavaScript classes, instead it's
@@ -80,9 +78,6 @@ have children during a `connectedCallback` call. This means you might want to av
8078
Instead use this function to initialize itself, render any [ShadowDOM][shadowdom] and add [global event
8179
listeners][events].
8280

83-
[shadowdom]: /learn/components/shadowdom
84-
[events]: /learn/components/events
85-
8681
If your element depends heavily on its children existing, consider adding a
8782
[`MutationObserver`](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) in the `connectedCallback` to
8883
track when your elements children change.
@@ -144,8 +139,6 @@ in some cases this is very helpful; but sometimes this can bite, especially if y
144139
`attributeChangedCallback`. Try to make sure operations inside `attributeChangedCallback` are idempotent, or perhaps
145140
consider adding a check to ensure `oldValue !== newValue` before performing operations which may be sensitive to this.
146141

147-
[createattribute]: https://developer.mozilla.org/en-US/docs/Web/API/Document/createAttribute
148-
149142
## `adoptedCallback()`
150143

151144
The `adoptedCallback()` is another well known method gets called when your element moves from one `document` to another
@@ -192,3 +185,8 @@ document.body.querySelector("iframe").contentWindow.document.body.append(el)
192185
// browser calls `adoptedCallback()`
193186
// browser calls `connectedCallback()`
194187
```
188+
189+
[constructor]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/constructor
190+
[shadowdom]: /learn/components/shadowdom
191+
[events]: /learn/components/events
192+
[createattribute]: https://developer.mozilla.org/en-US/docs/Web/API/Document/createAttribute

learn/components/naming-your-components.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ _Web Components_ are prefixed `<sp-`, [Shoelace Components][shoelace] are prefix
103103
can easily tell apart a component from a design system to a generic off-the-shelf component. On the other hand, this
104104
makes every component name longer.
105105

106-
[spectrum]: https://opensource.adobe.com/spectrum-web-components/
107-
[shoelace]: https://shoelace.style/
108-
109106
### If in doubt, use the `noun-noun` pattern
110107

111108
As a general rule you can think about answering to the following question: What **action** does your element to do the
@@ -138,4 +135,6 @@ prefixing your element tag names, using the prefix in the class name is a good i
138135
system with `<fcy-button>` and `<fcy-accordion>` then naming classes like `FancyButtonElement` and
139136
`FancyAccordionElement` is a good pattern.
140137

138+
[spectrum]: https://opensource.adobe.com/spectrum-web-components/
139+
[shoelace]: https://shoelace.style/
141140
[camelcase]: https://en.wikipedia.org/wiki/Camel_case

learn/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ Here's an example of a web component that renders a timer. It defines its own [s
2525
[_ShadowDOM_][shadowdom], and has its own [_private state_][private-state]. It makes use of the [_lifecycle
2626
callbacks_][lifecycle] to know when to start counting. These are all built in web platform features.
2727

28-
[styles]: /learn/components/styling
29-
[shadowdom]: /learn/components/shadowdom
30-
[private-state]: /learn/components/private-state
31-
[lifecycle]: /learn/components/lifecycle-reference
32-
3328
{% demo %}
3429

3530
```js
@@ -82,3 +77,8 @@ StopWatchElement.define()
8277
{% enddemo %}
8378

8479
Let's find out more about how to build this component...
80+
81+
[styles]: /learn/components/styling
82+
[shadowdom]: /learn/components/shadowdom
83+
[private-state]: /learn/components/private-state
84+
[lifecycle]: /learn/components/lifecycle-reference

learn/javascript/events-in-more-detail.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ In this section we'll learn about these features in more detail, covering some m
1111
potential pitfalls you'll need to watch out for. It's a good idea to make sure you've got a good understanding of
1212
everything covered in the [previous section][events] before reading on.
1313

14-
[events]: /learn/javascript/events
15-
1614
#### Adding multiple listeners
1715

1816
The [previous section][events] showed how you can add an _Event listener_ with `.addEventListener()`, but you can add
@@ -324,3 +322,5 @@ mytimer.addEventListener("start", (event) => {
324322
console.log("never called, as propagation was stopped")
325323
})
326324
```
325+
326+
[events]: /learn/javascript/events

0 commit comments

Comments
 (0)