Skip to content

chore(lint): add prettier and lint on CI #2946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# GitHub Actions docs
# https://help.github.com/en/articles/about-github-actions
# https://help.github.com/en/articles/workflow-syntax-for-github-actions

name: Install Dependencies, Lint

on: [pull_request]

jobs:
test:
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [16]
os: [windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- name: Install Dependencies
run: npm ci --legacy-peer-deps
- name: Lint
run: npm run lint
10 changes: 6 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
src/theme/DocItem
src/theme/DocPage
legacy-stencil-components
node_modules
scripts/bak
src/styles.bak
src/pages

docs/api
docs/native
docs/cli/commands

static/code/stackblitz

.docusaurus
.github
.github
build
node_modules
14 changes: 7 additions & 7 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module.exports = {
...require("@ionic/prettier-config"),
...require('@ionic/prettier-config'),
overrides: [
{
files: "*.md",
files: '*.md',
options: {
"parser": "mdx"
}
}
]
};
parser: 'mdx',
},
},
],
};
14 changes: 10 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
"deploy": "docusaurus deploy",
"docusaurus": "docusaurus",
"generate-markdown": "node scripts/native && concurrently \"node scripts/cli\" \"node scripts/release-notes\"",
"lint": "npm run prettier -- --write --cache",
"serve": "docusaurus serve",
"prestart": "npm run generate-markdown",
"prettier": "prettier \"./**/*.{html,ts,tsx,js,jsx,md}\"",
"start": "docusaurus start",
"swizzle": "docusaurus swizzle --danger"
},
Expand Down Expand Up @@ -69,7 +71,7 @@
"@tsconfig/docusaurus": "^1.0.4",
"@types/react": "^17.0.37",
"html-loader": "^3.1.0",
"prettier": "^2.5.0",
"prettier": "^2.8.8",
"typescript": "^4.5.2"
}
}