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.5 KiB
1.5 KiB
Disallow Jasmine globals (no-jasmine-globals)
💼 This rule is enabled in the ✅ recommended
config.
🔧 This rule is automatically fixable by the
--fix CLI option.
jest uses jasmine as a test runner. A side effect of this is that both a
jasmine object, and some jasmine-specific globals, are exposed to the test
environment. Most functionality offered by Jasmine has been ported to Jest, and
the Jasmine globals will stop working in the future. Developers should therefore
migrate to Jest's documented API instead of relying on the undocumented Jasmine
API.
Rule details
This rule reports on any usage of Jasmine globals, which is not ported to Jest, and suggests alternatives from Jest's own API.
Examples
The following patterns are considered warnings:
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
test('my test', () => {
pending();
});
test('my test', () => {
fail();
});
test('my test', () => {
spyOn(some, 'object');
});
test('my test', () => {
jasmine.createSpy();
});
test('my test', () => {
expect('foo').toEqual(jasmine.anything());
});
The following patterns would not be considered warnings:
jest.setTimeout(5000);
test('my test', () => {
jest.spyOn(some, 'object');
});
test('my test', () => {
jest.fn();
});
test('my test', () => {
expect('foo').toEqual(expect.anything());
});