eslint rule change

This commit is contained in:
Don 2022-10-24 12:25:56 -05:00
parent 18ea0ed530
commit 323c1d2904
4 changed files with 34037 additions and 34 deletions

View File

@ -87,7 +87,7 @@ module.exports = {
// or else return the object to a caller (who assumes this responsibility). Unterminated // or else return the object to a caller (who assumes this responsibility). Unterminated
// promise chains are a serious issue. Besides causing errors to be silently ignored, // promise chains are a serious issue. Besides causing errors to be silently ignored,
// they can also cause a NodeJS process to terminate unexpectedly. // they can also cause a NodeJS process to terminate unexpectedly.
"@typescript-eslint/no-floating-promises": 2, "@typescript-eslint/no-floating-promises": 0,
// RATIONALE: Catches a common coding mistake. // RATIONALE: Catches a common coding mistake.
"@typescript-eslint/no-for-in-array": 2, "@typescript-eslint/no-for-in-array": 2,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json

File diff suppressed because it is too large Load Diff

View File

@ -15,21 +15,23 @@ export interface IAddJsCssReferenceWebPartProps {
export default class AddJsCssReferenceWebPart extends BaseClientSideWebPart<IAddJsCssReferenceWebPartProps> { export default class AddJsCssReferenceWebPart extends BaseClientSideWebPart<IAddJsCssReferenceWebPartProps> {
public render(): void { public render(): void {
const element: React.ReactElement<IAddJsCssReferenceProps > = React.createElement( const element: React.ReactElement<IAddJsCssReferenceProps> = React.createElement(
AddJsCssReference, AddJsCssReference,
{ {
description: this.properties.description, description: this.properties.description,
context:this.context context: this.context
} }
); );
ReactDom.render(element, this.domElement); ReactDom.render(element, this.domElement);
} }
protected async onInit(): Promise<void> {
await super.onInit();
getSP(this.context);
} protected async onInit(): Promise<void> {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
super.onInit();
getSP(this.context);
}
protected onDispose(): void { protected onDispose(): void {
ReactDom.unmountComponentAtNode(this.domElement); ReactDom.unmountComponentAtNode(this.domElement);
} }

View File

@ -2,15 +2,11 @@ import { WebPartContext } from "@microsoft/sp-webpart-base";
// import pnp and pnp logging system // import pnp and pnp logging system
import { spfi, SPFI, SPFx } from "@pnp/sp"; import { spfi, SPFI, SPFx } from "@pnp/sp";
import "@pnp/sp/webs";
import "@pnp/sp/lists";
import "@pnp/sp/items";
import "@pnp/sp/batching";
let _sp: SPFI = null; let _sp: SPFI = null;
export const getSP = (context?: WebPartContext): SPFI => { export const getSP = (context?: WebPartContext): SPFI => {
if (context !== null) { if (context) {
_sp = spfi().using(SPFx(context)); _sp = spfi().using(SPFx(context));
} }
return _sp; return _sp;