66import { includeIgnoreFile } from '@eslint/compat'
77import { recommendedVue2 } from '@nextcloud/eslint-config'
88import CypressEslint from 'eslint-plugin-cypress'
9+ import noOnlyTests from 'eslint-plugin-no-only-tests'
910import { defineConfig } from 'eslint/config'
1011import * as globals from 'globals'
1112import { fileURLToPath } from 'node:url'
@@ -22,9 +23,7 @@ export default defineConfig([
2223
2324 ...recommendedVue2 ,
2425
25- // respect .gitignore
26- includeIgnoreFile ( gitignorePath , 'Imported .gitignore patterns' ) ,
27-
26+ // add globals configuration for Webpack injected variables
2827 {
2928 name : 'server/custom-webpack-globals' ,
3029 files : [ '**/*.js' , '**/*.ts' , '**/*.vue' ] ,
@@ -35,6 +34,7 @@ export default defineConfig([
3534 } ,
3635 } ,
3736
37+ // Ensure that cjs files are treated as Node scripts
3838 {
3939 name : 'server/scripts-are-cjs' ,
4040 files : [
@@ -55,6 +55,7 @@ export default defineConfig([
5555 'jsdoc/require-jsdoc' : 'off' ,
5656 } ,
5757 } ,
58+
5859 // Cypress setup
5960 {
6061 ...CypressEslint . configs . recommended ,
@@ -72,7 +73,23 @@ export default defineConfig([
7273 '@typescript-eslint/no-unused-expressions' : 'off' ,
7374 } ,
7475 } ,
75- // customer server ignore files
76+
77+ // Forbid commiting .only in test files (skipping tests is very unexpected)
78+ {
79+ name : 'server/no-only-in-tests' ,
80+ files : [ 'cypress/**' , 'apps/**/*.spec.*' , 'core/**/*.spec.*' ] ,
81+ plugins : {
82+ 'no-only-tests' : noOnlyTests ,
83+ } ,
84+ rules : {
85+ 'no-only-tests/no-only-tests' : 'error' ,
86+ } ,
87+ } ,
88+
89+ // respect .gitignore
90+ includeIgnoreFile ( gitignorePath , 'Imported .gitignore patterns' ) ,
91+
92+ // custom server ignore files
7693 {
7794 name : 'server/ignored-files' ,
7895 ignores : [
0 commit comments