From a01e6a2cc44a7106d2b967d0d413f81e93f22ea9 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 16 Feb 2025 14:17:41 +0100 Subject: [PATCH] feat: Enable Nextcloud plugin for ESLint Signed-off-by: Ferdinand Thiessen --- lib/configs/javascript.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/configs/javascript.ts b/lib/configs/javascript.ts index 8a26be60..ed517f87 100644 --- a/lib/configs/javascript.ts +++ b/lib/configs/javascript.ts @@ -7,7 +7,7 @@ import type { Linter } from 'eslint' import eslintRules from '@eslint/js' import { GLOB_FILES_JAVASCRIPT, GLOB_FILES_TESTING, GLOB_FILES_TYPESCRIPT, GLOB_FILES_VUE } from '../globs' import globals from 'globals' -// import nextcloudPlugin from '@nextcloud/eslint-plugin' +import nextcloudPlugin from '../plugins/nextcloud/index.ts' /** * This config provides the base rules for code quality, @@ -56,7 +56,22 @@ export const javascript: Linter.Config[] = [ ...eslintRules.configs.recommended, }, - // nextcloudPlugin.configs.recommended, + // The Nextcloud plugin for detecting deprecated and removed global API + { + name: 'nextcloud/javascript/plugin', + plugins: { + '@nextcloud': nextcloudPlugin, + }, + rules: { + '@nextcloud/no-deprecations': ['warn'], + '@nextcloud/no-removed-apis': ['error'], + }, + files: [ + ...GLOB_FILES_JAVASCRIPT, + ...GLOB_FILES_TYPESCRIPT, + ...GLOB_FILES_VUE, + ], + }, // Nextcloud specific overwrite {