[ACA-4695] Fix saving screenshots for E2Es, add nx eslint plugin (#3148)

* [ACA-4695] Fix saving screenshots for E2Es, add nx eslint plugin

* [ACA-4695] Improve eslint rules
This commit is contained in:
MichalKinas
2023-04-26 12:25:36 +02:00
committed by GitHub
parent 42479d92cc
commit 5fa5ac4117
17 changed files with 277 additions and 33 deletions
+2 -1
View File
@@ -95,7 +95,7 @@ export const isContentServiceEnabled = (): boolean => localStorage && localStora
* JSON ref: `app.isSearchSupported`
*/
export const isSearchSupported = (context: RuleContext): boolean =>
[navigation.isNotSearchResults(context) /*, !hasSelection(context)*/].every(Boolean);
[navigation.isNotSearchResults(context) /* , !hasSelection(context)*/].every(Boolean);
/**
* Checks if upload action is supported for the given context
@@ -617,6 +617,7 @@ export function canOpenWithOffice(context: RuleContext): boolean {
// workaround for Shared files
if (context.navigation && context.navigation.url && context.navigation.url.startsWith('/shared')) {
// eslint-disable-next-line no-prototype-builtins
if (file.entry.hasOwnProperty('allowableOperationsOnTarget')) {
return context.permissions.check(file, ['update'], {
target: 'allowableOperationsOnTarget'
@@ -136,8 +136,8 @@ export const isNotRecentFiles = (context: RuleContext): boolean => !isRecentFile
* JSON ref: `app.navigation.isSearchResults`
*/
export function isSearchResults(
context: RuleContext /*,
...args: RuleParameter[]*/
context: RuleContext
// ...args: RuleParameter[]
): boolean {
const { url } = context.navigation;
return url && url.startsWith('/search');
@@ -154,9 +154,8 @@ export class ContentApiService {
};
const queryOptions = Object.assign(defaults, options || {});
// @ts-ignore
return from(
new Promise((resolve, reject) => {
new Promise<Node>((resolve, reject) => {
this.nodesApi.getNode(nodeId, queryOptions).then(
(nodeEntry: NodeEntry) => {
resolve(nodeEntry.entry);