mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
chore(dev-deps): use ESLint v9
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
c267036030
commit
1d580e886f
6 changed files with 691 additions and 1877 deletions
|
|
@ -1,14 +0,0 @@
|
|||
# SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# Ignoring folders for eslint
|
||||
node_modules/
|
||||
3rdparty/
|
||||
**/vendor/
|
||||
**/l10n/
|
||||
**/js/*
|
||||
*.config.js
|
||||
tests/lib/
|
||||
apps-extra
|
||||
|
||||
# TODO: remove when comments files is not using handlebar templates anymore
|
||||
apps/comments/src/templates.js
|
||||
62
.eslintrc.js
62
.eslintrc.js
|
|
@ -1,62 +0,0 @@
|
|||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
module.exports = {
|
||||
globals: {
|
||||
__webpack_nonce__: true,
|
||||
_: true,
|
||||
$: true,
|
||||
dayNames: true,
|
||||
escapeHTML: true,
|
||||
firstDay: true,
|
||||
moment: true,
|
||||
oc_userconfig: true,
|
||||
sinon: true,
|
||||
},
|
||||
plugins: [
|
||||
'cypress',
|
||||
],
|
||||
extends: [
|
||||
'@nextcloud/eslint-config/typescript',
|
||||
'plugin:cypress/recommended',
|
||||
],
|
||||
rules: {
|
||||
'comma-dangle': 'error',
|
||||
'no-tabs': 'warn',
|
||||
// TODO: make sure we fix this as this is bad vue coding style.
|
||||
// Use proper sync modifier
|
||||
'vue/no-mutating-props': 'warn',
|
||||
'vue/custom-event-name-casing': ['error', 'kebab-case', {
|
||||
// allows custom xxxx:xxx events formats
|
||||
ignores: ['/^[a-z]+(?:-[a-z]+)*:[a-z]+(?:-[a-z]+)*$/u'],
|
||||
}],
|
||||
'vue/html-self-closing': 'error',
|
||||
'jsdoc/require-jsdoc': 'off',
|
||||
'jsdoc/require-param-description': 'off',
|
||||
},
|
||||
settings: {
|
||||
jsdoc: {
|
||||
mode: 'typescript',
|
||||
},
|
||||
'import/resolver': {
|
||||
typescript: {}, // this loads <rootdir>/tsconfig.json to eslint
|
||||
},
|
||||
},
|
||||
overrides: [
|
||||
// Allow any in tests
|
||||
{
|
||||
files: ['**/*.spec.ts'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'warn',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['*.vue'],
|
||||
rules: {
|
||||
'no-irregular-whitespace': 'off',
|
||||
'vue/no-irregular-whitespace': 'error',
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
@ -12,8 +12,6 @@ $expectedFiles = [
|
|||
'.devcontainer',
|
||||
'.editorconfig',
|
||||
'.envrc',
|
||||
'.eslintignore',
|
||||
'.eslintrc.js',
|
||||
'.git',
|
||||
'.git-blame-ignore-revs',
|
||||
'.gitattributes',
|
||||
|
|
@ -62,6 +60,7 @@ $expectedFiles = [
|
|||
'cypress.d.ts',
|
||||
'cypress',
|
||||
'dist',
|
||||
'eslint.config.mjs',
|
||||
'flake.lock',
|
||||
'flake.nix',
|
||||
'index.html',
|
||||
|
|
@ -89,9 +88,9 @@ $expectedFiles = [
|
|||
'vendor-bin',
|
||||
'version.php',
|
||||
'vitest.config.mts',
|
||||
'webpack.common.js',
|
||||
'webpack.common.cjs',
|
||||
'webpack.config.js',
|
||||
'webpack.modules.js',
|
||||
'webpack.modules.cjs',
|
||||
'window.d.ts',
|
||||
];
|
||||
$actualFiles = [];
|
||||
|
|
|
|||
41
eslint.config.mjs
Normal file
41
eslint.config.mjs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { includeIgnoreFile } from "@eslint/compat";
|
||||
import { recommendedVue2 } from '@nextcloud/eslint-config'
|
||||
import { defineConfig } from 'eslint/config'
|
||||
import { fileURLToPath } from "node:url";
|
||||
import * as globals from 'globals'
|
||||
|
||||
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',
|
||||
},
|
||||
},
|
||||
// scripts are cjs
|
||||
{
|
||||
files: ['*.js', 'build/**/*.js'],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.es2023,
|
||||
...globals.node,
|
||||
...globals.nodeBuiltin,
|
||||
},
|
||||
}
|
||||
},
|
||||
])
|
||||
2434
package-lock.json
generated
2434
package-lock.json
generated
File diff suppressed because it is too large
Load diff
10
package.json
10
package.json
|
|
@ -13,8 +13,8 @@
|
|||
"postbuild": "build/npm-post-build.sh",
|
||||
"dev": "webpack --node-env development --progress",
|
||||
"watch": "webpack --node-env development --progress --watch",
|
||||
"lint": "eslint $(for appdir in $(ls apps); do if ! $(git check-ignore -q \"apps/$appdir\"); then printf \"apps/$appdir \"; fi; done) core --no-error-on-unmatched-pattern",
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"lint": "eslint",
|
||||
"lint:fix": "eslint --fix",
|
||||
"stylelint": "stylelint $(for appdir in $(ls apps); do if ! $(git check-ignore -q \"apps/$appdir\"); then printf \"'apps/$appdir/**/*.{scss,vue}' \"; fi; done) 'core/**/*.{scss,vue}'",
|
||||
"stylelint:fix": "npm run stylelint -- --fix",
|
||||
"test": "vitest run",
|
||||
|
|
@ -127,7 +127,7 @@
|
|||
"@cypress/webpack-preprocessor": "^7.0.0",
|
||||
"@nextcloud/babel-config": "^1.2.0",
|
||||
"@nextcloud/cypress": "^1.0.0-beta.15",
|
||||
"@nextcloud/eslint-config": "^8.4.2",
|
||||
"@nextcloud/eslint-config": "^9.0.0-rc.5",
|
||||
"@nextcloud/stylelint-config": "^3.1.0",
|
||||
"@nextcloud/typings": "^1.9.1",
|
||||
"@nextcloud/webpack-vue-config": "^6.3.0",
|
||||
|
|
@ -153,8 +153,8 @@
|
|||
"cypress-split": "^1.24.23",
|
||||
"cypress-wait-until": "^3.0.2",
|
||||
"dockerode": "^4.0.8",
|
||||
"eslint-plugin-cypress": "^3.6.0",
|
||||
"eslint-plugin-es": "^4.1.0",
|
||||
"eslint": "^9.36.0",
|
||||
"eslint-plugin-cypress": "^5.1.1",
|
||||
"exports-loader": "^5.0.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"handlebars-loader": "^1.7.3",
|
||||
|
|
|
|||
Loading…
Reference in a new issue