Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1.6 KiB
1.6 KiB
Enforce valid describe() callback (valid-describe-callback)
💼 This rule is enabled in the ✅ recommended
config.
Using an improper describe() callback function can lead to unexpected test
errors.
Rule details
This rule validates that the second parameter of a describe() function is a
callback function. This callback function:
- should not be async
- should not contain any parameters
- should not contain any
returnstatements
The following describe function aliases are also validated:
describedescribe.onlydescribe.skipfdescribexdescribe
The following patterns are considered warnings:
// Async callback functions are not allowed
describe('myFunction()', async () => {
// ...
});
// Callback function parameters are not allowed
describe('myFunction()', done => {
// ...
});
//
describe('myFunction', () => {
// No return statements are allowed in block of a callback function
return Promise.resolve().then(() => {
it('breaks', () => {
throw new Error('Fail');
});
});
});
// Returning a value from a describe block is not allowed
describe('myFunction', () =>
it('returns a truthy value', () => {
expect(myFunction()).toBeTruthy();
}));
The following patterns are not considered warnings:
describe('myFunction()', () => {
it('returns a truthy value', () => {
expect(myFunction()).toBeTruthy();
});
});