mirror of
https://github.com/cockpit-project/cockpit.git
synced 2026-11-03 21:49:50 -09:00
The PackageKit UpdateDetail signal provides markdown in the `update_text` and uses remarkable to parse the markdown contents. Remarkable however has not been updated since 6 years, additionally it requires us to use `dangerouslySetInnerHTML` which can lead to XSS issues. The npm ecosystem has two other markdown alternatives `react-markdown` and a `markdown-to-jsx`. The latter has zero dependencies while `react-markdown` has eleven and requires additional plugins like `rehype-external-links` to add a rel/target to external links. https://www.freedesktop.org/software/PackageKit/gtk-doc/Transaction.html https://github.com/jonschlinkert/remarkable/issues/438
103 lines
3.3 KiB
JSON
103 lines
3.3 KiB
JSON
{
|
|
"root": true,
|
|
"env": {
|
|
"browser": true,
|
|
"es2022": true
|
|
},
|
|
"extends": [
|
|
"eslint:recommended", "standard", "standard-jsx", "standard-react",
|
|
"plugin:jsx-a11y/recommended"
|
|
],
|
|
"parserOptions": {
|
|
"ecmaVersion": "2022"
|
|
},
|
|
"plugins": ["react", "react-hooks"],
|
|
"rules": {
|
|
"indent": ["error", 4,
|
|
{
|
|
"ObjectExpression": "first",
|
|
"CallExpression": {"arguments": "first"},
|
|
"MemberExpression": 2,
|
|
"ignoredNodes": [ "JSXAttribute" ]
|
|
}],
|
|
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 3 }],
|
|
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
|
|
"prefer-promise-reject-errors": ["error", { "allowEmptyReject": true }],
|
|
"no-var": "error",
|
|
"react/jsx-indent": ["error", 4],
|
|
"react/no-danger": "error",
|
|
"semi": ["error", "always", { "omitLastInOneLineBlock": true }],
|
|
|
|
"react-hooks/rules-of-hooks": "error",
|
|
"react-hooks/exhaustive-deps": "error",
|
|
|
|
"camelcase": "off",
|
|
"comma-dangle": "off",
|
|
"curly": "off",
|
|
"no-template-curly-in-string": "off",
|
|
"jsx-quotes": "off",
|
|
"no-console": "off",
|
|
"quotes": "off",
|
|
"react/jsx-curly-spacing": "off",
|
|
"react/jsx-indent-props": "off",
|
|
"react/jsx-handler-names": "off",
|
|
"react/jsx-closing-bracket-location": "off",
|
|
"react/jsx-closing-tag-location": "off",
|
|
"react/jsx-curly-newline": "off",
|
|
"react/jsx-first-prop-new-line": "off",
|
|
"react/jsx-no-useless-fragment": "error",
|
|
"react/prop-types": "off",
|
|
"space-before-function-paren": "off",
|
|
"standard/no-callback-literal": "off",
|
|
|
|
"eqeqeq": "off",
|
|
"react/jsx-no-bind": "off",
|
|
"react/jsx-wrap-multilines": "off"
|
|
},
|
|
"globals": {
|
|
"require": "readonly",
|
|
"module": "readonly"
|
|
},
|
|
"overrides": [
|
|
{
|
|
"files": ["**/*.ts", "**/*.tsx"],
|
|
"plugins": [
|
|
"@typescript-eslint"
|
|
],
|
|
"extends": "plugin:@typescript-eslint/recommended",
|
|
"parser": "@typescript-eslint/parser",
|
|
"parserOptions": {
|
|
"projectService": ["./tsconfig.json"]
|
|
},
|
|
"rules": {
|
|
// https://typescript-eslint.io/rules/no-use-before-define
|
|
// Note: you must disable the base rule as it can report incorrect errors
|
|
"no-use-before-define": "off",
|
|
"@typescript-eslint/no-use-before-define": [
|
|
"error",
|
|
{
|
|
"functions": false
|
|
}
|
|
],
|
|
// as recommended by https://typescript-eslint.io/rules/no-unused-vars/
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error",
|
|
{
|
|
"args": "all",
|
|
"argsIgnorePattern": "^_",
|
|
"caughtErrors": "all",
|
|
"caughtErrorsIgnorePattern": "^_",
|
|
"destructuredArrayIgnorePattern": "^_",
|
|
"varsIgnorePattern": "^_",
|
|
"ignoreRestSiblings": true
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"settings": {
|
|
"react": {
|
|
"version": "detect"
|
|
}
|
|
}
|
|
}
|