mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
chore: adjust ESLint for Cypress
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
b12df40388
commit
6f355dea7e
1 changed files with 58 additions and 15 deletions
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
import { includeIgnoreFile } from '@eslint/compat'
|
||||
import { recommendedVue2 } from '@nextcloud/eslint-config'
|
||||
import CypressEslint from 'eslint-plugin-cypress'
|
||||
import { defineConfig } from 'eslint/config'
|
||||
import * as globals from 'globals'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
|
@ -12,30 +13,72 @@ import { fileURLToPath } from 'node:url'
|
|||
const gitignorePath = fileURLToPath(new URL('.gitignore', import.meta.url))
|
||||
|
||||
export default defineConfig([
|
||||
...recommendedVue2,
|
||||
includeIgnoreFile(gitignorePath, 'Imported .gitignore patterns'),
|
||||
{
|
||||
ignores: [
|
||||
'3rdparty/', // PHP tests
|
||||
'tests/', // PHP tests
|
||||
'**/l10n/', // all translations (config only ignored in root)
|
||||
],
|
||||
},
|
||||
{
|
||||
files: ['cypress/**'],
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
linterOptions: {
|
||||
reportUnusedDisableDirectives: 'error',
|
||||
reportUnusedInlineConfigs: 'error',
|
||||
},
|
||||
},
|
||||
// scripts are cjs
|
||||
|
||||
...recommendedVue2,
|
||||
|
||||
// respect .gitignore
|
||||
includeIgnoreFile(gitignorePath, 'Imported .gitignore patterns'),
|
||||
|
||||
{
|
||||
files: ['*.js', 'build/**/*.js'],
|
||||
name: 'server/custom-webpack-globals',
|
||||
files: ['**/*.js', '**/*.ts', '**/*.vue'],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
PRODUCTION: 'readonly',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: 'server/scripts-are-cjs',
|
||||
files: [
|
||||
'*.js',
|
||||
'build/**/*.js',
|
||||
'**/core/src/icons.cjs',
|
||||
],
|
||||
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.es2023,
|
||||
...globals.node,
|
||||
...globals.nodeBuiltin,
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
'jsdoc/require-jsdoc': 'off',
|
||||
},
|
||||
},
|
||||
// Cypress setup
|
||||
CypressEslint.configs.recommended,
|
||||
{
|
||||
name: 'server/cypress',
|
||||
files: ['cypress/**', '**/*.cy.*'],
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
'jsdoc/require-jsdoc': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-unused-expressions': 'off',
|
||||
},
|
||||
},
|
||||
// customer server ignore files
|
||||
{
|
||||
name: 'server/ignored-files',
|
||||
ignores: [
|
||||
'.devcontainer/',
|
||||
'composer.json',
|
||||
'**/*.php',
|
||||
'3rdparty/',
|
||||
'tests/', // PHP tests
|
||||
'**/js/',
|
||||
'**/l10n/', // all translations (config only ignored in root)
|
||||
'**/vendor/', // different vendors
|
||||
],
|
||||
},
|
||||
])
|
||||
|
|
|
|||
Loading…
Reference in a new issue