diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..84d79e4 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,28 @@ +name: Check Format + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + format: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: "16" + + - name: Install dependencies + run: npm install --force + + - name: Run Prettier check + run: npm run format:check \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..57e1d2c --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,28 @@ +name: Lint + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: "16" + + - name: Install dependencies + run: npm install --force + + - name: Run ESLint + run: npm run lint \ No newline at end of file diff --git a/package.json b/package.json index 4c28582..10f51ee 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "start": "next start -p 9169", "lint": "next lint", "test": "tsx ./tests/test.ts", - "format": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'" + "format": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'", + "format:check": "prettier --check 'src/**/*.{js,jsx,ts,tsx}'" }, "dependencies": { "@radix-ui/react-slot": "^1.1.0",