Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cross-spawn vulnerability #1048

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions webui/configs/eslintrc.json

This file was deleted.

104 changes: 104 additions & 0 deletions webui/configs/eslintrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import react from "eslint-plugin-react";
import tsParser from "@typescript-eslint/parser";
import stylistic from '@stylistic/eslint-plugin'
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

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 [...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
), {
files: ["**/*.ts", "**/*.tsx"],
plugins: {
"@typescript-eslint": typescriptEslint,
"@stylistic": stylistic,
react,
},

languageOptions: {
parser: tsParser,
},

settings: {
react: {
version: "detect",
},
},

rules: {
"@typescript-eslint/ban-types": "off",
"@/brace-style": ["warn", "1tbs"],

"@/comma-spacing": ["warn", {
before: false,
after: true,
}],

"@/func-call-spacing": ["warn", "never"],

"@/keyword-spacing": ["warn", {
before: true,
after: true,
}],

"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off",
"@/semi": ["error", "always"],
"@stylistic/type-annotation-spacing": "warn",
"react/prop-types": "off",
"array-bracket-spacing": ["warn", "never"],

"arrow-spacing": ["warn", {
before: true,
after: true,
}],

"computed-property-spacing": ["warn", "never"],
"jsx-quotes": ["error", "prefer-single"],

"key-spacing": ["warn", {
beforeColon: false,
afterColon: true,
}],

"linebreak-style": ["warn", "unix"],
"new-parens": "error",
"no-trailing-spaces": "warn",
"no-whitespace-before-property": "warn",
"object-curly-spacing": ["warn", "always"],

"semi-spacing": ["warn", {
before: false,
after: true,
}],

"space-before-blocks": ["warn", "always"],
"space-in-parens": ["warn", "never"],
"space-infix-ops": "warn",
"space-unary-ops": "warn",

"switch-colon-spacing": ["warn", {
before: false,
after: true,
}],
},
}];
23 changes: 13 additions & 10 deletions webui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openvsx-webui",
"version": "0.13.0",
"version": "0.13.1",
"description": "User interface for Eclipse Open VSX",
"keywords": [
"react",
Expand Down Expand Up @@ -67,14 +67,17 @@
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@playwright/test": "^1.41.2",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@playwright/test": "^1.49.0",
"@stylistic/eslint-plugin": "^2.11.0",
"@types/babel__core": "^7",
"@types/chai": "^4.3.5",
"@types/dompurify": "^3.0.2",
"@types/express": "^4.17.21",
"@types/lodash": "^4.14.195",
"@types/markdown-it": "^13.0.1",
"@types/mocha": "^10.0.1",
"@types/mocha": "^10.0.9",
"@types/node": "^20.4.0",
"@types/prop-types": "^15.7.5",
"@types/punycode": "^2.1.0",
Expand All @@ -84,16 +87,16 @@
"@types/react-infinite-scroller": "^1.2.3",
"@types/react-router-dom": "^5.3.3",
"@types/react-transition-group": "^4.4.6",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"@typescript-eslint/eslint-plugin": "^8.15.0",
"@typescript-eslint/parser": "^8.15.0",
"chai": "^4.3.7",
"css-loader": "^6.8.1",
"eslint": "^8.44.0",
"eslint-plugin-react": "^7.32.2",
"eslint": "^9.15.0",
"eslint-plugin-react": "^7.37.2",
"express": "^4.21.1",
"express-rate-limit": "^7.4.0",
"mocha": "^10.2.0",
"rimraf": "^5.0.5",
"mocha": "^10.8.2",
"rimraf": "^6.0.1",
"source-map-loader": "^4.0.1",
"style-loader": "^3.3.3",
"ts-mocha": "^10.0.0",
Expand All @@ -106,7 +109,7 @@
"build": "tsc -p ./tsconfig.json && tsc -p ./configs/server.tsconfig.json && yarn run lint",
"test": "ts-mocha --project ./configs/test.tsconfig.json --config ./configs/mocharc.json",
"smoke-tests": "playwright install && playwright test --config=./configs/playwright.config.ts",
"lint": "eslint -c ./configs/eslintrc.json --ext .ts,.tsx src",
"lint": "eslint -c ./configs/eslintrc.mjs src",
"watch": "tsc -w -p ./tsconfig.json",
"prepare": "yarn run clean && yarn run build",
"build:default": "webpack --config ./configs/webpack.config.js --mode production",
Expand Down
4 changes: 1 addition & 3 deletions webui/src/components/sidepanel/sidepanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import React, { FunctionComponent, PropsWithChildren } from 'react';
import { Drawer, List } from '@mui/material';
import { Theme } from '@mui/material/styles';

export interface SidepanelProps {}

export const Sidepanel: FunctionComponent<PropsWithChildren<SidepanelProps>> = props => {
export const Sidepanel: FunctionComponent<PropsWithChildren> = props => {
return (
<Drawer
variant='permanent'
Expand Down
8 changes: 4 additions & 4 deletions webui/src/pages/user/user-settings-namespaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/

import React, { ChangeEvent, FunctionComponent, useContext, useEffect, useState, useRef } from 'react';
import React, { FunctionComponent, useContext, useEffect, useState, useRef } from 'react';
import { Box, Typography, Tabs, Tab, useTheme, useMediaQuery, Link } from '@mui/material';
import { Namespace, UserData } from '../../extension-registry-types';
import { DelayedLoadIndicator } from '../../components/delayed-load-indicator';
Expand All @@ -18,7 +18,7 @@ import { CreateNamespaceDialog } from './create-namespace-dialog';

interface NamespaceTabProps {
chosenNamespace: Namespace,
onChange: (event: ChangeEvent<{}>, value: Namespace) => void,
onChange: (value: Namespace) => void,
namespaces: Namespace[]
}

Expand All @@ -28,7 +28,7 @@ const NamespacesTabs = (props: NamespaceTabProps) => {
return <Tabs
orientation={isATablet ? 'horizontal' : 'vertical'}
value={props.chosenNamespace}
onChange={props.onChange}
onChange={(event, value) => props.onChange(value)}
variant={isATablet ? 'scrollable' : 'standard'}
scrollButtons={isATablet ? 'auto' : false}
indicatorColor='secondary'
Expand Down Expand Up @@ -69,7 +69,7 @@ export const UserSettingsNamespaces: FunctionComponent = () => {
};
}, []);

const handleChangeNamespace = (event: ChangeEvent<{}>, value: Namespace): void => {
const handleChangeNamespace = (value: Namespace): void => {
doHandleChangeNamespace(value);
};

Expand Down
1 change: 0 additions & 1 deletion webui/src/pages/user/user-settings-tokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ export const UserSettingsTokens: FunctionComponent = () => {
};

export namespace UserSettingsTokens {
export interface Props {}
export interface State {
tokens: PersonalAccessToken[];
loading: boolean;
Expand Down
Loading