PromucFlow_constructor/app/client/src/selectors/lintingSelectors.ts

15 lines
493 B
TypeScript
Raw Normal View History

import { AppState } from "@appsmith/reducers";
import { get } from "lodash";
import { LintErrors } from "reducers/lintingReducers/lintErrorsReducers";
import { LintError } from "utils/DynamicBindingUtils";
export const getAllLintErrors = (state: AppState): LintErrors =>
state.linting.errors;
const emptyLint: LintError[] = [];
export const getEntityLintErrors = (state: AppState, path?: string) => {
if (!path) return emptyLint;
return get(state.linting.errors, path, emptyLint);
};