## 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 -->
20 lines
412 B
TypeScript
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;
|