Skip to content

Commit c801219

Browse files
committed
no warnings
1 parent 015c51e commit c801219

34 files changed

Lines changed: 9829 additions & 9926 deletions

File tree

.claude/settings.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,22 @@
1414
"Bash(node -e \"const v=JSON.parse\\(require\\(''fs''\\).readFileSync\\(''/dev/stdin'',''utf8''\\)\\); const matching=v.filter\\(x=>x.startsWith\\(''3.''\\)\\); console.log\\(matching[matching.length-1]\\)\")",
1515
"Bash(ls /Users/alexterentiev/Work/community/sp-dev-fx-controls-react/node_modules/color/*.d.ts)",
1616
"Bash(node -e \"const p=require\\(''/Users/alexterentiev/Work/community/sp-dev-fx-controls-react/node_modules/color/package.json''\\); console.log\\(p.types||p.typings||''none''\\)\")",
17-
"Bash(npm install --save-dev --save-exact @types/uuid@8.3.4 @types/color@3.0.6)"
17+
"Bash(npm install --save-dev --save-exact @types/uuid@8.3.4 @types/color@3.0.6)",
18+
"Bash(node -e \"const p = require\\(''./node_modules/enzyme/package.json''\\); console.log\\(''enzyme:'', p.version\\); console.log\\(''cheerio dep:'', p.dependencies && p.dependencies.cheerio\\)\")",
19+
"Bash(node -e \"const p = require\\(''./node_modules/cheerio/package.json''\\); console.log\\(''cheerio installed:'', p.version\\)\")",
20+
"Bash(ls ./node_modules/cheerio/lib/utils*)",
21+
"Bash(node -e \"try { require\\(''cheerio/lib/utils''\\); console.log\\(''found''\\) } catch\\(e\\) { console.log\\(e.message\\) }\")",
22+
"Bash(node -e \"const p = require\\(''./node_modules/cheerio/package.json''\\); console.log\\(''exports:'', JSON.stringify\\(p.exports, null, 2\\)\\)\")",
23+
"Bash(node -e \"console.log\\(require\\(''react/package.json''\\).version\\)\")",
24+
"Bash(node -e \"console.log\\(require\\(''@fluentui/react/package.json''\\).version\\)\")",
25+
"Bash(node -e \":*)",
26+
"Bash(node -e \"console.log\\(require\\(''./node_modules/sinon/package.json''\\).version\\)\")",
27+
"Bash(node -e 'function SPHttpClient\\(\\) {} SPHttpClient.configurations = { v1: 1 }; var result = SPHttpClient.apply\\({}, []\\); console.log\\(\"\"works:\"\", typeof result\\);')",
28+
"Bash(node -e 'var tslib = require\\(\"\"tslib\"\"\\); console.log\\(typeof tslib.__extends\\)')",
29+
"Bash(node -e ':*)",
30+
"Bash(node --input-type=commonjs -e ':*)",
31+
"Bash(node /tmp/test_extends.js)",
32+
"Bash(node -e 'console.log\\(typeof Response\\)')"
1833
]
1934
}
2035
}

config/jest.config.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"extends": "@microsoft/spfx-web-build-rig/profiles/default/config/jest.config.json",
3+
4+
"setupFilesAfterEnv": [
5+
"<rootDir>/tests/setupHeft.js"
6+
],
7+
8+
"moduleNameMapper": {
9+
"cheerio/lib/utils": "cheerio/utils",
10+
"^undici$": "<rootDir>/tests/__mocks__/undici.js",
11+
"@ms/sp-telemetry": "identity-obj-proxy",
12+
"@microsoft/sp-webpart-base": "identity-obj-proxy",
13+
"@microsoft/sp-core-library": "<rootDir>/tests/__mocks__/sp-core-library.js",
14+
"@microsoft/sp-http": "<rootDir>/tests/__mocks__/sp-http.js",
15+
"@microsoft/sp-application-base": "identity-obj-proxy",
16+
"office-ui-fabric-react/lib/(.*)$": "office-ui-fabric-react/lib-commonjs/$1",
17+
"@fluentui/react-theme-provider/lib/(.*)$": "@fluentui/react-theme-provider/lib-commonjs/$1",
18+
"src/common/telemetry/(.*)$": "identity-obj-proxy",
19+
"@pnp/sp": "identity-obj-proxy",
20+
"'@pnp/sp/fields": "identity-obj-proxy",
21+
"ControlStrings": "identity-obj-proxy",
22+
"\\.(css|scss)$": "identity-obj-proxy"
23+
}
24+
}

