Skip to content

Commit

Permalink
refactor!: remove deprecated ban-props-on-host, `enforce-ref-last-p…
Browse files Browse the repository at this point in the history
…rop`, `require-event-emitter-type` rules (#10679)

**Related Issue:** #10398

## Summary

Remove deprecated custom ESLint rules.

BREAKING CHANGE: The following deprecated rules from
`@esri/eslint-plugin-calcite-components` have been removed due to
changes introduced in #10310:

* `ban-props-on-host`
* `enforce-ref-last-prop`
* `require-event-emitter-type`

Developers should either remain on the current version or remove these
rules from their ESLint configuration to avoid potential issues.
  • Loading branch information
jcfranco authored Nov 4, 2024
1 parent 1a4d060 commit c399c10
Show file tree
Hide file tree
Showing 16 changed files with 4 additions and 445 deletions.
23 changes: 2 additions & 21 deletions packages/eslint-plugin-calcite-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,14 @@ npm run lint

This rule helps prevent usage of specific events and allows suggesting alternatives.

- [`@esri/calcite-components/ban-props-on-host`](./docs/ban-props-on-host.md)
- [`@esri/calcite-components/no-dynamic-createelement`](./docs/no-dynamic-createelement.md)

This rule catches props/attributes that should be in the encapsulated HTML structure and not on the host element.

- [`@esri/calcite-components/enforce-ref-last-prop`](./docs/enforce-ref-last-prop.md)

This ensures the node passed into the `ref` callback is in sync with its JSX attributes/properties when invoked.

- [`@esri/calcite-components/require-event-emitter-type`](./docs/require-event-emitter-type.md)

This rule helps enforce the payload type to EventEmitters to avoid misleading `any` type on the CustomEvent detail object.
This rule ensures that calls to `document.createElement()` use string literals to avoid dynamic tag creation to enhance plugin compatibility.

- [`@esri/calcite-components/strict-boolean-attributes`](./docs/strict-boolean-attributes.md)

This rule catches boolean props that are initialized in a way that does not conform to the HTML5 spec.

## Recommended rules

```json
{
"@esri/calcite-components/ban-props-on-host": "error",
"@esri/calcite-components/enforce-ref-last-prop": "error",
"@esri/calcite-components/require-event-emitter-type": "error",
"@esri/calcite-components/strict-boolean-attributes": "error"
}
```

## Contributing

We welcome contributions to this project. See [CONTRIBUTING.md](./CONTRIBUTING.md) for an overview of contribution guidelines.
Expand Down

This file was deleted.

7 changes: 2 additions & 5 deletions packages/eslint-plugin-calcite-components/src/configs/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ export default {
},
plugins: ["@esri/calcite-components"],
rules: {
"@esri/calcite-components/ban-props-on-host": 2,
"@esri/calcite-components/enforce-ref-last-prop": 2,
"@esri/calcite-components/no-dynamic-createelement": 2,
"@esri/calcite-components/require-event-emitter-type": 2,
"@esri/calcite-components/strict-boolean-attributes": 2,
"@esri/calcite-components/no-dynamic-createelement": 1,
"@esri/calcite-components/strict-boolean-attributes": 1,
},
},
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
export default {
extends: ["plugin:@esri/calcite-components/base"],
rules: {
"@esri/calcite-components/ban-props-on-host": 2,
"@esri/calcite-components/enforce-ref-last-prop": 2,
"@esri/calcite-components/require-event-emitter-type": 2,
"@esri/calcite-components/strict-boolean-attributes": 2,
},
};

This file was deleted.

6 changes: 0 additions & 6 deletions packages/eslint-plugin-calcite-components/src/rules/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import banEvents from "./ban-events";
import banPropsOnHost from "./ban-props-on-host";
import enforceRefLastProp from "./enforce-ref-last-prop";
import noDynamicCreateelement from "./no-dynamic-createelement";
import requireEventEmitterType from "./require-event-emitter-type";
import strictBooleanAttributes from "./strict-boolean-attributes";

export default {
"ban-events": banEvents,
"ban-props-on-host": banPropsOnHost,
"enforce-ref-last-prop": enforceRefLastProp,
"no-dynamic-createelement": noDynamicCreateelement,
"require-event-emitter-type": requireEventEmitterType,
"strict-boolean-attributes": strictBooleanAttributes,
};

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit c399c10

Please sign in to comment.