npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nextcloud/eslint-plugin

v2.2.1

Published

Nextcloud lint plugin for ESLint

Downloads

28,460

Readme

@nextcloud/eslint-plugin

Nextcloud lint plugin for ESLint. This plugin provides a set of rules in order to check compliance of your app to the Nextcloud JavaScript API.

It is recommended to configure your app to use @nextcloud/eslint-config in advance. Then, this plugin is integrated automatically, but you profit also from the common Nextcloud coding standard.

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install @nextcloud/eslint-plugin:

$ npm install @nextcloud/eslint-plugin --save-dev

Usage

Add plugin:nextcloud/recommended to the extends section of your .eslintrc configuration file in order to use all recommended options (load estlint-plugin-nextcloud, add Nextcloud environment and add recommended rules):

{
    "extends": [
        "plugin:nextcloud/recommended"
    ]
}

Alternatively, you can activate only those parts that you want to use. In this case, you have to add nextcloud to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "nextcloud"
    ]
}

Add the Nextcloud environment if you want to use global variables defined by Nextcloud server.

{
    "env": {
        "nextcloud/nextcloud": true,
    }
}

Configure the rules you want to use under the rules section.

{
    "rules": {
        "nextcloud/no-deprecations": "warn",
        "nextcloud/no-removed-apis": "error",
    }
}

Limit the Nextcloud version to report

By default all removed or deprecated API is reported, but if your app targets an older version of Nextcloud then you can limit the reported issues to changes before and with that version.

For example you target Nextcloud 25 and you use OC.L10n which was deprecated with Nextcloud 26. To disable reporting that deprecation you can set the target version to 25:

{
    "rules": {
        "nextcloud/no-deprecations": ["warn", { "targetVersion": "25.0.0" }],
        "nextcloud/no-removed-apis": ["error", { "targetVersion": "25.0.0" }],
    }
}

It is also possible to detect that your supported Nextcloud version from your appinfo/info.xml (max-version of your nextcloud dependency):

{
    "rules": {
        "nextcloud/no-deprecations": ["warn", { "parseAppInfo": true }],
        "nextcloud/no-removed-apis": ["error", { "parseAppInfo": true }],
    }
}

Supported Shared Configurations

  • nextcloud/recommended: Recommended configuration that loads the Nextcloud ESlint plugin, adds the Nextcloud environment and configures all recommended Nextcloud rules.

Supported Environments

  • nextcloud/nextcloud: Manifests global variables defined by Nextcloud server

Supported Rules

  • nextcloud/no-deprecations: Detects properties and functions that were deprecated in Nextcloud server
  • nextcloud/no-removed-apis: Detects previously available APIs that were removed from Nextcloud server