Upgrade to ESLint 9+ and flat config (#9410)

This commit is contained in:
Volodymyr Agafonkin
2024-07-27 19:38:35 +03:00
committed by GitHub
parent 688033d412
commit 54f49b5bd4
16 changed files with 1779 additions and 1885 deletions

View File

@ -1,10 +0,0 @@
/** @type {import('eslint').Linter.Config } */
module.exports = {
rules: {
'no-console': 'off',
'no-unused-expressions': 'off'
},
env: {
mocha: true,
}
};

View File

@ -67,7 +67,6 @@ module.exports = function (/** @type {import('karma').Config} */ config) {
browserConsoleLogOptions: {level: 'error'},
client: {
mocha: {
// eslint-disable-next-line no-undef
forbidOnly: process.env.CI || false
}
}

View File

@ -602,9 +602,8 @@ describe('DomEvent', () => {
function isPrevented(e) {
if ('defaultPrevented' in e) {
return e.defaultPrevented;
} else { // IE<11
return !e.returnValue;
}
return !e.returnValue; // IE<11
}
it('prevents the default action of event', (done) => {

View File

@ -127,7 +127,7 @@ describe('DomUtil', () => {
expect(el.style.transform).to.equal('translate3d(1px, 1px, 0px)');
});
it('set 3d CSS transform to translate3d(0px, 0px, 0) and add to it scale(${scalevalue}) if only scale is specified', () => {
it('set 3d CSS transform to translate3d(0px, 0px, 0) and add to it scale(<scalevalue>) if only scale is specified', () => {
DomUtil.setTransform(el, undefined, 5);
expect(el.style.transform).to.equal('translate3d(0px, 0px, 0px) scale(5)');
});

View File

@ -578,9 +578,8 @@ describe('GridLayer', () => {
map.fire('_frame');
Util.requestAnimFrame(_runFrames(n - 1));
};
} else {
return Util.falseFn;
}
return Util.falseFn;
}
it('Loads 32, unloads 16 tiles zooming in 10-11', (done) => {

View File

@ -202,9 +202,8 @@ describe('TileLayer', () => {
map.fire('_frame');
Util.requestAnimFrame(_runFrames(n - 1));
};
} else {
return Util.falseFn;
}
return Util.falseFn;
}
beforeEach(() => {