PromucFlow_constructor/app/client/packages/eslint-plugin/src/index.ts
Hetu Nandu 71963b5bf9
chore: Add named-use-effect custom eslint rule (#36725)
## Description

Adds a custom es lint rule that would add a warning when a useEffect is
used without a named function inside it


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced a new ESLint rule to enforce the use of named functions
within the `useEffect` hook, promoting better code readability.
- Updated recommended ESLint configuration to include the new rule with
a warning level.

- **Tests**
- Added a comprehensive test suite for the new `namedUseEffectRule`,
covering both valid and invalid usage scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-10-09 10:55:06 +00:00

20 lines
412 B
TypeScript

import { objectKeysRule } from "./object-keys/rule";
import { namedUseEffectRule } from "./named-use-effect/rule";
const plugin = {
rules: {
"object-keys": objectKeysRule,
"named-use-effect": namedUseEffectRule,
},
configs: {
recommended: {
rules: {
"@appsmith/object-keys": "warn",
"@appsmith/named-use-effect": "warn",
},
},
},
};
module.exports = plugin;