Skip to content

Commit

Permalink
fix(deps): Update eslint to v9
Browse files Browse the repository at this point in the history
  • Loading branch information
lordrip committed Sep 9, 2024
1 parent 54601a4 commit 7c05d20
Show file tree
Hide file tree
Showing 24 changed files with 595 additions and 512 deletions.
17 changes: 0 additions & 17 deletions .eslintrc.cjs

This file was deleted.

21 changes: 21 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// @ts-check
import pluginJs from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginPrettier from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default [
{ files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
},
},
eslintConfigPrettier,
eslintPluginPrettier,
];
4 changes: 4 additions & 0 deletions packages/camel-catalog/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// @ts-check
import rootConfig from '../../eslint.config.mjs';

export default [...rootConfig];
12 changes: 7 additions & 5 deletions packages/camel-catalog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@
"clean": "yarn rimraf ./dist"
},
"devDependencies": {
"@eslint/js": "^9.10.0",
"@types/eslint__js": "^8.42.3",
"@types/node": "^20.0.0",
"eslint": "^8.45.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint": "^9.10.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"json-schema-to-typescript": "^15.0.0",
"prettier": "^3.0.0",
"rimraf": "^6.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.4.2"
"typescript": "^5.4.2",
"typescript-eslint": "^8.5.0"
}
}
1 change: 0 additions & 1 deletion packages/camel-catalog/src/json-schema-to-typescript.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env ts-node
/* eslint-disable @typescript-eslint/no-var-requires */

/**
* This script generates TypeScript types from the JSON schemas in the dist folder.
Expand Down
4 changes: 4 additions & 0 deletions packages/catalog-generator/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// @ts-check
import rootConfig from '../../eslint.config.mjs';

export default [...rootConfig];
12 changes: 7 additions & 5 deletions packages/catalog-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@
"clean": "yarn rimraf ./dist"
},
"devDependencies": {
"@eslint/js": "^9.10.0",
"@types/eslint__js": "^8.42.3",
"@types/node": "^20.0.0",
"eslint": "^8.45.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint": "^9.10.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"json-schema-to-typescript": "^15.0.0",
"prettier": "^3.0.0",
"rimraf": "^6.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.4.2"
"typescript": "^5.4.2",
"typescript-eslint": "^8.5.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env ts-node
/* eslint-disable @typescript-eslint/no-var-requires */

