Skip to content

Commit 8db9610

Browse files
chore(lint): add prettier and lint on CI (#2946)
- Adds prettier to a lint command (prettier was installed just not used anywhere) - Runs `npm install` & `npm lint` on CI - Updates the `.prettierignore` to be more up-to-date with the current docs structure - `static/code/stackblitz` files were ignored because it was modifying the indentation surrounding `{ TEMPLATE }` and this caused the StackBlitz to look worse when opened - Adds `mdx` as a parser to the `@ionic/prettier-config` and updates this repo to use that version
1 parent be3c382 commit 8db9610

File tree

1,960 files changed

+39445
-38577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,960 files changed

+39445
-38577
lines changed

.github/workflows/CI.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# GitHub Actions docs
2+
# https://help.github.com/en/articles/about-github-actions
3+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
4+
5+
name: Install Dependencies, Lint
6+
7+
on: [pull_request]
8+
9+
jobs:
10+
test:
11+
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
node_version: [16]
16+
os: [windows-latest, macOS-latest]
17+
18+
steps:
19+
- uses: actions/checkout@v1
20+
- name: Use Node.js ${{ matrix.node_version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node_version }}
24+
- name: Install Dependencies
25+
run: npm ci --legacy-peer-deps
26+
- name: Lint
27+
run: npm run lint

.prettierignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
src/theme/DocItem
22
src/theme/DocPage
33
legacy-stencil-components
4-
node_modules
54
scripts/bak
6-
src/styles.bak
7-
src/pages
5+
86
docs/api
97
docs/native
108
docs/cli/commands
119

10+
static/code/stackblitz
11+
1212
.docusaurus
13-
.github
13+
.github
14+
build
15+
node_modules

.prettierrc.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/angular/slides.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ If you would like to use the Core version instead, which does not include additi
7575
To migrate over your CSS, first update your selectors to target the new custom elements instead:
7676

7777
| ion-slides Selector | Swiper Selector |
78-
| ------------------- | ------------------ |
78+
| ------------------- | ------------------ |
7979
| `ion-slides` | `swiper-container` |
8080
| `ion-slide` | `swiper-slide` |
8181

@@ -155,9 +155,7 @@ export class HomePage {
155155
```html
156156
<!-- home.page.html -->
157157

158-
<swiper-container [modules]="swiperModules">
159-
...
160-
</swiper-container>
158+
<swiper-container [modules]="swiperModules"> ... </swiper-container>
161159
```
162160

163161
:::note
@@ -190,11 +188,11 @@ To set these options as properties directly on `<swiper-container>` we would do
190188

191189
Below is a full list of property changes when going from `ion-slides` to Swiper Element:
192190

193-
| Name | Notes |
194-
| --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
195-
| options | Set each option as a property directly on the `<swiper-container>` component. |
196-
| mode | For different styles based upon the mode, you can target the slides with `.ios swiper-container` or `.md swiper-container` in your CSS. |
197-
| pager | Use the `pagination` property instead. |
191+
| Name | Notes |
192+
| ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
193+
| options | Set each option as a property directly on the `<swiper-container>` component. |
194+
| mode | For different styles based upon the mode, you can target the slides with `.ios swiper-container` or `.md swiper-container` in your CSS. |
195+
| pager | Use the `pagination` property instead. |
198196

199197
:::note
200198
All properties available in Swiper Element can be found at <a href="https://swiperjs.com/swiper-api#parameters" target="_blank" rel="noopener noreferrer">https://swiperjs.com/swiper-api#parameters</a>.
@@ -306,9 +304,7 @@ All methods and properties available on the Swiper instance can be found at <a h
306304
Effects such as Cube or Fade can be used in Swiper Element with no additional imports, as long as you are using the bundled version of Swiper. For example, the below code will cause the slides to have a flip transition effect:
307305

308306
```html
309-
<swiper-container effect="flip">
310-
...
311-
</swiper-container>
307+
<swiper-container effect="flip"> ... </swiper-container>
312308
```
313309

314310
:::note

docs/cli/livereload.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ Remember, with the `--external` option, others on your Wi-Fi network will be abl
6464
Live reload will use HTTP by default which will cause web APIs that require a secure context (like [web crypto](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API)) to fail. To establish a secure context you can use the `--ssl` argument to use HTTPS.
6565

6666
For example, with an Angular application you can run the following to pass a certificate and private key and serve your app with HTTPS:
67+
6768
```shell
6869
ionic capacitor run android --livereload --external --ssl -- --ssl-cert='server.crt' --ssl-key='server.key'
6970
```
7071

71-
Using a self signed certificate and ensuring it is trusted by the device is a complicated topic and is covered in [this article](https://ionic.zendesk.com/hc/en-us/articles/11384425513623).
72+
Using a self signed certificate and ensuring it is trusted by the device is a complicated topic and is covered in [this article](https://ionic.zendesk.com/hc/en-us/articles/11384425513623).

0 commit comments

Comments
 (0)