From 2856aaec1e3df87712f40f64445482ccd0ae732d Mon Sep 17 00:00:00 2001 From: imaandrew <14946103+imaandrew@users.noreply.github.com> Date: Tue, 18 Jul 2023 14:16:42 -0400 Subject: [PATCH] Add lint action --- .github/workflows/lint.yml | 32 ++++++++++++++++++++++++++++++++ package.json | 13 +++++++------ 2 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..ac31294 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,32 @@ +name: Lint + +on: + push: + branches: + - main + pull_request: + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + cache: "yarn" + + - name: Install Dependencies + run: yarn install --immutable + + - name: Lint ESLint + run: yarn lint:eslint + + - name: Lint Prettier + run: yarn lint:prettier + + - name: Lint Svelte + run: yarn lint:svelte \ No newline at end of file diff --git a/package.json b/package.json index ade891e..5885f2c 100644 --- a/package.json +++ b/package.json @@ -7,12 +7,13 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", - "check": "svelte-check --tsconfig ./tsconfig.json", - "lint": "yarn eslint src", - "lint:fix": "yarn run lint --fix", - "pretty": "yarn prettier src --check", - "pretty:fix": "yarn run pretty --write", - "format": "yarn run pretty:fix && yarn run lint:fix" + "lint": "yarn lint:eslint && yarn lint:prettier && yarn lint:svelte", + "lint:eslint": "yarn eslint src", + "lint:prettier": "yarn prettier src --check", + "lint:svelte": "svelte-check --tsconfig ./tsconfig.json", + "fix": "yarn fix:prettier && yarn fix:eslint", + "fix:eslint": "yarn lint:eslint --fix", + "fix:prettier": "yarn lint:prettier --write" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^2.4.2",