From 3c1e9cd99e1a3599fc4e5ffaec950bf8508bb595 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 19 Oct 2025 18:46:19 +0200 Subject: [PATCH] chore: adjust linter configs for new layout Signed-off-by: Ferdinand Thiessen --- build/files-checker.php | 2 +- eslint.config.mjs => eslint.config.js | 7 ++- stylelint.config.js | 75 ++++++++++++--------------- 3 files changed, 38 insertions(+), 46 deletions(-) rename eslint.config.mjs => eslint.config.js (94%) diff --git a/build/files-checker.php b/build/files-checker.php index f2fed4d6d63..4f8d471078b 100644 --- a/build/files-checker.php +++ b/build/files-checker.php @@ -58,7 +58,7 @@ $expectedFiles = [ 'cypress.config.ts', 'cypress', 'dist', - 'eslint.config.mjs', + 'eslint.config.js', 'flake.lock', 'flake.nix', 'index.html', diff --git a/eslint.config.mjs b/eslint.config.js similarity index 94% rename from eslint.config.mjs rename to eslint.config.js index 50a2366b281..ab6b15b6053 100644 --- a/eslint.config.mjs +++ b/eslint.config.js @@ -4,7 +4,7 @@ */ import { includeIgnoreFile } from '@eslint/compat' -import { recommendedVue2 } from '@nextcloud/eslint-config' +import { recommended } from '@nextcloud/eslint-config' import CypressEslint from 'eslint-plugin-cypress' import noOnlyTests from 'eslint-plugin-no-only-tests' import { defineConfig } from 'eslint/config' @@ -21,7 +21,7 @@ export default defineConfig([ }, }, - ...recommendedVue2, + ...recommended, // add globals configuration for Webpack injected variables { @@ -39,8 +39,7 @@ export default defineConfig([ name: 'server/scripts-are-cjs', files: [ '*.js', - 'build/**/*.js', - '**/core/src/icons.cjs', + 'build/*.js', ], languageOptions: { diff --git a/stylelint.config.js b/stylelint.config.js index 56c5369ffaa..9fdc18e7904 100644 --- a/stylelint.config.js +++ b/stylelint.config.js @@ -3,45 +3,38 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -/** @type {import('stylelint').Config} */ -const config = { - extends: '@nextcloud/stylelint-config', - plugins: ['stylelint-use-logical'], - rules: { - 'csstools/use-logical': ['always', - { - except: [ - // For now ignore block rules for logical properties - /(^|-)(height|width)$/, - /(^|-)(top|bottom)(-|$)/, - // Also ignore float as this is not well supported (I look at you Samsung) - 'clear', - 'float', - ], - }], - }, - overrides: [ - { - files: ['**/*.vue'], - // Override the nextcloud rules to also allow :global (we should put this into the config...) - rules: { - 'selector-pseudo-element-no-unknown': [ - true, - { - // Vue deep and global pseudo-element - ignorePseudoElements: ['deep', 'global'], - }, - ], - 'selector-pseudo-class-no-unknown': [ - true, - { - // vue deep and global pseudo-class - ignorePseudoClasses: ['deep', 'global'], - }, - ], - }, - }, - ], -} +const additionalPseudoSelectors = [ + // Vue