Skip to content
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

fix codestyle basedon eslint #62

Merged
merged 27 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 13 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
extends: [
'plugin:vue/vue3-recommended',
// 'plugin:vue/recommended' // Use this if you are using Vue.js 2.x.
],
parserOptions: {
ecmaVersion: 2022,
},
rules: {
// override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error'
}
}
7 changes: 5 additions & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Build-And-Deploy

on:
push:
workflow_run:
workflows: [ "Lint"]
types:
- completed
branches:
- "master"
- master

jobs:
docker:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Lint

on:
push:
branches:
- master
pull_request:

permissions:
checks: write
contents: write

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Setup Node.js
Ashleyhx marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm install

- name: Run linters without auto-fix (on master)
if: github.ref == 'refs/heads/master'
run: ./node_modules/.bin/eslint --ext .js,.vue src

- name: Run linters with auto-fix (on non-master branches)
if: github.ref != 'refs/heads/master'
run: ./node_modules/.bin/eslint --ext .js,.vue src --fix

- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: Lint Bot
message: 'Run linters'
Loading