diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f614dcbe..2f151e2e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -23,7 +23,7 @@ jobs: if_true: false if_false: true - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: 'recursive' diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 00000000..5f5d4520 --- /dev/null +++ b/.github/workflows/prettier.yml @@ -0,0 +1,20 @@ +name: Lint Frontend +on: + push: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: 'recursive' + - name: Restore npm dependencies + working-directory: Parlance.ClientApp + run: | + npm ci + - name: Lint + working-directory: Parlance.ClientApp + run: | + npm run lint \ No newline at end of file diff --git a/Parlance.ClientApp/package-lock.json b/Parlance.ClientApp/package-lock.json index 5158af36..7d3f54e6 100644 --- a/Parlance.ClientApp/package-lock.json +++ b/Parlance.ClientApp/package-lock.json @@ -62,6 +62,7 @@ "@types/react-dom": "^18.2.17", "@vitejs/plugin-react": "^4.2.1", "eslint": "^8.55.0", + "eslint-config-prettier": "^9.1.0", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.5", @@ -7431,6 +7432,19 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-config-react-app": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/eslint-config-react-app/-/eslint-config-react-app-7.0.1.tgz", @@ -26471,6 +26485,13 @@ } } }, + "eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "requires": {} + }, "eslint-config-react-app": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/eslint-config-react-app/-/eslint-config-react-app-7.0.1.tgz", diff --git a/Parlance.ClientApp/package.json b/Parlance.ClientApp/package.json index 88872266..637ecdcd 100644 --- a/Parlance.ClientApp/package.json +++ b/Parlance.ClientApp/package.json @@ -76,7 +76,7 @@ "scripts": { "dev": "node genlangindex.js && vite", "build": "node genlangindex.js && vite build", - "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", + "lint": "prettier . --check", "preview": "vite preview" }, "eslintConfig": {