Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ module.exports = {
root: true,
extends: [
'@nextcloud',
'prettier',
],
"overrides": [
{
"files": ["**/*.vue"],
"rules": {
"vue/first-attribute-linebreak": "off"
}
}
],
rules: {
'@typescript-eslint/no-unused-vars': ['off'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,54 @@
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Lint stylelint
name: Lint prettier

on: pull_request

permissions:
contents: read

concurrency:
group: lint-stylelint-${{ github.head_ref || github.run_id }}
group: lint-prettier-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest-low
permissions:
contents: read
pull-requests: read

outputs:
src: ${{ steps.changes.outputs.src }}

steps:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
continue-on-error: true
with:
filters: |
src:
- '.github/workflows/**'
- 'src/**'
- 'appinfo/info.xml'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '.eslintrc.*'
- '.eslintignore'
- '.prettierignore'
- '**.js'
- '**.ts'
- '**.vue'

lint:
runs-on: ubuntu-latest

name: stylelint
needs: changes
if: needs.changes.outputs.src != 'false'

name: prettier

steps:
- name: Checkout
Expand All @@ -47,7 +79,23 @@ jobs:
- name: Install dependencies
env:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_DOWNLOAD: true
run: npm ci

- name: Lint
run: npm run stylelint
run: npm run prettier

summary:
permissions:
contents: none
runs-on: ubuntu-latest-low
needs: [changes, lint]

if: always()

# This is the summary, we just avoid to rename it so that branch protection rules still match
name: prettier

steps:
- name: Summary status
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi
1 change: 1 addition & 0 deletions .nextcloudignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/.l10nignore
/.nextcloudignore
/.php-cs-fixer.dist.php
/.prettierignore
/.stylelintrc.js
/.travis.yml
/.tx
Expand Down
18 changes: 18 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

# version control systems directories
**/.git
**/.svn
**/.hg

# 3rdparty dependencies
**/node_modules
**/vendor

# Compiled JS output
js/

# PHP
lib/
**/*.php
9 changes: 0 additions & 9 deletions .stylelintrc.cjs

This file was deleted.

10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ lint:
lint-fix:
npm run lint:fix

# Style linting
stylelint:
npm run stylelint
# Formatting
format-check:
npm run prettier

stylelint-fix:
npm run stylelint:fix
format-fix:
npm run prettier:fix

# Cleaning
clean:
Expand Down
Loading
Loading