package-lock.json

Lines changed: 9561 additions & 9725 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controls/HoverReactionsBar/hooks/useFluentEmojis.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ export const useFluentEmojis = (): IUseFluentEmojis => {
130130
} else {
131131
return getFluentEmojiByglyph(glyph);
132132
}
133-
134-
return undefined;
135133
}, []);
136134

137135
return {

src/controls/adaptiveCardDesignerHost/fluentUI/peers/Shared.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ export class DesignerPeerCategory {
1616

1717
export class NameValuePairPropertyEditor extends PropertySheetEntry {
1818
private collectionChanged(context: PropertySheetContext, nameValuePairs: INameValuePair[], refreshPropertySheet: boolean): void {
19-
(context.target as any)[this.collectionPropertyName] = [];
19+
(context.target as any)[this.collectionPropertyName] = []; // eslint-disable-line @typescript-eslint/no-explicit-any
2020

2121
for (const nameValuePair of nameValuePairs) {
2222
const item = this.createCollectionItem(nameValuePair.name, nameValuePair.value);
2323

24-
(context.target as any)[this.collectionPropertyName].push(item);
24+
(context.target as any)[this.collectionPropertyName].push(item); // eslint-disable-line @typescript-eslint/no-explicit-any
2525
}
2626

2727
context.peer.changed(refreshPropertySheet);
@@ -30,7 +30,7 @@ export class NameValuePairPropertyEditor extends PropertySheetEntry {
3030
public render(context: PropertySheetContext): Adaptive.CardElement {
3131
const result = new Adaptive.Container();
3232

33-
const collection = (context.target as any)[this.collectionPropertyName];
33+
const collection = (context.target as any)[this.collectionPropertyName]; // eslint-disable-line @typescript-eslint/no-explicit-any
3434

3535
if (!Array.isArray(collection)) {
3636
throw new Error("The " + this.collectionPropertyName + " property on " + context.peer.getCardObject().getJsonTypeName() + " either doesn't exist or isn't an array.");

src/controls/carousel/Carousel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ export class Carousel extends React.Component<ICarouselProps, ICarouselState> {
442442
else if (isArray(element) && (arrayLen = (element as JSX.Element[] | ICarouselImageProps[]).length) > 0) {
443443
// Retrieve proper element from the array
444444
if (currentIndex >= 0 && arrayLen > currentIndex) {
445-
const arrayEl = (element as any)[currentIndex];
445+
const arrayEl = (element as any)[currentIndex]; // eslint-disable-line @typescript-eslint/no-explicit-any
446446

447447
result = 'props' in arrayEl ? arrayEl as JSX.Element :
448448
<CarouselImage {...arrayEl} />;

src/controls/dynamicForm/DynamicForm.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ export class DynamicFormBase extends React.Component<
670670
const folderId = fields[idField];
671671

672672
// Set the content type ID for the target item
673-
(objects as any)[contentTypeIdField] = contentTypeId;
673+
(objects as any)[contentTypeIdField] = contentTypeId; // eslint-disable-line @typescript-eslint/no-explicit-any
674674
// Update the just created folder or Document Set
675675
const iur = await this.updateListItemRetry(library, folderId, objects);
676676
if (onSubmitted) {
@@ -1015,7 +1015,7 @@ export class DynamicFormBase extends React.Component<
10151015
const numberFields = additionalInfo?.filter((f) => f.TypeAsString === "Number" || f.TypeAsString === "Currency");
10161016

10171017
// Build a dictionary of validation formulas and messages
1018-
const validationFormulas: Record<string, Pick<ISPField, "ValidationFormula" | "ValidationMessage">> = additionalInfo.reduce((prev, cur) => {
1018+
const validationFormulas: Record<string, Pick<ISPField, "ValidationFormula" | "ValidationMessage">> = additionalInfo.reduce((prev: any, cur) => { // eslint-disable-line @typescript-eslint/no-explicit-any
10191019
if (!prev[cur.InternalName] && cur.ValidationFormula) {
10201020
prev[cur.InternalName] = {
10211021
ValidationFormula: cur.ValidationFormula,
@@ -1319,7 +1319,7 @@ export class DynamicFormBase extends React.Component<
13191319
termSetId = field.TermSetId;
13201320
anchorId = field.AnchorId !== Guid.empty.toString() ? field.AnchorId : null;
13211321
if (item && item[field.InternalName]) {
1322-
const _selectedTags = await this.getTermsForModernTaxonomyPicker(field.TermSetId,item[field.InternalName]);
1322+
const _selectedTags = await this.getTermsForModernTaxonomyPicker(field.TermSetId, item[field.InternalName]);
13231323
// item[field.InternalName].forEach((element) => {
13241324
// selectedTags.push({
13251325
// key: element.TermGuid,
@@ -1339,7 +1339,7 @@ export class DynamicFormBase extends React.Component<
13391339
});
13401340
});
13411341

1342-
const _selectedTags = await this.getTermsForModernTaxonomyPicker(field.TermSetId,selectedTags.map((dv: { key: string; name: string }) => ({
1342+
const _selectedTags = await this.getTermsForModernTaxonomyPicker(field.TermSetId, selectedTags.map((dv: { key: string; name: string }) => ({
13431343
Label: dv.name,
13441344
TermGuid: dv.key
13451345
})));
@@ -1705,7 +1705,7 @@ export class DynamicFormBase extends React.Component<
17051705
* @param objects The object containing the field values
17061706
* @returns the folder name
17071707
*/
1708-
private getFolderName = (objects: {}): string => {
1708+
private getFolderName = (objects: any): string => { // eslint-disable-line @typescript-eslint/no-explicit-any
17091709
const titleField = "Title";
17101710
const fileLeafRefField = "FileLeafRef";
17111711
let folderNameValue = "";

src/controls/dynamicForm/dynamicField/DynamicField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,8 @@ export class DynamicFieldBase extends React.Component<IDynamicFieldProps, IDynam
778778
let minValueCur: string, maxValueCur: string;
779779
if (fieldType === "Currency" && cultureName) {
780780
const countryCode = cultureName.split('-')?.[1];
781-
if (minValue) minValueCur = Intl.NumberFormat(cultureName, { style: 'currency', currency: (CurrencyMap as any)[countryCode] }).format(minValue);
782-
if (maxValue) maxValueCur = Intl.NumberFormat(cultureName, { style: 'currency', currency: (CurrencyMap as any)[countryCode] }).format(maxValue);
781+
if (minValue) minValueCur = Intl.NumberFormat(cultureName, { style: 'currency', currency: (CurrencyMap as any)[countryCode] }).format(minValue); // eslint-disable-line @typescript-eslint/no-explicit-any
782+
if (maxValue) maxValueCur = Intl.NumberFormat(cultureName, { style: 'currency', currency: (CurrencyMap as any)[countryCode] }).format(maxValue); // eslint-disable-line @typescript-eslint/no-explicit-any
783783
}
784784

785785
if (changedValue !== undefined && changedValue !== null && changedValue.length > 0) {

src/controls/fields/fieldFileTypeRenderer/FieldFileTypeRenderer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { css, ISerializableObject } from '@fluentui/react/lib/Utilities';
2+
import { css } from '@fluentui/react/lib/Utilities';
33
import { Icon } from '@fluentui/react/lib/Icon';
44
import { IFieldRendererProps } from '../fieldCommon/IFieldRendererProps';
55
import { FileTypeIcon, IconType } from '../../fileTypeIcon';
@@ -40,7 +40,7 @@ export class FieldFileTypeRenderer extends React.Component<IFieldFileTypeRendere
4040
}
4141

4242
public render(): JSX.Element {
43-
const optionalStyles: ISerializableObject = {
43+
const optionalStyles: any = { // eslint-disable-line @typescript-eslint/no-explicit-any
4444
};
4545
optionalStyles[styles.folder] = this.props.isFolder;
4646
return (

src/controls/fields/fieldTextRenderer/FieldTextRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class FieldTextRenderer extends React.Component<IFieldTextRendererProps,
5050

5151
public render(): JSX.Element {
5252
const isSafeForInnerHTML: boolean = this.props.isSafeForInnerHTML;
53-
const isTruncatedClassNameObj: ICssInput = {};
53+
const isTruncatedClassNameObj: ICssInput & { [key: string]: unknown } = {}; // hack to avoid ts warning
5454
isTruncatedClassNameObj[styles.isTruncated] = this.props.isTruncated;
5555
let text: string = this.props.text;
5656
if (isSafeForInnerHTML && this.props.isTruncated) {

0 commit comments

Comments
 (0)