Skip to content

Commit 0520a8d

Browse files
ajwildmarcbachmann
authored andcommitted
fix(eslint): Use new globals config structure
1 parent 7f510f6 commit 0520a8d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

eslint.config.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ const {
66

77
const globals = require('globals')
88

9+
function toNewGlobalsConfig (obj) {
10+
for (const key in obj) {
11+
if (obj[key] === true) obj[key] = 'writable'
12+
else if (obj[key] === false) obj[key] = 'readonly'
13+
}
14+
return obj
15+
}
16+
917
module.exports = [
1018
{
1119
ignores: [
@@ -22,7 +30,7 @@ module.exports = [
2230
},
2331

2432
languageOptions: {
25-
globals: {
33+
globals: toNewGlobalsConfig({
2634
...globals.browser,
2735
...globals.node,
2836
...globals.jasmine,
@@ -33,7 +41,7 @@ module.exports = [
3341
test: true,
3442
sinon: true,
3543
angular: true
36-
},
44+
}),
3745

3846
ecmaVersion: 2021,
3947
sourceType: 'module',

0 commit comments

Comments
 (0)