mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
deps: update eslint to v9
This commit is contained in:
parent
7faa4ff99a
commit
a8b87d5f63
14 changed files with 732 additions and 384 deletions
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": [
|
||||
"./tsconfig.test.json"
|
||||
]
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"prettier"
|
||||
],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier"
|
||||
],
|
||||
"rules": {
|
||||
"prettier/prettier": ["error",
|
||||
require('./.prettierrc.json')
|
||||
]
|
||||
}
|
||||
}
|
51
commons/eslint.config.mjs
Normal file
51
commons/eslint.config.mjs
Normal file
|
@ -0,0 +1,51 @@
|
|||
import { defineConfig } from 'eslint/config'
|
||||
import typescriptEslint from '@typescript-eslint/eslint-plugin'
|
||||
import prettier from 'eslint-plugin-prettier'
|
||||
import tsParser from '@typescript-eslint/parser'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import js from '@eslint/js'
|
||||
import { FlatCompat } from '@eslint/eslintrc'
|
||||
import prettierConfig from './.prettierrc.json' with { type: 'json' }
|
||||
import vitest from '@vitest/eslint-plugin'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all,
|
||||
})
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
extends: compat.extends(
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier',
|
||||
),
|
||||
|
||||
plugins: {
|
||||
'@typescript-eslint': typescriptEslint,
|
||||
prettier,
|
||||
vitest,
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
ecmaVersion: 5,
|
||||
sourceType: 'script',
|
||||
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.test.json'],
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
'prettier/prettier': ['error', prettierConfig],
|
||||
...vitest.configs.recommended.rules,
|
||||
},
|
||||
},
|
||||
])
|
|
@ -11,7 +11,7 @@
|
|||
"test:ci": "vitest --run",
|
||||
"prepublish": "rm -rf dist && yarn lint && yarn build && yarn test",
|
||||
"lint": "eslint src --ext .ts",
|
||||
"lint:fix": "eslint --fix --ext .ts src"
|
||||
"lint:fix": "eslint src --fix --ext .ts"
|
||||
},
|
||||
"type": "module",
|
||||
"source": "src/index.ts",
|
||||
|
@ -52,16 +52,18 @@
|
|||
"zod": "3.24.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "3.3.1",
|
||||
"@eslint/js": "9.25.1",
|
||||
"@mrdrogdrog/optional": "1.2.1",
|
||||
"@types/js-yaml": "4.0.9",
|
||||
"@types/ws": "8.5.12",
|
||||
"@typescript-eslint/eslint-plugin": "8.14.0",
|
||||
"@typescript-eslint/parser": "8.14.0",
|
||||
"eslint": "8.57.1",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-plugin-prettier": "5.2.3",
|
||||
"@vitest/eslint-plugin": "1.1.43",
|
||||
"eslint": "9.25.1",
|
||||
"eslint-config-prettier": "10.1.2",
|
||||
"eslint-plugin-prettier": "5.2.6",
|
||||
"prettier": "3.3.3",
|
||||
"typescript": "5.6.3",
|
||||
"typescript-eslint": "8.31.0",
|
||||
"vitest": "3.1.2"
|
||||
},
|
||||
"packageManager": "yarn@4.5.3"
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
/**
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: CC0-1.0
|
||||
**/
|
||||
module.exports = {
|
||||
"root": true,
|
||||
"parserOptions": {
|
||||
"tsconfigRootDir": ".",
|
||||
"project": [
|
||||
"./tsconfig.json"
|
||||
]
|
||||
},
|
||||
"rules": {
|
||||
"prettier/prettier": ["error",
|
||||
require('./.prettierrc.json')
|
||||
],
|
||||
"no-use-before-define": "off",
|
||||
"no-debugger": "warn",
|
||||
"default-param-last": "off",
|
||||
"@typescript-eslint/consistent-type-imports": [
|
||||
"error",
|
||||
{
|
||||
"prefer": "type-imports",
|
||||
"disallowTypeAnnotations": false
|
||||
}
|
||||
],
|
||||
"jest/no-disabled-tests": "warn",
|
||||
"jest/no-focused-tests": "error",
|
||||
"jest/no-identical-title": "error",
|
||||
"jest/prefer-to-have-length": "warn",
|
||||
"jest/valid-expect": "error"
|
||||
},
|
||||
"env": {
|
||||
"jest": true,
|
||||
"jest/globals": true
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"testing-library",
|
||||
"jest",
|
||||
"prettier"
|
||||
],
|
||||
"extends": [
|
||||
"next/core-web-vitals",
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
||||
"prettier"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"**/__tests__/**/*.[jt]s?(x)",
|
||||
"**/?(*.)+(spec|test).[jt]s?(x)"
|
||||
],
|
||||
"extends": ["plugin:testing-library/react"]
|
||||
}
|
||||
]
|
||||
}
|
74
frontend/eslint.config.mjs
Normal file
74
frontend/eslint.config.mjs
Normal file
|
@ -0,0 +1,74 @@
|
|||
import { defineConfig } from "eslint/config";
|
||||
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
||||
import testingLibrary from "eslint-plugin-testing-library";
|
||||
import jest from "eslint-plugin-jest";
|
||||
import prettier from "eslint-plugin-prettier";
|
||||
import globals from "globals";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import js from "@eslint/js";
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
import prettierConfig from "./.prettierrc.json" with {type: "json"}
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all
|
||||
});
|
||||
|
||||
export default defineConfig([{
|
||||
extends: compat.extends(
|
||||
"next/core-web-vitals",
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
||||
"prettier",
|
||||
),
|
||||
|
||||
plugins: {
|
||||
"@typescript-eslint": typescriptEslint,
|
||||
"testing-library": testingLibrary,
|
||||
jest,
|
||||
prettier,
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.jest,
|
||||
...jest.environments.globals.globals,
|
||||
},
|
||||
|
||||
ecmaVersion: 5,
|
||||
sourceType: "script",
|
||||
|
||||
parserOptions: {
|
||||
tsconfigRootDir: ".",
|
||||
project: ["./tsconfig.json"],
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
"prettier/prettier": ["error", prettierConfig],
|
||||
|
||||
"no-use-before-define": "off",
|
||||
"no-debugger": "warn",
|
||||
"default-param-last": "off",
|
||||
|
||||
"@typescript-eslint/consistent-type-imports": ["error", {
|
||||
prefer: "type-imports",
|
||||
disallowTypeAnnotations: false,
|
||||
}],
|
||||
|
||||
"jest/no-disabled-tests": "warn",
|
||||
"jest/no-focused-tests": "error",
|
||||
"jest/no-identical-title": "error",
|
||||
"jest/prefer-to-have-length": "warn",
|
||||
"jest/valid-expect": "error",
|
||||
},
|
||||
}, {
|
||||
files: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"],
|
||||
extends: compat.extends("plugin:testing-library/react"),
|
||||
}]);
|
|
@ -119,6 +119,8 @@
|
|||
"yjs": "13.6.23"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "3.3.1",
|
||||
"@eslint/js": "9.25.1",
|
||||
"@next/bundle-analyzer": "15.3.1",
|
||||
"@testing-library/cypress": "10.0.3",
|
||||
"@testing-library/dom": "10.4.0",
|
||||
|
@ -139,23 +141,21 @@
|
|||
"@types/react": "19.1.2",
|
||||
"@types/react-dom": "19.1.2",
|
||||
"@types/ws": "8.5.12",
|
||||
"@typescript-eslint/eslint-plugin": "8.14.0",
|
||||
"@typescript-eslint/parser": "8.14.0",
|
||||
"csstype": "3.1.3",
|
||||
"cypress": "13.17.0",
|
||||
"cypress-commands": "3.0.0",
|
||||
"cypress-fill-command": "1.0.2",
|
||||
"dotenv-cli": "7.4.4",
|
||||
"eslint": "8.57.1",
|
||||
"eslint": "9.25.1",
|
||||
"eslint-config-next": "15.3.1",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-config-prettier": "10.1.2",
|
||||
"eslint-plugin-chai-friendly": "1.0.1",
|
||||
"eslint-plugin-cypress": "4.1.0",
|
||||
"eslint-plugin-jest": "28.9.0",
|
||||
"eslint-plugin-n": "17.13.2",
|
||||
"eslint-plugin-prettier": "5.2.3",
|
||||
"eslint-plugin-promise": "7.1.0",
|
||||
"eslint-plugin-testing-library": "6.4.0",
|
||||
"eslint-plugin-cypress": "4.3.0",
|
||||
"eslint-plugin-jest": "28.11.0",
|
||||
"eslint-plugin-n": "17.17.0",
|
||||
"eslint-plugin-prettier": "5.2.6",
|
||||
"eslint-plugin-promise": "7.2.1",
|
||||
"eslint-plugin-testing-library": "7.1.1",
|
||||
"jest": "29.7.0",
|
||||
"jest-environment-jsdom": "29.7.0",
|
||||
"prettier": "3.3.3",
|
||||
|
@ -164,6 +164,7 @@
|
|||
"ts-mockery": "1.2.0",
|
||||
"ts-node": "11.0.0-beta.1",
|
||||
"typescript": "5.6.3",
|
||||
"typescript-eslint": "8.31.0",
|
||||
"user-agent-data-types": "0.4.2"
|
||||
},
|
||||
"packageManager": "yarn@4.5.3",
|
||||
|
|
|
@ -22,7 +22,6 @@ export class AnchorNodePreprocessor extends TravelerNodeProcessor {
|
|||
|
||||
const url = node.attribs.href.trim()
|
||||
|
||||
// eslint-disable-next-line no-script-url
|
||||
if (url.startsWith('data:') || url.startsWith('javascript:') || url.startsWith('vbscript:')) {
|
||||
delete node.attribs.href
|
||||
return
|
||||
|
|
|
@ -9,8 +9,6 @@ import React, { useCallback } from 'react'
|
|||
import { Vimeo as IconVimeo } from 'react-bootstrap-icons'
|
||||
|
||||
interface VimeoApiResponse {
|
||||
// Vimeo uses strange names for their fields. ESLint doesn't like that.
|
||||
// eslint-disable-next-line camelcase
|
||||
thumbnail_large?: string
|
||||
}
|
||||
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": [
|
||||
"./tsconfig.test.json"
|
||||
]
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"prettier"
|
||||
],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier"
|
||||
],
|
||||
"rules": {
|
||||
"prettier/prettier": ["error",
|
||||
require('./.prettierrc.json')
|
||||
],
|
||||
}
|
||||
}
|
52
html-to-react/eslint.config.mjs
Normal file
52
html-to-react/eslint.config.mjs
Normal file
|
@ -0,0 +1,52 @@
|
|||
import { defineConfig } from 'eslint/config'
|
||||
import typescriptEslint from '@typescript-eslint/eslint-plugin'
|
||||
import prettier from 'eslint-plugin-prettier'
|
||||
import tsParser from '@typescript-eslint/parser'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import js from '@eslint/js'
|
||||
import { FlatCompat } from '@eslint/eslintrc'
|
||||
import prettierConfig from './.prettierrc.json' with { type: 'json' }
|
||||
import vitest from '@vitest/eslint-plugin'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all
|
||||
})
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
extends: compat.extends(
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier'
|
||||
),
|
||||
|
||||
plugins: {
|
||||
'@typescript-eslint': typescriptEslint,
|
||||
prettier,
|
||||
vitest
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
ecmaVersion: 5,
|
||||
sourceType: 'script',
|
||||
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.test.json']
|
||||
}
|
||||
},
|
||||
|
||||
rules: {
|
||||
'prettier/prettier': ['error', prettierConfig],
|
||||
|
||||
...vitest.configs.recommended.rules
|
||||
}
|
||||
}
|
||||
])
|
|
@ -50,15 +50,15 @@
|
|||
"devDependencies": {
|
||||
"@types/react": "18.3.11",
|
||||
"@types/react-dom": "18.3.1",
|
||||
"@typescript-eslint/eslint-plugin": "8.14.0",
|
||||
"@typescript-eslint/parser": "8.14.0",
|
||||
"eslint": "8.57.1",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-plugin-prettier": "5.2.3",
|
||||
"@vitest/eslint-plugin": "1.1.43",
|
||||
"eslint": "9.25.1",
|
||||
"eslint-config-prettier": "10.1.2",
|
||||
"eslint-plugin-prettier": "5.2.6",
|
||||
"prettier": "3.3.3",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"typescript": "5.6.3",
|
||||
"typescript-eslint": "8.31.0",
|
||||
"vitest": "3.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
51
markdown-it-plugins/eslint.config.mjs
Normal file
51
markdown-it-plugins/eslint.config.mjs
Normal file
|
@ -0,0 +1,51 @@
|
|||
import { defineConfig } from 'eslint/config'
|
||||
import typescriptEslint from '@typescript-eslint/eslint-plugin'
|
||||
import prettier from 'eslint-plugin-prettier'
|
||||
import tsParser from '@typescript-eslint/parser'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import js from '@eslint/js'
|
||||
import { FlatCompat } from '@eslint/eslintrc'
|
||||
import prettierConfig from './.prettierrc.json' with { type: 'json' }
|
||||
import vitest from '@vitest/eslint-plugin'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all
|
||||
})
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
extends: compat.extends(
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier'
|
||||
),
|
||||
|
||||
plugins: {
|
||||
'@typescript-eslint': typescriptEslint,
|
||||
prettier,
|
||||
vitest
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
ecmaVersion: 5,
|
||||
sourceType: 'script',
|
||||
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.test.json']
|
||||
}
|
||||
},
|
||||
|
||||
rules: {
|
||||
'prettier/prettier': ['error', prettierConfig],
|
||||
...vitest.configs.recommended.rules
|
||||
}
|
||||
}
|
||||
])
|
|
@ -90,7 +90,7 @@
|
|||
"test:ci": "vitest --run",
|
||||
"prepublish": "rm -rf dist && yarn lint && yarn build && yarn test",
|
||||
"lint": "eslint src --ext .ts",
|
||||
"lint:fix": "eslint --fix --ext .ts src"
|
||||
"lint:fix": "eslint src --ext .ts --fix"
|
||||
},
|
||||
"keywords": [
|
||||
"markdown",
|
||||
|
@ -108,15 +108,16 @@
|
|||
"html-entities": "2.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "3.3.1",
|
||||
"@eslint/js": "9.25.1",
|
||||
"@types/markdown-it": "13.0.8",
|
||||
"@typescript-eslint/eslint-plugin": "8.14.0",
|
||||
"@typescript-eslint/parser": "8.14.0",
|
||||
"eslint": "8.57.1",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-plugin-prettier": "5.2.3",
|
||||
"@vitest/eslint-plugin": "1.1.43",
|
||||
"eslint-config-prettier": "10.1.2",
|
||||
"eslint-plugin-prettier": "5.2.6",
|
||||
"markdown-it": "13.0.2",
|
||||
"prettier": "3.3.3",
|
||||
"typescript": "5.6.3",
|
||||
"typescript-eslint": "8.31.0",
|
||||
"vitest": "3.1.2"
|
||||
},
|
||||
"repository": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue