Skip to content

Commit

Permalink
chore(linting): fix linting errors (#6613)
Browse files Browse the repository at this point in the history
**Related Issue:** N/A

## Summary

Fixes `@stencil-community/strict-mutable` errors showing up after
landing #6611.

**Note**: props mutated by some of our utils need to be ignored as
`@stencil-community/eslint-plugin` doesn't check for this.
  • Loading branch information
jcfranco authored Mar 21, 2023
1 parent 64e4979 commit 930c590
Show file tree
Hide file tree
Showing 42 changed files with 95 additions and 20 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- **filter, list:** filter properly on initialization ([#6551](https://github.com/Esri/calcite-components/issues/6551)) ([b7782aa](https://github.com/Esri/calcite-components/commit/b7782aa79fc05fa9f217b08185f2fe35e36ef9f1)), closes [#6523](https://github.com/Esri/calcite-components/issues/6523)

* apply offsetParent polyfill for Chrome 109+ ([#6520](https://github.com/Esri/calcite-components/issues/6520)) ([ba8c068](https://github.com/Esri/calcite-components/commit/ba8c0688dd92a99e147f0e6434a969fef10ab3e3)), closes [#6300](https://github.com/Esri/calcite-components/issues/6300)
* **tree:** restore wrapping in tree-item text content ([#6518](https://github.com/Esri/calcite-components/issues/6518)) ([7b95194](https://github.com/Esri/calcite-components/commit/7b951944ee028c2d5f372de8b04d10e69a2ef0c3)), closes [#6512](https://github.com/Esri/calcite-components/issues/6512)
- apply offsetParent polyfill for Chrome 109+ ([#6520](https://github.com/Esri/calcite-components/issues/6520)) ([ba8c068](https://github.com/Esri/calcite-components/commit/ba8c0688dd92a99e147f0e6434a969fef10ab3e3)), closes [#6300](https://github.com/Esri/calcite-components/issues/6300)
- **tree:** restore wrapping in tree-item text content ([#6518](https://github.com/Esri/calcite-components/issues/6518)) ([7b95194](https://github.com/Esri/calcite-components/commit/7b951944ee028c2d5f372de8b04d10e69a2ef0c3)), closes [#6512](https://github.com/Esri/calcite-components/issues/6512)

- **tree:** prevent tree-item content from being clipped ([#6519](https://github.com/Esri/calcite-components/issues/6519)) ([8501b23](https://github.com/Esri/calcite-components/commit/8501b2333196240fa3549117447ebac3f7f62e0d)), closes [#6514](https://github.com/Esri/calcite-components/issues/6514)

* **select, slider, combobox:** display label in screen reader instructions. ([#6500](https://github.com/Esri/calcite-components/issues/6500)) ([3a7f112](https://github.com/Esri/calcite-components/commit/3a7f11238d52e7b5cec1cd2dd597d0184d7e0ce3)), closes [#5627](https://github.com/Esri/calcite-components/issues/5627)
* **value-list:** add back instructions for screen reader when drag handle is activated ([#6402](https://github.com/Esri/calcite-components/issues/6402)) ([b822f25](https://github.com/Esri/calcite-components/commit/b822f25a88519c8a4ddb1311006a88ac1e7b5a1b)), closes [#6401](https://github.com/Esri/calcite-components/issues/6401) [#5739](https://github.com/Esri/calcite-components/issues/5739)
- **select, slider, combobox:** display label in screen reader instructions. ([#6500](https://github.com/Esri/calcite-components/issues/6500)) ([3a7f112](https://github.com/Esri/calcite-components/commit/3a7f11238d52e7b5cec1cd2dd597d0184d7e0ce3)), closes [#5627](https://github.com/Esri/calcite-components/issues/5627)
- **value-list:** add back instructions for screen reader when drag handle is activated ([#6402](https://github.com/Esri/calcite-components/issues/6402)) ([b822f25](https://github.com/Esri/calcite-components/commit/b822f25a88519c8a4ddb1311006a88ac1e7b5a1b)), closes [#6401](https://github.com/Esri/calcite-components/issues/6401) [#5739](https://github.com/Esri/calcite-components/issues/5739)

- **slider:** slider handle aligns with track when font size changes ([#5372](https://github.com/Esri/calcite-components/issues/5372)) ([780df6c](https://github.com/Esri/calcite-components/commit/780df6c78b9dd111bec177189421372c3fe21285)), closes [#4721](https://github.com/Esri/calcite-components/issues/4721)

Expand Down
2 changes: 2 additions & 0 deletions src/components/action-bar/action-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ export class ActionBar
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: ActionBarMessages;

/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<ActionBarMessages>;

@Watch("messageOverrides")
Expand Down
2 changes: 2 additions & 0 deletions src/components/action-group/action-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ export class ActionGroup implements ConditionalSlotComponent, LocalizedComponent
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: ActionGroupMessages;

/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<ActionGroupMessages>;

@Watch("messageOverrides")
Expand Down
2 changes: 2 additions & 0 deletions src/components/action-pad/action-pad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ export class ActionPad
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: ActionPadMessages;

/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<ActionPadMessages>;

@Watch("messageOverrides")
Expand Down
2 changes: 2 additions & 0 deletions src/components/action/action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ export class Action
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: ActionMessages;

/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<ActionMessages>;

@Watch("messageOverrides")
Expand Down
2 changes: 2 additions & 0 deletions src/components/alert/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@ export class Alert implements OpenCloseComponent, LoadableComponent, T9nComponen
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: AlertMessages;

/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<AlertMessages>;

@Watch("messageOverrides")
Expand Down
2 changes: 2 additions & 0 deletions src/components/block-section/block-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ export class BlockSection implements LocalizedComponent, T9nComponent {
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: BlockSectionMessages;

/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<BlockSectionMessages>;

@Watch("messageOverrides")
Expand Down
2 changes: 2 additions & 0 deletions src/components/block/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@ export class Block
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: BlockMessages;

/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<BlockMessages>;

@Watch("messageOverrides")
Expand Down
4 changes: 3 additions & 1 deletion src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class Button
*
* @mdn [type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type)
*/
@Prop({ mutable: true, reflect: true }) type = "button";
@Prop({ reflect: true }) type = "button";

/** Specifies the width of the component. */
@Prop({ reflect: true }) width: Width = "auto";
Expand All @@ -136,11 +136,13 @@ export class Button
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: ButtonMessages;

/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<ButtonMessages>;

@Watch("loading")
Expand Down
2 changes: 2 additions & 0 deletions src/components/card/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ export class Card implements ConditionalSlotComponent, LocalizedComponent, T9nCo
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: CardMessages;

/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<CardMessages>;

@Watch("messageOverrides")
Expand Down
2 changes: 1 addition & 1 deletion src/components/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class Checkbox
*
* @internal
*/
@Prop({ reflect: true, mutable: true }) hovered = false;
@Prop({ reflect: true }) hovered = false;

/**
* When `true`, the component is initially indeterminate, which is independent from its `checked` value.
Expand Down
4 changes: 3 additions & 1 deletion src/components/chip/chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class Chip
@Prop({ reflect: true }) kind: Extract<"brand" | "inverse" | "neutral", Kind> = "neutral";

/** When `true`, a close button is added to the component. */
@Prop({ reflect: true, mutable: true }) closable = false;
@Prop({ reflect: true }) closable = false;

/** Specifies an icon to display. */
@Prop({ reflect: true }) icon: string;
Expand All @@ -84,13 +84,15 @@ export class Chip
/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<ChipMessages>;

/**
* Made into a prop for testing purposes only
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: ChipMessages;

@Watch("messageOverrides")
Expand Down
2 changes: 2 additions & 0 deletions src/components/color-picker/color-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export class ColorPicker
/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<ColorPickerMessages>;

@Watch("messageOverrides")
Expand Down Expand Up @@ -261,6 +262,7 @@ export class ColorPicker
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: ColorPickerMessages;

@State() savedColors: string[] = [];
Expand Down
2 changes: 2 additions & 0 deletions src/components/combobox/combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,13 @@ export class Combobox
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: ComboboxMessages;

/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<ComboboxMessages>;

@Watch("messageOverrides")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export class DatePickerMonthHeader {
* @internal
* @readonly
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: DatePickerMessages;

//--------------------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions src/components/date-picker/date-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class DatePicker implements LocalizedComponent, T9nComponent {
@Prop({ mutable: true }) maxAsDate: Date;

/** Specifies the earliest allowed date (`"yyyy-mm-dd"`). */
@Prop({ mutable: true, reflect: true }) min: string;
@Prop({ reflect: true }) min: string;

@Watch("min")
onMinChanged(min: string): void {
Expand All @@ -118,7 +118,7 @@ export class DatePicker implements LocalizedComponent, T9nComponent {
}

/** Specifies the latest allowed date (`"yyyy-mm-dd"`). */
@Prop({ mutable: true, reflect: true }) max: string;
@Prop({ reflect: true }) max: string;

@Watch("max")
onMaxChanged(max: string): void {
Expand All @@ -145,13 +145,15 @@ export class DatePicker implements LocalizedComponent, T9nComponent {
/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<DatePickerMessages>;

/**
* Made into a prop for testing purposes only
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: DatePickerMessages;

@Watch("messageOverrides")
Expand Down
4 changes: 3 additions & 1 deletion src/components/filter/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class Filter
* This property is needed to conduct filtering.
*
*/
@Prop({ mutable: true }) items: object[] = [];
@Prop() items: object[] = [];

@Watch("items")
watchItemsHandler(): void {
Expand Down Expand Up @@ -96,11 +96,13 @@ export class Filter
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: FilterMessages;

/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<FilterMessages>;

@Watch("messageOverrides")
Expand Down
6 changes: 4 additions & 2 deletions src/components/flow-item/flow-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ export class FlowItem
// --------------------------------------------------------------------------

/** When `true`, displays a close button in the trailing side of the component's header. */
@Prop({ mutable: true, reflect: true }) closable = false;
@Prop({ reflect: true }) closable = false;

/** When `true`, the component will be hidden. */
@Prop({ mutable: true, reflect: true }) closed = false;
@Prop({ reflect: true }) closed = false;

/**
* When provided, the method will be called before it is removed from its parent `calcite-flow`.
Expand Down Expand Up @@ -99,6 +99,7 @@ export class FlowItem
/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<FlowItemMessages>;

@Watch("messageOverrides")
Expand All @@ -111,6 +112,7 @@ export class FlowItem
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: FlowItemMessages;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/components/inline-editable/inline-editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ export class InlineEditable
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: InlineEditableMessages;

/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<InlineEditableMessages>;

@Watch("messageOverrides")
Expand Down
5 changes: 3 additions & 2 deletions src/components/input-date-picker/input-date-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class InputDatePicker
@Prop({ mutable: true }) maxAsDate: Date;

/** Specifies the earliest allowed date ("yyyy-mm-dd"). */
@Prop({ mutable: true }) min: string;
@Prop() min: string;

@Watch("min")
onMinChanged(min: string): void {
Expand All @@ -191,7 +191,7 @@ export class InputDatePicker
}

/** Specifies the latest allowed date ("yyyy-mm-dd"). */
@Prop({ mutable: true }) max: string;
@Prop() max: string;

@Watch("max")
onMaxChanged(max: string): void {
Expand Down Expand Up @@ -280,6 +280,7 @@ export class InputDatePicker
/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<DatePickerMessages>;

//--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/components/input-message/input-message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class InputMessage {
@Prop({ reflect: true, mutable: true }) scale: Scale = "m";

/** Specifies the status of the input field, which determines message and icons. */
@Prop({ reflect: true, mutable: true }) status: Status = "idle";
@Prop({ reflect: true }) status: Status = "idle";

@Watch("status")
@Watch("icon")
Expand Down
4 changes: 3 additions & 1 deletion src/components/input-number/input-number.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export class InputNumber
@Prop({ mutable: true, reflect: true }) scale: Scale = "m";

/** Specifies the status of the input field, which determines message and icons. */
@Prop({ mutable: true, reflect: true }) status: Status = "idle";
@Prop({ reflect: true }) status: Status = "idle";

/**
* Specifies the granularity that the component's value must adhere to.
Expand Down Expand Up @@ -287,11 +287,13 @@ export class InputNumber
*
* @internal
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messages: InputNumberMessages;

/**
* Use this property to override individual strings used by the component.
*/
// eslint-disable-next-line @stencil-community/strict-mutable -- updated by t9n module
@Prop({ mutable: true }) messageOverrides: Partial<InputNumberMessages>;

@Watch("messageOverrides")
Expand Down
Loading

0 comments on commit 930c590

Please sign in to comment.