Skip to content

Commit c71fd05

Browse files
authored
Expand use of prettier to all tracked files (home-assistant#17311)
1 parent 493f1d1 commit c71fd05

28 files changed

+265
-222
lines changed

.github/release-drafter.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
categories:
2-
- title: 'Dependency updates'
2+
- title: "Dependency updates"
33
collapse-after: 3
44
labels:
5-
- 'Dependencies'
5+
- "Dependencies"
66
template: |
77
## What's Changed
88

.github/workflows/codeql-analysis.yml

+37-37
Original file line numberDiff line numberDiff line change
@@ -17,44 +17,44 @@ jobs:
1717
matrix:
1818
# Override automatic language detection by changing the below list
1919
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
20-
language: ['javascript']
20+
language: ["javascript"]
2121
# Learn more...
2222
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
2323

2424
steps:
25-
- name: Checkout repository
26-
uses: actions/[email protected]
27-
with:
28-
# We must fetch at least the immediate parents so that if this is
29-
# a pull request then we can checkout the head.
30-
fetch-depth: 2
31-
32-
# If this run was triggered by a pull request event, then checkout
33-
# the head of the pull request instead of the merge commit.
34-
- run: git checkout HEAD^2
35-
if: ${{ github.event_name == 'pull_request' }}
36-
37-
# Initializes the CodeQL tools for scanning.
38-
- name: Initialize CodeQL
39-
uses: github/codeql-action/init@v2
40-
with:
41-
languages: ${{ matrix.language }}
42-
43-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
44-
# If this step fails, then you should remove it and run the build manually (see below)
45-
- name: Autobuild
46-
uses: github/codeql-action/autobuild@v2
47-
48-
# ℹ️ Command-line programs to run using the OS shell.
49-
# 📚 https://git.io/JvXDl
50-
51-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
52-
# and modify them (or add more) to build your code if your project
53-
# uses a compiled language
54-
55-
#- run: |
56-
# make bootstrap
57-
# make release
58-
59-
- name: Perform CodeQL Analysis
60-
uses: github/codeql-action/analyze@v2
25+
- name: Checkout repository
26+
uses: actions/[email protected]
27+
with:
28+
# We must fetch at least the immediate parents so that if this is
29+
# a pull request then we can checkout the head.
30+
fetch-depth: 2
31+
32+
# If this run was triggered by a pull request event, then checkout
33+
# the head of the pull request instead of the merge commit.
34+
- run: git checkout HEAD^2
35+
if: ${{ github.event_name == 'pull_request' }}
36+
37+
# Initializes the CodeQL tools for scanning.
38+
- name: Initialize CodeQL
39+
uses: github/codeql-action/init@v2
40+
with:
41+
languages: ${{ matrix.language }}
42+
43+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
44+
# If this step fails, then you should remove it and run the build manually (see below)
45+
- name: Autobuild
46+
uses: github/codeql-action/autobuild@v2
47+
48+
# ℹ️ Command-line programs to run using the OS shell.
49+
# 📚 https://git.io/JvXDl
50+
51+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
52+
# and modify them (or add more) to build your code if your project
53+
# uses a compiled language
54+
55+
#- run: |
56+
# make bootstrap
57+
# make release
58+
59+
- name: Perform CodeQL Analysis
60+
uses: github/codeql-action/analyze@v2

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CLA.md
2+
CODE_OF_CONDUCT.md
3+
LICENSE.md

.vscode/launch.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
"webRoot": "${workspaceFolder}/hass_frontend",
1010
"disableNetworkCache": true,
1111
"preLaunchTask": "Develop Frontend",
12-
"outFiles": [
13-
"${workspaceFolder}/hass_frontend/frontend_latest/*.js"
14-
]
12+
"outFiles": ["${workspaceFolder}/hass_frontend/frontend_latest/*.js"]
1513
},
1614
{
1715
"name": "Debug Gallery",
@@ -39,6 +37,6 @@
3937
"webRoot": "${workspaceFolder}/cast/dist",
4038
"disableNetworkCache": true,
4139
"preLaunchTask": "Develop Cast"
42-
},
40+
}
4341
]
4442
}

