diff --git a/.github/workflows/check_source.yml b/.github/workflows/check_source.yml new file mode 100644 index 0000000..a3d1b92 --- /dev/null +++ b/.github/workflows/check_source.yml @@ -0,0 +1,26 @@ +name: Check the source code +on: + push: + branches: [master] + pull_request: + branches: [master] +jobs: + check_source_code: + name: Check the source code + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'yarn' + + - name: Install dependencies + run: yarn install + + - name: Check formatting + run: yarn format:check + + - name: Lint + run: yarn lint diff --git a/.github/workflows/stales.yml b/.github/workflows/stales.yml index 0c6a597..bb48b54 100644 --- a/.github/workflows/stales.yml +++ b/.github/workflows/stales.yml @@ -1,4 +1,4 @@ -name: "Close stale issues and PRs" +name: Close stale issues and PRs on: schedule: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8cc9cf4..d5ce6ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,7 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'yarn' diff --git a/package.json b/package.json index c8f2b89..4496755 100755 --- a/package.json +++ b/package.json @@ -9,8 +9,10 @@ "ui": "rm -rf ./ui/public/* && vite", "prod": "yarn && vite build --emptyOutDir", "format": "prettier --write lib/**/*.js ui/src/**/*.jsx test/**/*.js *.js", + "format:check": "prettier --check lib/**/*.js ui/src/**/*.jsx test/**/*.js *.js", "test": "mocha --loader=esmock --timeout 3000000 test/**/*.test.js", - "lint": "eslint index.js lib/**/*.js test/**/*.js ui/src/**/*.jsx --fix" + "lint": "eslint index.js lib/**/*.js test/**/*.js ui/src/**/*.jsx", + "lint:fix": "yarn lint --fix" }, "type": "module", "lint-staged": {