{"id":15136267,"url":"https://github.com/nextcloud-libraries/nextcloud-prettier-config","last_synced_at":"2026-01-18T17:33:43.617Z","repository":{"id":219957434,"uuid":"750367622","full_name":"nextcloud-libraries/nextcloud-prettier-config","owner":"nextcloud-libraries","description":"Shared stylistic rules for Nextcloud apps and libraries","archived":false,"fork":false,"pushed_at":"2024-01-30T15:10:13.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-01-31T15:55:45.338Z","etag":null,"topics":["codestyle","nextcloud","prettier"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nextcloud-libraries.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-30T14:12:28.000Z","updated_at":"2024-01-30T14:56:51.000Z","dependencies_parsed_at":"2024-01-30T16:11:28.673Z","dependency_job_id":null,"html_url":"https://github.com/nextcloud-libraries/nextcloud-prettier-config","commit_stats":null,"previous_names":["nextcloud-libraries/nextcloud-prettier-config"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fnextcloud-prettier-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fnextcloud-prettier-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fnextcloud-prettier-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fnextcloud-prettier-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextcloud-libraries","download_url":"https://codeload.github.com/nextcloud-libraries/nextcloud-prettier-config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247425449,"owners_count":20936951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codestyle","nextcloud","prettier"],"created_at":"2024-09-26T06:20:18.267Z","updated_at":"2026-01-18T17:33:43.573Z","avatar_url":"https://github.com/nextcloud-libraries.png","language":"JavaScript","readme":"# Nextcloud Prettier configuration\n\n[![REUSE status](https://api.reuse.software/badge/github.com/nextcloud-libraries/nextcloud-prettier-config)](https://api.reuse.software/info/github.com/nextcloud-libraries/nextcloud-prettier-config)\n\nThis provides a shared configuration for Nextcloud apps and libraries to have consistent stylistic rules.\nUsing stylistic rules in linters is not recommended as linters are for finding bugs while prettier is for code style.\nMoreover ESLint and StyleLint both deprecate and remove stylistic rules, as a replacement using Prettier is recommended.\n\n## Setup\n\n### Prepare ESLint\n\nIf you are using ESLint you should enable the `eslint-config-prettier` configuration which disables all ESLint rules that conflict with Prettier.\nA detailed description can be found here: [github.com/prettier/eslint-config-prettier](https://github.com/prettier/eslint-config-prettier?tab=readme-ov-file#installation).\n\nIn short, this should be your ESLint config:\n\n```json\n{\n\t\"extends\": [\n\t\t\"@nextcloud\",\n\t\t\"prettier\" // \u003c this needs to be the last one to override all previous\n\t]\n}\n```\n\nIf you still get errors about Vue files, you need to adjust your ESLint config like the following:\n_(this will be fixed once the Nextcloud ESLint config support flat configs)_\n\n```json\n\"extends\": [\n\t\t\"@nextcloud\",\n\t\t\"prettier\"\n\t],\n\t\"overrides\": [\n\t\t{\n\t\t\t\"files\": [\"**/*.vue\"],\n\t\t\t\"rules\": {\n\t\t\t\t\"vue/first-attribute-linebreak\": \"off\"\n\t\t\t}\n\t\t}\n\t]\n```\n\n### Prepare StyleLint\n\nStylelint already removed all stylistic rules, so make sure to use `@nextcloud/stylelint-config` **3+** together with `stylelint` 16+.\n\n### Configure Prettier\n\nInstall this configuration using:\n\n```shell\nnpm install --save-dev @nextcloud/prettier-config\n```\n\nEither configure Prettier within your `package.json`:\n\n```json\n{\n\t\"name\": \"nextcloud-app\",\n\t\"version\": \"1.33.7\",\n\t\"prettier\": \"@nextcloud/prettier-config\"\n}\n```\n\nOr in a dedicated `.prettierrc.json`:\n\n```json\n\"@nextcloud/prettier-config\"\n```\n\nYou should create a `.prettierignore` file in your project root to allow simply using `prettier .` or `prettier --write .`, the format is very similar to `.gitignore`. For a Nextcloud app the file could look like this:\n\n```shell\n# version control systems directories\n**/.git\n**/.svn\n**/.hg\n\n# 3rdparty dependencies\n**/node_modules\n**/vendor\n\n# Compiled JS output\njs/\n\n# PHP\nlib/\n**/*.php\n```\n\n\u003c!--\n  SPDX-FileCopyrightText: 2024 Nextcloud contributors\n  SPDX-License-Identifier: CC0-1.0\n--\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud-libraries%2Fnextcloud-prettier-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextcloud-libraries%2Fnextcloud-prettier-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud-libraries%2Fnextcloud-prettier-config/lists"}