diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 051174e2..b4b7f390 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,26 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-node@v3 + - name: Cache npm + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('frontend/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install dependencies + run: npm ci + working-directory: ./frontend + + - name: Display Prettier version + run: npx prettier --version + working-directory: ./frontend + + - name: Display contents + run: cat .prettierrc .prettierignore + working-directory: ./frontend + - name: Frontend code formatting check (Prettier) - run: npm install prettier && npm run format:check - working-directory: ./frontend \ No newline at end of file + run: npm run format:check + working-directory: ./frontend diff --git a/frontend/.prettierignore b/frontend/.prettierignore index e69de29b..b512c09d 100644 --- a/frontend/.prettierignore +++ b/frontend/.prettierignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index 77de20be..d098c414 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,8 +5,8 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "format": "prettier --config .prettierrc --ignore-path .prettierignore --write '**/*.ts' ", - "format:check": "prettier --config .prettierrc --ignore-path .prettierignore '**/*.ts' " + "format": "prettier --config .prettierrc --ignore-path .prettierignore --write '**/*.{ts,html,scss}' ", + "format:check": "prettier --config .prettierrc --ignore-path .prettierignore --check '**/*.{ts,html,scss}' " }, "author": "", "license": "ISC",