Skip to content

Commit 96a0afc

Browse files
committed
Fixing remaining eslint errors
1 parent 1c00a90 commit 96a0afc

File tree

7 files changed

+27
-12
lines changed

7 files changed

+27
-12
lines changed

src/ui/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"rules": {
1818
"no-console": "off",
1919
"no-alert": "off",
20-
"max-len": ["error", { "code": 120, "ignoreUrls": true, "ignoreTemplateLiterals": true }],
20+
"max-len": ["error", { "code": 120, "ignoreUrls": true, "ignoreTemplateLiterals": true, "ignoreComments": true }],
2121
"linebreak-style": ["error", "unix"],
2222
"react/jsx-filename-extension": [
2323
"warn",

src/ui/src/components/common/ReprocessDocumentModal.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,4 @@ ReprocessDocumentModal.propTypes = {
6363
),
6464
};
6565

66-
67-
6866
export default ReprocessDocumentModal;

src/ui/src/components/configuration-layout/ConfigurationLayout.jsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,16 @@ const ConfigurationLayout = () => {
286286
// Only check constraints if it's a valid number
287287
if (isValidNumber && itemProp.minimum !== undefined && numValue < itemProp.minimum) {
288288
errors.push({
289-
message: `Field '${itemKey}' in item ${index} of '${key}' must be at least ${itemProp.minimum}`,
289+
message:
290+
`Field '${itemKey}' in item ${index} of '${key}' must be ` +
291+
`at least ${itemProp.minimum}`,
290292
});
291293
}
292294
if (isValidNumber && itemProp.maximum !== undefined && numValue > itemProp.maximum) {
293295
errors.push({
294-
message: `Field '${itemKey}' in item ${index} of '${key}' must be at most ${itemProp.maximum}`,
296+
message:
297+
`Field '${itemKey}' in item ${index} of '${key}' must be ` +
298+
`at most ${itemProp.maximum}`,
295299
});
296300
}
297301
}
@@ -504,7 +508,8 @@ const ConfigurationLayout = () => {
504508
const compareWithDefault = (current, defaultObj, path = '') => {
505509
// Add debugging for granular assessment
506510
if (path.includes('granular')) {
507-
console.log(`DEBUG: compareWithDefault called with path '${path}':`, { // nosemgrep: javascript.lang.security.audit.unsafe-formatstring.unsafe-formatstring - Debug logging with controlled internal data
511+
console.log(`DEBUG: compareWithDefault called with path '${path}':`, {
512+
// nosemgrep: javascript.lang.security.audit.unsafe-formatstring.unsafe-formatstring - Debug logging with controlled internal data
508513
current,
509514
currentType: typeof current,
510515
defaultObj,
@@ -593,7 +598,8 @@ const ConfigurationLayout = () => {
593598

594599
// Add debugging for granular assessment
595600
if (newPath.includes('granular')) {
596-
console.log(`DEBUG: Comparing object key '${key}' at path '${newPath}':`, { // nosemgrep: javascript.lang.security.audit.unsafe-formatstring.unsafe-formatstring - Debug logging with controlled internal data
601+
console.log(`DEBUG: Comparing object key '${key}' at path '${newPath}':`, {
602+
// nosemgrep: javascript.lang.security.audit.unsafe-formatstring.unsafe-formatstring - Debug logging with controlled internal data
597603
currentValue: current[key],
598604
defaultValue: defaultObj[key],
599605
keyInCurrent: key in current,
@@ -611,7 +617,8 @@ const ConfigurationLayout = () => {
611617

612618
// Add debugging for granular assessment
613619
if (newPath.includes('granular')) {
614-
console.log(`DEBUG: Recursive call result for '${newPath}':`, { // nosemgrep: javascript.lang.security.audit.unsafe-formatstring.unsafe-formatstring - Debug logging with controlled internal data
620+
console.log(`DEBUG: Recursive call result for '${newPath}':`, {
621+
// nosemgrep: javascript.lang.security.audit.unsafe-formatstring.unsafe-formatstring - Debug logging with controlled internal data
615622
nestedResults,
616623
nestedResultsKeys: Object.keys(nestedResults),
617624
nestedResultsLength: Object.keys(nestedResults).length,
@@ -627,7 +634,8 @@ const ConfigurationLayout = () => {
627634

628635
// Handle primitive values
629636
if (current !== defaultObj) {
630-
console.log(`DEBUG: Primitive difference detected at path '${path}':`, { // nosemgrep: javascript.lang.security.audit.unsafe-formatstring.unsafe-formatstring - Debug logging with controlled internal data
637+
console.log(`DEBUG: Primitive difference detected at path '${path}':`, {
638+
// nosemgrep: javascript.lang.security.audit.unsafe-formatstring.unsafe-formatstring - Debug logging with controlled internal data
631639
current,
632640
currentType: typeof current,
633641
defaultObj,
@@ -699,7 +707,7 @@ const ConfigurationLayout = () => {
699707
for (let i = 0; i < parts.length - 1; i += 1) {
700708
// Use += 1 instead of ++
701709
current[parts[i]] = {};
702-
current = current[parts[i]]; // nosemgrep: javascript.lang.security.audit.prototype-pollution.prototype-pollution-loop.prototype-pollution-loop - Index from controlled array iteration
710+
current = current[parts[i]]; // nosemgrep: javascript.lang.security.audit.prototype-pollution.prototype-pollution-loop.prototype-pollution-loop - Index from controlled array iteration
703711
}
704712

705713
// Set the value at the final path - IMPORTANT: preserve boolean false values!

src/ui/src/components/configuration-layout/FormView.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ const FormView = ({
590590
// Define renderField first as a function declaration
591591
function renderField(key, property, path = '') {
592592
const currentPath = path ? `${path}.${key}` : key;
593-
let value = getValueAtPath(formValues, currentPath);
593+
const value = getValueAtPath(formValues, currentPath);
594594

595595
// Add debugging for granular assessment
596596
if (currentPath.includes('granular')) {

src/ui/src/components/genaiidp-layout/GenAIIDPLayout.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33
import React, { useState } from 'react';
4+
import PropTypes from 'prop-types';
45
import { Routes, Route } from 'react-router-dom';
56
import { AppLayout, Flashbar } from '@cloudscape-design/components';
67

@@ -129,4 +130,8 @@ const GenAIIDPLayout = ({ children }) => {
129130
);
130131
};
131132

133+
GenAIIDPLayout.propTypes = {
134+
children: PropTypes.node,
135+
};
136+
132137
export default GenAIIDPLayout;

src/ui/src/components/step-function-flow/StepDetails.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ const JsonDisplay = ({ data = null }) => {
4646
);
4747
};
4848

49+
JsonDisplay.propTypes = {
50+
data: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
51+
};
52+
4953
// Helper function to check if a step is disabled based on configuration
5054
const isStepDisabled = (stepName, config) => {
5155
if (!config) return false;

src/ui/src/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ const root = createRoot(document.getElementById('root'));
2121
root.render(
2222
<React.StrictMode>
2323
<App />
24-
</React.StrictMode>
24+
</React.StrictMode>,
2525
);

0 commit comments

Comments
 (0)