.vscode/tasks.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
"type": "gulp",
198198
"task": "setup-and-fetch-nightly-translations",
199199
"problemMatcher": []
200-
}
200+
}
201201
],
202202
"inputs": [
203203
{

cast/public/service_worker.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
self.addEventListener("fetch", function(event) {
1+
self.addEventListener("fetch", (event) => {
22
event.respondWith(fetch(event.request));
33
});

demo/public/service_worker.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
self.addEventListener("fetch", function(event) {
1+
self.addEventListener("fetch", (event) => {
22
event.respondWith(fetch(event.request));
33
});

gallery/src/pages/Text/remove-delete-add-create.markdown

+34-24
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,63 @@ subtitle: The difference between remove/delete and add/create.
44
---
55

66
# Remove vs Delete
7+
78
Remove and Delete are quite similar, but can be frustrating if used inconsistently.
89

910
## Remove
11+
1012
Take away and set aside, but kept in existence.
1113

1214
For example:
13-
* Removing a user's permission
14-
* Removing a user from a group
15-
* Removing links between items
16-
* Removing a widget
17-
* Removing a link
18-
* Removing an item from a cart
15+
16+
- Removing a user's permission
17+
- Removing a user from a group
18+
- Removing links between items
19+
- Removing a widget
20+
- Removing a link
21+
- Removing an item from a cart
1922

2023
## Delete
24+
2125
Erase, rendered nonexistent or nonrecoverable.
2226

2327
For example:
24-
* Deleting a field
25-
* Deleting a value in a field
26-
* Deleting a task
27-
* Deleting a group
28-
* Deleting a permission
29-
* Deleting a calendar event
28+
29+
- Deleting a field
30+
- Deleting a value in a field
31+
- Deleting a task
32+
- Deleting a group
33+
- Deleting a permission
34+
- Deleting a calendar event
3035

3136
# Add vs Create
37+
3238
In most cases, Create can be paired with Delete, and Add can be paired with Remove.
3339

3440
## Add
41+
3542
An already-exisiting item.
3643

3744
For example:
38-
* Adding a permission to a user
39-
* Adding a user to a group
40-
* Adding links between items
41-
* Adding a widget
42-
* Adding a link
43-
* Adding an item to a cart
45+
46+
- Adding a permission to a user
47+
- Adding a user to a group
48+
- Adding links between items
49+
- Adding a widget
50+
- Adding a link
51+
- Adding an item to a cart
4452

4553
## Create
54+
4655
Something made from scratch.
4756

4857
For example:
49-
* Creating a new field
50-
* Creating a new value in a field
51-
* Creating a new task
52-
* Creating a new group
53-
* Creating a new permission
54-
* Creating a new calendar event
58+
59+
- Creating a new field
60+
- Creating a new value in a field
61+
- Creating a new task
62+
- Creating a new group
63+
- Creating a new permission
64+
- Creating a new calendar event
5565

5666
Based on this is [UX magazine article](https://uxmag.com/articles/ui-copy-remove-vs-delete2-banner).

gallery/src/pages/brand/logo.markdown

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ As a community, we are proud of our logo. Follow these guidelines to ensure it a
1010

1111
![Logo](/images/logo.png)
1212

13-
1413
## Using the icon
1514

1615
Our icon is a shorter and most used version of our logo. The icon can exist without the wordmark, the wordmark should never exist without the icon.
@@ -21,7 +20,7 @@ Our icon is a shorter and most used version of our logo. The icon can exist with
2120

2221
The pretty blue logo with a background shadow, pictured top left, is our primary logo. It should only be used with black, white, and non-duotone photography.
2322

24-
When needed you can use our logo without a shadow, as seen as the second variant.
23+
When needed you can use our logo without a shadow, as seen as the second variant.
2524

2625
The outlined logo should only be used on packaging.
2726

gallery/src/pages/components/ha-alert.markdown

+26-20
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ subtitle: An alert displays a short, important message in a way that attracts th
1111
</style>
1212

1313
# Alert `<ha-alert>`
14+
1415
The alert offers four severity levels that set a distinctive icon and color.
1516

1617
<ha-alert alert-type="error">
@@ -35,38 +36,46 @@ The alert offers four severity levels that set a distinctive icon and color.
3536
2. [Implementation](#implementation)
3637

3738
### Resources
38-
| Type | Link | Status |
39-
|----------------|----------------------------------|-----------|
39+
40+
| Type | Link | Status |
41+
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
4042
| Design | <a href="https://www.figma.com/community/file/967153512097289521/Home-Assistant-DesignKit" rel="noopener noreferrer" target="_blank">Home Assistant DesignKit</a> (Figma) | Available |
41-
| Implementation | <a href="https://github.com/home-assistant/frontend/blob/dev/src/components/ha-alert.ts" rel="noopener noreferrer" target="_blank">Web Component</a> (GitHub) | Available |
43+
| Implementation | <a href="https://github.com/home-assistant/frontend/blob/dev/src/components/ha-alert.ts" rel="noopener noreferrer" target="_blank">Web Component</a> (GitHub) | Available |
4244

4345
## Guidelines
46+
4447
### Usage
48+
4549
An alert displays a short, important message in a way that attracts the user's attention without interrupting the user's task.
4650

4751
### Anatomy
48-
*Documentation coming soon*
52+
53+
_Documentation coming soon_
4954

5055
### Error alert
56+
5157
Error alerts
52-
*Real world example coming soon*
58+
_Real world example coming soon_
5359

5460
### Warning alert
61+
5562
Warning alerts
56-
*Real world example coming soon*
63+
_Real world example coming soon_
5764

5865
### Info alert
66+
5967
Info alerts
60-
*Real world example coming soon*
68+
_Real world example coming soon_
6169

6270
### Success alert
71+
6372
Success alerts
64-
*Real world example coming soon*
73+
_Real world example coming soon_
6574

6675
### Placement
6776

68-
6977
### Accessibility
78+
7079
(WAI-ARIA: [https://www.w3.org/TR/wai-aria-practices/#alert](https://www.w3.org/TR/wai-aria-practices/#alert))
7180

7281
When the component is dynamically displayed, the content is automatically announced by most screen readers. At this time, screen readers do not inform users of alerts that are present when the page loads.
@@ -78,6 +87,7 @@ Actions must have a tab index of 0 so that they can be reached by keyboard-only
7887
## Implementation
7988

8089
### Example Usage
90+
8191
**Alert type**
8292

8393
<ha-alert alert-type="error">
@@ -96,17 +106,12 @@ Actions must have a tab index of 0 so that they can be reached by keyboard-only
96106
This is an success alert — check it out!
97107
</ha-alert>
98108

99-
100109
```html
101-
<ha-alert alert-type="error">
102-
This is an error alert — check it out!
103-
</ha-alert>
110+
<ha-alert alert-type="error"> This is an error alert — check it out! </ha-alert>
104111
<ha-alert alert-type="warning">
105112
This is a warning alert — check it out!
106113
</ha-alert>
107-
<ha-alert alert-type="info">
108-
This is an info alert — check it out!
109-
</ha-alert>
114+
<ha-alert alert-type="info"> This is an info alert — check it out! </ha-alert>
110115
<ha-alert alert-type="success">
111116
This is a success alert — check it out!
112117
</ha-alert>
@@ -154,13 +159,14 @@ The `title ` option should not be used without a description.
154159

155160
**Slotted icon**
156161

157-
*Documentation coming soon*
162+
_Documentation coming soon_
158163

159164
### API
165+
160166
**Properties/Attributes**
161167

162168
| Name | Type | Default | Description |
163-
|-------------|---------|---------|-------------------------------------------------------|
169+
| ----------- | ------- | ------- | ----------------------------------------------------- |
164170
| title | string | `` | Title to display. |
165171
| alertType | string | `info` | Severity level that set a distinctive icon and color. |
166172
| dismissable | boolean | `false` | Gives the option to close the alert. |
@@ -170,8 +176,8 @@ The `title ` option should not be used without a description.
170176

171177
**Events**
172178

173-
*Documentation coming soon*
179+
_Documentation coming soon_
174180

175181
**CSS Custom Properties**
176182

177-
*Documentation coming soon*
183+
_Documentation coming soon_

0 commit comments

Comments
 (0)