diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml new file mode 100644 index 0000000..15b429f --- /dev/null +++ b/.github/workflows/sanity-check.yml @@ -0,0 +1,22 @@ +name: PR Sanity Check + +on: pull_request + +jobs: + lint: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Packages + run: | + npm install + + - name: Lint check + run: | + npm run lint + + - name: Lint check + run: | + npm run test diff --git a/.prettierrc b/.prettierrc index 4c179e3..1a20fe9 100644 --- a/.prettierrc +++ b/.prettierrc @@ -2,4 +2,4 @@ "semi": true, "singleQuote": true, "trailingComma": "all" -} \ No newline at end of file + } \ No newline at end of file diff --git a/babel.config.js b/babel.config.js index a90fb23..a1db3ce 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,3 @@ module.exports = { - presets: [['@babel/preset-env', {targets: {node: 'current'}}]], - }; \ No newline at end of file + presets: [['@babel/preset-env', {targets: {node: 'current'}}]], +}; \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs index b32b314..6e8c818 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -3,7 +3,6 @@ import globals from "globals"; import { defineConfig } from "eslint/config"; import jest from "eslint-plugin-jest"; import eslintRecommended from "eslint-plugin-prettier/recommended"; -import plugin from "eslint-plugin-jest"; export default defineConfig([ @@ -12,9 +11,9 @@ export default defineConfig([ { files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: globals.browser } }, { rules: { - "prefer-const": "error", - "no-unused-vars": "error", - "semi": "error", + "prefer-const": "error", + "no-unused-vars": "error", + "semi": "error", }, }, { diff --git a/package.json b/package.json index 5c23204..39c60da 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "url": "https://github.com/Chudofa-L/JavaScript--set-up-the-environment/issues" }, "homepage": "https://github.com/Chudofa-L/JavaScript--set-up-the-environment#readme", - "lint-staged": { + "lint-staged": { "src/**/*.js": "eslint" }, "devDependencies": {