Skip to content

Commit

Permalink
fixing linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-rodgers committed Nov 11, 2024
1 parent 90ba34b commit 2066a0e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/sp/spqueryable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ class InitialFieldQuery<TBaseInterface> extends QueryableFields<TBaseInterface>
public or(): QueryableFields<TBaseInterface>;
public or(...queries: (ComparisonResult<TBaseInterface> | ((f: QueryableFields<TBaseInterface>) => ComparisonResult<TBaseInterface>))[]): ComparisonResult<TBaseInterface>;
public or(...queries: (ComparisonResult<TBaseInterface> | ((f: QueryableFields<TBaseInterface>) => ComparisonResult<TBaseInterface>))[]): (ComparisonResult<TBaseInterface> | QueryableFields<TBaseInterface>) {

Check failure on line 360 in packages/sp/spqueryable.ts

View workflow job for this annotation

GitHub Actions / run_pr_tests

This line has a length of 212. Maximum allowed is 180
if (queries == null || queries.length == 0)
if (queries == null || queries.length == 0)

Check failure on line 361 in packages/sp/spqueryable.ts

View workflow job for this annotation

GitHub Actions / run_pr_tests

Expected '===' and instead saw '=='
return new QueryableFields<TBaseInterface>([...this.query, FilterJoinOperator.Or]);

Check failure on line 362 in packages/sp/spqueryable.ts

View workflow job for this annotation

GitHub Actions / run_pr_tests

Expected { after 'if' condition
return new ComparisonResult<TBaseInterface>([...this.query, `(${queries.map(x => x.toString()).join(FilterJoinOperator.OrWithSpace)})`]);
}
Expand Down Expand Up @@ -536,22 +536,27 @@ class DateField<TBaseInterface> extends NumericField<TBaseInterface, Date> {

class ComparisonResult<TBaseInterface> extends BaseQuery<TBaseInterface> {
public and(): QueryableAndResult<TBaseInterface>;
// eslint-disable-next-line @typescript-eslint/semi
public and(...queries: (ComparisonResult<TBaseInterface> | ((f: QueryableFields<TBaseInterface>) => ComparisonResult<TBaseInterface>))[]): ComparisonResult<TBaseInterface>
// eslint-disable-next-line max-len
public and(...queries: (ComparisonResult<TBaseInterface> | ((f: QueryableFields<TBaseInterface>) => ComparisonResult<TBaseInterface>))[]): (ComparisonResult<TBaseInterface> | QueryableAndResult<TBaseInterface>) {
if (queries == null || queries.length == 0)
if (queries == null || queries.length === 0) {
return new QueryableAndResult<TBaseInterface>([...this.query, FilterJoinOperator.And]);
}
return new ComparisonResult<TBaseInterface>([...this.query, FilterJoinOperator.And, `(${queries.map(x => x.toString()).join(FilterJoinOperator.AndWithSpace)})`]);
}

public or(): QueryableOrResult<TBaseInterface>;
public or(...queries: (ComparisonResult<TBaseInterface> | ((f: QueryableFields<TBaseInterface>) => ComparisonResult<TBaseInterface>))[]): ComparisonResult<TBaseInterface>;
// eslint-disable-next-line max-len
public or(...queries: (ComparisonResult<TBaseInterface> | ((f: QueryableFields<TBaseInterface>) => ComparisonResult<TBaseInterface>))[]): (ComparisonResult<TBaseInterface> | QueryableOrResult<TBaseInterface>) {
if (queries == null || queries.length == 0)
if (queries == null || queries.length === 0) {
return new QueryableOrResult<TBaseInterface>([...this.query, FilterJoinOperator.Or]);
}
return new ComparisonResult<TBaseInterface>([...this.query, FilterJoinOperator.Or, `(${queries.map(x => x.toString()).join(FilterJoinOperator.OrWithSpace)})`]);
}

public toString(): string {
return this.query.join(" ");
}
}
}

0 comments on commit 2066a0e

Please sign in to comment.