Skip to content

Commit

Permalink
Expand use of prettier to all tracked files (home-assistant#17311)
Browse files Browse the repository at this point in the history
  • Loading branch information
steverep authored Jul 18, 2023
1 parent 493f1d1 commit c71fd05
Show file tree
Hide file tree
Showing 28 changed files with 265 additions and 222 deletions.
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
categories:
- title: 'Dependency updates'
- title: "Dependency updates"
collapse-after: 3
labels:
- 'Dependencies'
- "Dependencies"
template: |
## What's Changed
Expand Down
74 changes: 37 additions & 37 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,44 @@ jobs:
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['javascript']
language: ["javascript"]
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/[email protected]
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Checkout repository
uses: actions/[email protected]
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CLA.md
CODE_OF_CONDUCT.md
LICENSE.md
6 changes: 2 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"webRoot": "${workspaceFolder}/hass_frontend",
"disableNetworkCache": true,
"preLaunchTask": "Develop Frontend",
"outFiles": [
"${workspaceFolder}/hass_frontend/frontend_latest/*.js"
]
"outFiles": ["${workspaceFolder}/hass_frontend/frontend_latest/*.js"]
},
{
"name": "Debug Gallery",
Expand Down Expand Up @@ -39,6 +37,6 @@
"webRoot": "${workspaceFolder}/cast/dist",
"disableNetworkCache": true,
"preLaunchTask": "Develop Cast"
},
}
]
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"type": "gulp",
"task": "setup-and-fetch-nightly-translations",
"problemMatcher": []
}
}
],
"inputs": [
{
Expand Down
2 changes: 1 addition & 1 deletion cast/public/service_worker.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
self.addEventListener("fetch", function(event) {
self.addEventListener("fetch", (event) => {
event.respondWith(fetch(event.request));
});
2 changes: 1 addition & 1 deletion demo/public/service_worker.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
self.addEventListener("fetch", function(event) {
self.addEventListener("fetch", (event) => {
event.respondWith(fetch(event.request));
});
58 changes: 34 additions & 24 deletions gallery/src/pages/Text/remove-delete-add-create.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,63 @@ subtitle: The difference between remove/delete and add/create.
---

# Remove vs Delete

Remove and Delete are quite similar, but can be frustrating if used inconsistently.

## Remove

Take away and set aside, but kept in existence.

For example:
* Removing a user's permission
* Removing a user from a group
* Removing links between items
* Removing a widget
* Removing a link
* Removing an item from a cart

- Removing a user's permission
- Removing a user from a group
- Removing links between items
- Removing a widget
- Removing a link
- Removing an item from a cart

## Delete

Erase, rendered nonexistent or nonrecoverable.

For example:
* Deleting a field
* Deleting a value in a field
* Deleting a task
* Deleting a group
* Deleting a permission
* Deleting a calendar event

- Deleting a field
- Deleting a value in a field
- Deleting a task
- Deleting a group
- Deleting a permission
- Deleting a calendar event

# Add vs Create

In most cases, Create can be paired with Delete, and Add can be paired with Remove.

## Add

An already-exisiting item.

For example:
* Adding a permission to a user
* Adding a user to a group
* Adding links between items
* Adding a widget
* Adding a link
* Adding an item to a cart

- Adding a permission to a user
- Adding a user to a group
- Adding links between items
- Adding a widget
- Adding a link
- Adding an item to a cart

## Create

Something made from scratch.

For example:
* Creating a new field
* Creating a new value in a field
* Creating a new task
* Creating a new group
* Creating a new permission
* Creating a new calendar event

- Creating a new field
- Creating a new value in a field
- Creating a new task
- Creating a new group
- Creating a new permission
- Creating a new calendar event

Based on this is [UX magazine article](https://uxmag.com/articles/ui-copy-remove-vs-delete2-banner).
3 changes: 1 addition & 2 deletions gallery/src/pages/brand/logo.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ As a community, we are proud of our logo. Follow these guidelines to ensure it a

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


## Using the icon

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.
Expand All @@ -21,7 +20,7 @@ Our icon is a shorter and most used version of our logo. The icon can exist with

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.

When needed you can use our logo without a shadow, as seen as the second variant.
When needed you can use our logo without a shadow, as seen as the second variant.

The outlined logo should only be used on packaging.

Expand Down
46 changes: 26 additions & 20 deletions gallery/src/pages/components/ha-alert.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ subtitle: An alert displays a short, important message in a way that attracts th
</style>

# Alert `<ha-alert>`

The alert offers four severity levels that set a distinctive icon and color.

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

### Resources
| Type | Link | Status |
|----------------|----------------------------------|-----------|

| Type | Link | Status |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| Design | <a href="https://www.figma.com/community/file/967153512097289521/Home-Assistant-DesignKit" rel="noopener noreferrer" target="_blank">Home Assistant DesignKit</a> (Figma) | Available |
| 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 |
| 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 |

## Guidelines

### Usage

An alert displays a short, important message in a way that attracts the user's attention without interrupting the user's task.

### Anatomy
*Documentation coming soon*

_Documentation coming soon_

### Error alert

Error alerts
*Real world example coming soon*
_Real world example coming soon_

### Warning alert

Warning alerts
*Real world example coming soon*
_Real world example coming soon_

### Info alert

Info alerts
*Real world example coming soon*
_Real world example coming soon_

### Success alert

Success alerts
*Real world example coming soon*
_Real world example coming soon_

### Placement


### Accessibility

(WAI-ARIA: [https://www.w3.org/TR/wai-aria-practices/#alert](https://www.w3.org/TR/wai-aria-practices/#alert))

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.
Expand All @@ -78,6 +87,7 @@ Actions must have a tab index of 0 so that they can be reached by keyboard-only
## Implementation

### Example Usage

**Alert type**

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


```html
<ha-alert alert-type="error">
This is an error alert — check it out!
</ha-alert>
<ha-alert alert-type="error"> This is an error alert — check it out! </ha-alert>
<ha-alert alert-type="warning">
This is a warning alert — check it out!
</ha-alert>
<ha-alert alert-type="info">
This is an info alert — check it out!
</ha-alert>
<ha-alert alert-type="info"> This is an info alert — check it out! </ha-alert>
<ha-alert alert-type="success">
This is a success alert — check it out!
</ha-alert>
Expand Down Expand Up @@ -154,13 +159,14 @@ The `title ` option should not be used without a description.

**Slotted icon**

*Documentation coming soon*
_Documentation coming soon_

### API

**Properties/Attributes**

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

**Events**

*Documentation coming soon*
_Documentation coming soon_

**CSS Custom Properties**

*Documentation coming soon*
_Documentation coming soon_
Loading

0 comments on commit c71fd05

Please sign in to comment.