{"id":15001934,"url":"https://github.com/nextcloud-libraries/eslint-config","last_synced_at":"2026-03-17T22:03:54.818Z","repository":{"id":37960317,"uuid":"210401146","full_name":"nextcloud-libraries/eslint-config","owner":"nextcloud-libraries","description":"Shared eslint config","archived":false,"fork":false,"pushed_at":"2026-01-12T20:20:26.000Z","size":5631,"stargazers_count":8,"open_issues_count":14,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-13T01:24:05.663Z","etag":null,"topics":["config","configuration","nextcloud","nextcloud-config","nextcloud-plugin"],"latest_commit_sha":null,"homepage":"https://npmjs.org/@nextcloud/eslint-config","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nextcloud-libraries.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-09-23T16:21:12.000Z","updated_at":"2026-01-12T20:20:32.000Z","dependencies_parsed_at":"2023-08-28T13:43:55.161Z","dependency_job_id":"d47fc5cb-cb84-4c3c-89f7-7c5b8decbeac","html_url":"https://github.com/nextcloud-libraries/eslint-config","commit_stats":{"total_commits":876,"total_committers":23,"mean_commits":38.08695652173913,"dds":"0.24543378995433784","last_synced_commit":"ba9d67886388cb7362e9af2af0e0451d51361791"},"previous_names":["nextcloud/eslint-config-nextcloud","nextcloud-libraries/eslint-config","nextcloud/eslint-config"],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/nextcloud-libraries/eslint-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Feslint-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Feslint-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Feslint-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Feslint-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextcloud-libraries","download_url":"https://codeload.github.com/nextcloud-libraries/eslint-config/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Feslint-config/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28573281,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T15:45:05.669Z","status":"ssl_error","status_checked_at":"2026-01-19T15:44:23.317Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["config","configuration","nextcloud","nextcloud-config","nextcloud-plugin"],"created_at":"2024-09-24T18:32:24.143Z","updated_at":"2026-03-17T22:03:54.809Z","avatar_url":"https://github.com/nextcloud-libraries.png","language":"TypeScript","readme":"\u003c!--\n  - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n--\u003e\t\n## @nextcloud/eslint-config\n\n[![REUSE status](https://api.reuse.software/badge/github.com/nextcloud-libraries/eslint-config)](https://api.reuse.software/info/github.com/nextcloud-libraries/eslint-config)\n[![npm last version](https://img.shields.io/npm/v/@nextcloud/eslint-config.svg)](https://www.npmjs.com/package/@nextcloud/eslint-config)\n[![Lint status](https://img.shields.io/github/actions/workflow/status/nextcloud-libraries/eslint-config/lint-eslint.yml?label=lint)](https://github.com/nextcloud-libraries/eslint-config/actions/workflows/lint.yml)\n[![Dependabot status](https://img.shields.io/badge/Dependabot-enabled-brightgreen.svg?longCache=true\u0026logo=dependabot)](https://dependabot.com)\n\n\nThis is a package containing the unified global eslint config used by all nextcloud apps and libraries.\nIt contains the necessary dependencies and peerDependencies so that other apps cannot update if this config does not support it.\nPlease always use dependabot to update your apps, OR pay attention to the peer dependencies error messages!\n\nThe rules within this configuration are based on, and enforce, the Nextcloud [coding style](https://docs.nextcloud.com/server/latest/developer_manual/getting_started/coding_standards/javascript.html#code-style). Additionally, we follow the common code styles and best practices used in the Vue ecosystem as we strongly focussed on Vue based UI code.\n\n\u003e [!TIP]\n\u003e For backend code there is also a similar configuration for PHP code available enforcing our PHP codestyle, see [Nextcloud cs-fixer](https://github.com/nextcloud/coding-standard/).\n\n### Installation\n\n```bash\nnpm install --save-dev @nextcloud/eslint-config\n```\n\n### Usage\n\n\u003e [!NOTE]\n\u003e Since version 9 this package depends on ESLint 10, which uses the new flat config system.\n\nThis package provides some predefined configurations you can choose from.\nFor the recommended setup add a file `eslint.config.js` in the root directory of your app repository with the following content:\n\n```js\nimport { recommended } from '@nextcloud/eslint-config'\n\nexport default [\n\t...recommended,\n]\n```\n\n#### Available configurations\n\nInstead of the `recommended` configuration this package also provides some alternatives, depending on your app setup you can also choose:\n\n* `recommended`\n  * General rules including code style\n  * Support for Typescript\n  * Support for Vue **3**\n  * Support Vue files with Typescript syntax (the script within `.vue` files will be handled as Typescript).\n* `recommendedJavascript`\n  * Same as `recommended` but Vue files (the script part) will be handled as Javascript.\n* `recommendedVue2`\n  * Same as `recommended` but Vue files are considered in Vue 2 syntax.\n* `recommendedVue2Javascript`\n  * Same as `recommended` but Vue files are considered in Vue 2 syntax and the script part will be handled as Javascript instead of Typescript.\n\n##### Configurations for Nextcloud libraries\n\nFor libraries some of the presets make no sense, like checking Nextcloud deprecated API.\nBut on the otherhand some rules should be enforced, like documenting all properties.\nSo for libraries use following configurations:\n\n* `recommendedLibrary`\n* `recommendedVue2Library`\n\n#### Bundled plugins\n\nThis configuration also provides some bundled plugins with new rules, those options are already included in the recommended configurations.\n\nIt is possible to override the recommended configurations:\n```js\n// eslint.config.js\nimport { recommended } from '@nextcloud/eslint-config'\nexport default [\n\t...recommended,\n\t{\n\t\tfiles: ['**/*.js'],\n\t\trules: {\n\t\t\t// Make deprecations error instead of warning level\n\t\t\t'@nextcloud/no-deprecations': ['error'],\n\t\t}\n\t}\n]\n```\n\nYou can even use the plugins without using the Nextcloud ESLint config:\n```js\n// eslint.config.js\nimport { nextcloudPlugin } from '@nextcloud/eslint-config'\nexport default [\n\t{\n\t\tfiles: ['**/*.js'],\n\t\tplugins: {\n\t\t\t'@nextcloud': nextcloudPlugin,\n\t\t},\n\t\trules: {\n\t\t\t'@nextcloud/no-removed-apis': ['error', { targetVersion: '29.0.0' }],\n\t\t},\n\t}\n]\n```\n\n##### `package-json` plugin\nRules:\n- `sort-package-json`\n  - Ensures the `package.json` is sorted in consistent order\n  - Included as `error` level in recommended configurations\n\n##### `@nextcloud` plugin\nRules:\n- `no-deprecations`\n  - Report usage of deprecated Nextcloud API\n  - Included as `warn` level in recommended configuration\n  - Available options\n    ```ts\n    {\n      /**\n       * Limit deprecated API to specified Nextcloud version\n       * @example '29.0.0'\n       * @default ''\n       */\n      targetVersion?: string\n      /**\n       * Try to find appinfo.xml to detect targetVersion\n       * @default true\n       */\n      parseAppInfo?: boolean\n    }\n    ```\n- `no-removed-apis`\n  - Report usage of removed Nextcloud API\n  - Included as `error` level in recommended configuration\n  - Available options\n    ```ts\n    {\n      /**\n       * Limit removed API to specified Nextcloud version\n       * @example '29.0.0'\n       * @default ''\n       */\n      targetVersion?: string\n      /**\n       * Try to find appinfo.xml to detect targetVersion\n       * @default true\n       */\n      parseAppInfo?: boolean\n    }\n    ```\n\n##### `@nextcloud-l10n`\n```ts\nimport { l10nPlugin  } from '@nextcloud/eslint-config'\n```\n\nRules:\n- `enforce-ellipsis`\n  - Enforce consistent usageof ellipsis instead of tripple dots\n  - Included as `error` level in recommended configuration\n- `non-breaking-space`\n  - Enforce non-breaking spaces before ellipsis\n  - Included as `error` level in recommended configuration\n\n#### Adding custom overrides\n\nSometimes additional rules need to be added for individual projects,\nand while we do not recommend to override Nextcloud rules for code style (it should be consistent across all Nextcloud projects!),\nit is possible to add such custom rules.\n\nFor example to enforce chains to be on separate lines:\n\n```diff\n- const a = foo().then((a) =\u003e a.b).catch((e) =\u003e e.c)\n+ const a = foo()\n+ \t.then((a) =\u003e a.b)\n+ \t.catch((e) =\u003e e.c)\n```\n\nAdjust your `eslint.config.js` like this:\n\n```js\nimport { recommended } from '@nextcloud/eslint-config'\n\nexport default [\n\t...recommended,\n\t{\n\t\trules: {\n\t\t\t'@stylistic/newline-per-chained-call': ['error'],\n\t\t}\n\t},\n]\n```\n\n### Update policy\n\nWe follow semantic versioning.\n\n#### 💥 Breaking changes\n\nFor breaking changes, we consider those changes that break linting in a technical term, so linting itself is broken with the update.\nThis means, for example, require a new config format (ESLint legacy vs flat configuration). But it does not mean new errors or warnings while linting.\n\n#### ✨ Minor changes\n\nFor minor changes we consider adding new rules or adding or removing plugins.\nThis means after updating a minor version, there can be new warnings or errors when linting the same code base.\n\n#### 🐛 Patch changes\n\nFor this configuration we consider following changes fixes:\n- Adjusting rules to follow our official code style.\n- Adjusting rules if the current behavior is considered a bug.\n- Removing rules\n\n### Development\n\n#### New rules\n\nAdding new rules that enforce our code style can always be added.\nRules that are not directly covered by our code style should be discussed before.\n\nIf those rules are code style related, the matching section of the [Nextcloud developer documentation](https://github.com/nextcloud/documentation/) has to be updated to keep both in sync.\n\n#### Rule severity\n\nEither you care about a rule or you do not.\nAs such we only enforce rules that we consider either important for code quality or to have consistent code style.\nFor this reason all rules should be set to **error** severity, as all rules are considered must-follow.\n\nOf course, in some edge cases rules do not apply, in such cases the users can still opt-in to disable that rule for a line or file.\n\nTo not break projects during updates new rules with non critical impact (code style related rules)\nshould be introduced with **warn** severity and moved to severity **error** only with a new major release or after a sane timeframe for migration.\n\n#### Release new version\n\n- Pull the latest changes from `main` or `stableX`\n- Checkout a new branch with the tag name (e.g `v9.0.1`): `git checkout -b v\u003cversion\u003e`\n- Run `npm version patch --no-git-tag-version` (`npm version minor --no-git-tag-version` if minor).\n  This will return a new version name, make sure it matches what you expect\n- Generate the changelog content from the [release](https://github.com/nextcloud-libraries/eslint-config/releases) page.\n  Create a draft release, select the previous tag, click `generate` then paste the content to the `CHANGELOG.md` file\n  1. adjust the links to the merged pull requests and authors so that the changelog also works outside of GitHub\n     by running `npm run prerelease:format-changelog`.\n     This will apply this regex: `by @([^ ]+) in ((https://github.com/)nextcloud-libraries/eslint-config/pull/(\\d+))`\n     Which this as the replacement: `[\\#$4]($2) \\([$1]($3$1)\\)`\n  2. use the the version as tag AND title (e.g `v4.0.1`)\n  3. add the changelog content as description (https://github.com/nextcloud-libraries/eslint-config/releases)\n- Commit, push and create PR\n- Get your PR reviewed and merged\n- Create a milestone with the follow-up version at https://github.com/nextcloud-libraries/eslint-config/milestones\n- Move all open tickets and PRs to the follow-up\n- Close the milestone of the version you release\n- Publish the previously drafted release on GitHub\n  ![image](https://user-images.githubusercontent.com/14975046/124442568-2a952500-dd7d-11eb-82a2-402f9170231a.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud-libraries%2Feslint-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextcloud-libraries%2Feslint-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud-libraries%2Feslint-config/lists"}