Skip to content

Commit

Permalink
ci: initial CI support with prettier
Browse files Browse the repository at this point in the history
Signed-off-by: You-Sheng Yang <[email protected]>
  • Loading branch information
vicamo committed Apr 9, 2024
1 parent c665dd0 commit f5c93e9
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Unordered list style
MD004:
style: dash

# Line length
MD013:
line_length: 80
tables: false

# Ordered list item prefix
MD029:
style: one

# Spaces after list markers
MD030:
ul_single: 1
ol_single: 1
ul_multi: 1
ol_multi: 1

# Code block style
MD046:
style: fenced
4 changes: 4 additions & 0 deletions .github/linters/super-linter.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TYPESCRIPT_DEFAULT_STYLE=prettier
VALIDATE_ALL_CODEBASE=true
VALIDATE_JAVASCRIPT_STANDARD=false
VALIDATE_JSCPD=false
34 changes: 34 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Lint Codebase

on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read
packages: read
statuses: write

jobs:
lint:
name: Lint Codebase
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Load super-linter configuration
run: cat .github/linters/super-linter.env >> "$GITHUB_ENV"
- name: Lint Codebase
id: super-linter
uses: super-linter/super-linter/slim@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v3.1.0'
hooks:
- id: prettier
16 changes: 16 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"bracketSameLine": true,
"arrowParens": "avoid",
"proseWrap": "always",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf"
}

0 comments on commit f5c93e9

Please sign in to comment.