/**
* This script generates TypeScript types from the JSON schemas in the dist folder.
Expand Down
23 changes: 23 additions & 0 deletions packages/ui-tests/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// @ts-check
import pluginReact from 'eslint-plugin-react';
import pluginReactHooks from 'eslint-plugin-react-hooks';
import rootConfig from '../../eslint.config.mjs';

export default [
...rootConfig,
{
plugins: {
...pluginReact.configs.flat.recommended.plugins,
'react-hooks': pluginReactHooks,
},
},
{
rules: {
...pluginReact.configs.flat.recommended.rules,
...pluginReactHooks.configs.recommended.rules,
'react/react-in-jsx-scope': 'off',
'react/display-name': 'off',
'react/prop-types': 'off',
},
},
];
14 changes: 6 additions & 8 deletions packages/ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"chromatic": "chromatic --build-script-name 'build:storybook' --exit-zero-on-changes --project-token=chpt_7a4940aa65b14ab"
},
"devDependencies": {
"@eslint/js": "^9.10.0",
"@kaoto/kaoto": "workspace:*",
"@storybook/addon-essentials": "^8.2.8",
"@storybook/addon-interactions": "^8.2.8",
Expand All @@ -36,17 +37,13 @@
"@storybook/react-vite": "^8.2.8",
"@storybook/testing-library": "^0.2.2",
"@storybook/theming": "^8.2.8",
"@types/eslint__js": "^8.42.3",
"chromatic": "^11.0.0",
"cypress": "^13.11.0",
"cypress-file-upload": "^5.0.8",
"eslint": "^8.45.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"eslint-plugin-storybook": "^0.8.0",
"eslint": "^9.10.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"msw": "^2.0.2",
"msw-storybook-addon": "^2.0.3",
"prettier": "^3.0.0",
Expand All @@ -57,6 +54,7 @@
"storybook-addon-remix-react-router": "^3.0.0",
"storybook-fixtures": "0.12.0",
"typescript": "^5.4.2",
"typescript-eslint": "^8.5.0",
"vite": "^5.4.0"
},
"dependencies": {
Expand Down
23 changes: 23 additions & 0 deletions packages/ui/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// @ts-check
import pluginReact from 'eslint-plugin-react';
import pluginReactHooks from 'eslint-plugin-react-hooks';
import rootConfig from '../../eslint.config.mjs';

export default [
...rootConfig,
{
plugins: {
...pluginReact.configs.flat.recommended.plugins,
'react-hooks': pluginReactHooks,
},
},
{
rules: {
...pluginReact.configs.flat.recommended.rules,
...pluginReactHooks.configs.recommended.rules,
'react/react-in-jsx-scope': 'off',
'react/display-name': 'off',
'react/prop-types': 'off',
},
},
];
19 changes: 10 additions & 9 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"@babel/preset-env": "^7.21.5",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.5",
"@eslint/js": "^9.10.0",
"@kaoto/camel-catalog": "workspace:*",
"@patternfly/patternfly": "5.4.0",
"@patternfly/react-code-editor": "5.4.0",
Expand All @@ -104,6 +105,7 @@
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/eslint__js": "^8.42.3",
"@types/jest": "^29.4.0",
"@types/json-schema": "^7.0.15",
"@types/lodash.clonedeep": "^4.5.7",
Expand All @@ -114,22 +116,20 @@
"@types/node": "^20.0.0",
"@types/react": "^18.2.25",
"@types/react-dom": "^18.2.10",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"@vitejs/plugin-react": "^4.0.3",
"babel-jest": "^29.4.2",
"copyfiles": "^2.4.1",
"eslint": "^8.45.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"eslint": "^9.10.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.35.2",
"eslint-plugin-react-hooks": "5.1.0-rc-eb3ad065-20240822",
"globals": "^15.9.0",
"jest": "^29.7.0",
"jest-canvas-mock": "^2.5.2",
"jest-environment-jsdom": "^29.4.2",
"monaco-yaml": "^5.1.1",
"postcss": "^8.4.45",
"prettier": "^3.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -143,6 +143,7 @@
"stylelint-prettier": "^5.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.4.2",
"typescript-eslint": "^8.5.0",
"vite": "^5.4.0",
"vite-plugin-dts": "^4.0.2",
"vite-plugin-static-copy": "^1.0.6"
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/components/ErrorBoundary/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { ExpandableSection } from '@patternfly/react-core';
import { Component, ReactNode } from 'react';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const PropertiesModal: FunctionComponent<IPropertiesModalProps> = (props)
default:
throw Error('Unknown CatalogKind during rendering modal: ' + props.tile.type);
}
}, [props.tile]);
}, [catalogService, props.tile.name, props.tile.type]);
const [activeTabKey, setActiveTabKey] = useState<number>(0);
const [activeTab, setActiveTab] = useState<IPropertiesTab>(tabs[0]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const CanvasSideBar: FunctionComponent<CanvasSideBarProps> = (props) => {
* and doesn't take into account the sidebar children.
*/
<TopologySideBar resizable>
<ErrorBoundary key={props.selectedNode.id} fallback={<p>Something didn't work as expected</p>}>
<ErrorBoundary key={props.selectedNode.id} fallback={<p>Something did not work as expected</p>}>
<FilteredFieldProvider>
<CanvasForm selectedNode={props.selectedNode} onClose={props.onClose} />
</FilteredFieldProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const FlowTypeSelector: FunctionComponent<ISourceTypeSelector> = (props)
currentFlowType.multipleRoute ? (
<p>Add a new {currentFlowType.name} route</p>
) : (
<p>The {currentFlowType.name} type doesn't support multiple routes</p>
<p>The {currentFlowType.name} type does not support multiple routes</p>
)
}
>
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/layout/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,23 @@ export const TopBar: FunctionComponent<ITopBar> = (props) => {
onOpenChange={(isOpen: boolean) => setIsOpen(isOpen)}
popperProps={DEFAULT_POPPER_PROPS}
>
<a href="https://kaoto.io/workshop/" target="_blank">
<a href="https://kaoto.io/workshop/" target="_blank" rel="noreferrer">
<DropdownItem key="tutorial">
<Icon isInline>
<ExternalLinkAltIcon />
</Icon>
&nbsp;<span className="pf-u-mr-lg">Tutorials</span>
</DropdownItem>
</a>
<a href="https://kaoto.io/docs/" target="_blank">
<a href="https://kaoto.io/docs/" target="_blank" rel="noreferrer">
<DropdownItem key="help">
<Icon isInline>
<ExternalLinkAltIcon />
</Icon>
&nbsp;<span className="pf-u-mr-lg">Help</span>
</DropdownItem>
</a>
<a href="https://github.com/KaotoIO/kaoto/issues/new/choose" target="_blank">
<a href="https://github.com/KaotoIO/kaoto/issues/new/choose" target="_blank" rel="noreferrer">
<DropdownItem key="feedback">
<Icon isInline>
<GithubIcon />
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/models/camel-dataformats-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export interface ICamelDataformatDefinition {
propertiesSchema: KaotoSchemaDefinition['schema'];
}

export interface ICamelDataformatModel extends ICamelProcessorModel {}
export type ICamelDataformatModel = ICamelProcessorModel;

export interface ICamelDataformatProperty extends ICamelProcessorProperty {}
export type ICamelDataformatProperty = ICamelProcessorProperty;
4 changes: 2 additions & 2 deletions packages/ui/src/models/camel-languages-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export interface ICamelLanguageDefinition {
propertiesSchema: KaotoSchemaDefinition['schema'];
}

export interface ICamelLanguageModel extends ICamelProcessorModel {}
export type ICamelLanguageModel = ICamelProcessorModel;

export interface ICamelLanguageProperty extends ICamelProcessorProperty {}
export type ICamelLanguageProperty = ICamelProcessorProperty;
4 changes: 2 additions & 2 deletions packages/ui/src/models/camel-loadbalancers-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export interface ICamelLoadBalancerDefinition {
propertiesSchema: KaotoSchemaDefinition['schema'];
}

export interface ICamelLoadBalancerModel extends ICamelProcessorModel {}
export type ICamelLoadBalancerModel = ICamelProcessorModel;

export interface ICamelLoadBalancerProperty extends ICamelProcessorProperty {}
export type ICamelLoadBalancerProperty = ICamelProcessorProperty;
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-case-declarations */
import { ProcessorDefinition } from '@kaoto/camel-catalog/types';
import { SchemaService } from '../../../components/Form/schema.service';
import { ROOT_PATH, getArrayProperty, getValue, setValue } from '../../../utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ interface IValidationResult {
* property file.
*/
export class ModelValidationService {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
static validateNodeStatus(schema: VisualComponentSchema | undefined): string {
if (!schema?.schema) return '';
let message = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class BeansEntityHandler {
return this.type !== undefined;
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
getBeanSchema(): KaotoSchemaDefinition['schema'] | undefined {
switch (this.type) {
case 'beans':
Expand All @@ -42,7 +41,6 @@ export class BeansEntityHandler {
}
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
getBeansSchema(): KaotoSchemaDefinition['schema'] | undefined {
switch (this.type) {
case 'beans': {
Expand Down
Loading

0 comments on commit 7c05d20

Please sign in to comment.