diff --git a/.eslintignore b/.eslintignore index 6df2350..986ccad 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,3 +4,5 @@ client/out/** client/bundle.js server/node_modules/** server/out/** +jest-style-mock.js +jest.config.js diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..3ce9d9c --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: The PFDL VS Code Extension Contributors +# SPDX-License-Identifier: MIT + +name: Lint + +on: + pull_request: + branches: + - main + push: + branches: + - main + +permissions: + contents: read + +jobs: + run-lint: + name: Lint check + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: Setup Node + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: '18' + - name: Install npm packages + run: npm install + - name: Run ESLint check + run: npm run lint diff --git a/package.json b/package.json index 12c8cc3..37e9d70 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,8 @@ "postinstall": "cd client && npm install && cd ../server && npm install && cd ..", "test": "jest client/src/test/*.test.ts", "test:ci": "jest --config ./jest.config.js --collectCoverage --coverageDirectory=\"./coverage\" --ci --reporters=default --reporters=jest-junit --watchAll=false", - "browserify": "browserify ./client/out/code_visualization/main.js -g browserify-css -o ./client/bundle.js" + "browserify": "browserify ./client/out/code_visualization/main.js -g browserify-css -o ./client/bundle.js", + "lint": "eslint ./" }, "devDependencies": { "@types/jest": "^29.5.5",