Add precommit check (#1080)

Keeps the repo clean, same as several other of our repos

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Yuri Astrakhan
2025-02-25 05:01:15 -05:00
committed by GitHub
parent c58191ff62
commit 9540686b40
77 changed files with 143 additions and 177 deletions

View File

@@ -102,4 +102,3 @@ export default class Block extends React.Component<BlockProps, BlockState> {
</label>
}
}

View File

@@ -31,4 +31,3 @@ export default class Collapse extends React.Component<CollapseProps> {
}
}
}

View File

@@ -16,4 +16,3 @@ export default class Collapser extends React.Component<CollapserProps> {
return this.props.isCollapsed ? <MdArrowDropUp style={iconStyle}/> : <MdArrowDropDown style={iconStyle} />
}
}

View File

@@ -16,4 +16,3 @@ export default class FieldArray extends React.Component<FieldArrayProps> {
</Fieldset>
}
}

View File

@@ -15,4 +15,3 @@ export default class FieldAutocomplete extends React.Component<FieldAutocomplete
</Block>
}
}

View File

@@ -15,4 +15,3 @@ export default class FieldCheckbox extends React.Component<FieldCheckboxProps> {
</Block>
}
}

View File

@@ -18,4 +18,3 @@ export default class FieldColor extends React.Component<FieldColorProps> {
</Block>
}
}

View File

@@ -13,4 +13,3 @@ export default class FieldDynamicArray extends React.Component<FieldDynamicArray
</Fieldset>
}
}

View File

@@ -3,7 +3,7 @@ import InputEnum, {InputEnumProps} from './InputEnum'
import Fieldset from './Fieldset';
type FieldEnumProps = InputEnumProps & {
type FieldEnumProps = InputEnumProps & {
label?: string;
fieldSpec?: {
doc: string
@@ -17,4 +17,4 @@ export default class FieldEnum extends React.Component<FieldEnumProps> {
<InputEnum {...this.props} />
</Fieldset>
}
}
}

View File

@@ -404,4 +404,3 @@ export default class FieldFunction extends React.Component<FieldFunctionProps, F
</div>
}
}

View File

@@ -10,4 +10,3 @@ export default class FieldJson extends React.Component<FieldJsonProps> {
return <InputJson {...this.props} />
}
}

View File

@@ -15,4 +15,3 @@ export default class FieldMultiInput extends React.Component<FieldMultiInputProp
</Fieldset>
}
}

View File

@@ -18,5 +18,3 @@ export default class FieldSelect extends React.Component<FieldSelectProps> {
</Block>
}
}

View File

@@ -22,8 +22,8 @@ class FieldSourceLayerInternal extends React.Component<FieldSourceLayerInternalP
render() {
const t = this.props.t;
return <Block
label={t("Source Layer")}
return <Block
label={t("Source Layer")}
fieldSpec={latest.layer['source-layer']}
data-wd-key="layer-source-layer"
error={this.props.error}

View File

@@ -20,4 +20,3 @@ export default class FieldUrl extends React.Component<FieldUrlProps> {
);
}
}

View File

@@ -255,8 +255,8 @@ class FilterEditorInternal extends React.Component<FilterEditorInternalProps, Fi
value={combiningOp}
onChange={(v: [string, any]) => this.onFilterPartChanged(0, v)}
options={[
["all", t("every filter matches")],
["none", t("no filter matches")],
["all", t("every filter matches")],
["none", t("no filter matches")],
["any", t("any filter matches")]
]}
/>

View File

@@ -11,5 +11,3 @@ export default class IconBackground extends React.Component {
)
}
}

View File

@@ -11,5 +11,3 @@ export default class IconCircle extends React.Component {
)
}
}

View File

@@ -11,5 +11,3 @@ export default class IconFill extends React.Component {
)
}
}

View File

@@ -30,4 +30,3 @@ export default class IconLayer extends React.Component<IconLayerProps> {
}
}
}

View File

@@ -11,5 +11,3 @@ export default class IconLine extends React.Component {
)
}
}

View File

@@ -13,6 +13,3 @@ export default class IconSymbol extends React.Component {
)
}
}

View File

@@ -115,4 +115,3 @@ export default class FieldArray extends React.Component<FieldArrayProps, FieldAr
)
}
}

View File

@@ -98,5 +98,3 @@ export default class InputAutocomplete extends React.Component<InputAutocomplete
</div>
}
}

View File

@@ -30,4 +30,4 @@ export default class InputButton extends React.Component<InputButtonProps> {
{this.props.children}
</button>
}
}
}

View File

@@ -34,4 +34,4 @@ export default class InputCheckbox extends React.Component<InputCheckboxProps> {
</div>
</div>
}
}
}

View File

@@ -133,4 +133,3 @@ export default class InputColor extends React.Component<InputColorProps> {
</div>
}
}

View File

@@ -22,7 +22,7 @@ export type FieldDynamicArrayProps = {
}
'aria-label'?: string
label: string
}
}
type FieldDynamicArrayInternalProps = FieldDynamicArrayProps & WithTranslation;
@@ -67,7 +67,7 @@ class FieldDynamicArrayInternal extends React.Component<FieldDynamicArrayInterna
const t = this.props.t;
const i18nProps = { t, i18n: this.props.i18n, tReady: this.props.tReady };
const inputs = this.values.map((v, i) => {
const deleteValueBtn= <DeleteValueInputButton
const deleteValueBtn= <DeleteValueInputButton
onClick={this.deleteValue.bind(this, i)}
{...i18nProps}
/>;
@@ -152,4 +152,3 @@ class DeleteValueInputButton extends React.Component<DeleteValueInputButtonProps
</InputButton>
}
}

View File

@@ -47,4 +47,3 @@ export default class InputEnum extends React.Component<InputEnumProps> {
}
}
}

View File

@@ -37,5 +37,3 @@ export default class InputMultiInput extends React.Component<InputMultiInputProp
</fieldset>
}
}

View File

@@ -157,7 +157,7 @@ export default class InputNumber extends React.Component<InputNumberProps, Input
render() {
if(
Object.prototype.hasOwnProperty.call(this.props, "min") &&
Object.prototype.hasOwnProperty.call(this.props, "min") &&
Object.prototype.hasOwnProperty.call(this.props, "max") &&
this.props.min !== undefined && this.props.max !== undefined &&
this.props.allowRange
@@ -244,5 +244,3 @@ export default class InputNumber extends React.Component<InputNumberProps, Input
}
}
}

View File

@@ -30,5 +30,3 @@ export default class InputSelect extends React.Component<InputSelectProps> {
</select>
}
}

View File

@@ -97,5 +97,3 @@ export default class InputString extends React.Component<InputStringProps, Input
});
}
}

View File

@@ -326,10 +326,10 @@ class LayerEditorInternal extends React.Component<LayerEditorInternalProps, Laye
onSelection={handleSelection}
closeOnSelection={false}
>
<Button
id="skip-target-layer-editor"
data-wd-key="skip-target-layer-editor"
className='more-menu__button'
<Button
id="skip-target-layer-editor"
data-wd-key="skip-target-layer-editor"
className='more-menu__button'
title={"Layer options"}>
<MdMoreVert className="more-menu__button__svg" />
</Button>

View File

@@ -287,9 +287,9 @@ class LayerListContainerInternal extends React.Component<LayerListContainerInter
data-wd-key="skip-target-layer-list"
onClick={this.toggleLayers}
className="maputnik-button">
{this.state.areAllGroupsExpanded === true ?
t("Collapse")
:
{this.state.areAllGroupsExpanded === true ?
t("Collapse")
:
t("Expand")
}
</button>

View File

@@ -134,7 +134,7 @@ class MapMaplibreGlInternal extends React.Component<MapMaplibreGlInternalProps,
this.state.inspect!.render();
}, 500);
}
}
componentDidMount() {

View File

@@ -27,7 +27,7 @@ class ModalLoadingInternal extends React.Component<ModalLoadingInternalProps> {
underlayClickExits={false}
underlayProps={{
// @ts-ignore
onClick: (e: Event) => underlayProps(e)
onClick: (e: Event) => underlayProps(e)
}}
title={this.props.title}
onOpenToggle={() => this.props.onCancel()}

View File

@@ -56,8 +56,8 @@ export default class PropertyGroup extends React.Component<PropertyGroupProps> {
const paint = this.props.layer.paint || {}
const layout = this.props.layer.layout || {}
const fieldValue = fieldName in paint
? paint[fieldName as keyof typeof paint]
const fieldValue = fieldName in paint
? paint[fieldName as keyof typeof paint]
: layout[fieldName as keyof typeof layout]
const fieldType = fieldName in paint ? 'paint' : 'layout';

View File

@@ -11,4 +11,3 @@ export default class ScrollContainer extends React.Component<ScrollContainerProp
</div>
}
}

View File

@@ -90,4 +90,3 @@ export default class SingleFilterEditor extends React.Component<SingleFilterEdit
</div>
}
}

View File

@@ -44,4 +44,3 @@ export default class SpecField extends React.Component<SpecFieldProps> {
</TypeBlock>
}
}

View File

@@ -91,7 +91,7 @@ class ExpressionPropertyInternal extends React.Component<ExpressionPropertyInter
function getValue(data: any) {
return stringifyPretty(data, {indent: 2, maxLength: 38})
}
if (jsonError) {
foundErrors.push({message: "Invalid JSON"});
}

View File

@@ -29,8 +29,8 @@ export default class SpecProperty extends React.Component<SpecPropertyProps> {
const functionBtn = <FunctionButtons
fieldSpec={this.props.fieldSpec}
onZoomClick={this.props.onZoomClick}
onDataClick={this.props.onDataClick}
onExpressionClick={this.props.onExpressionClick}
onDataClick={this.props.onDataClick}
onExpressionClick={this.props.onExpressionClick}
/>
const error = errors![fieldType+"."+fieldName as any] as any;