Skip to content

Commit

Permalink
fix: Upgrade to eslint9 (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
GZolla authored Oct 31, 2024
1 parent b4214de commit 3a35268
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 21 deletions.
9 changes: 0 additions & 9 deletions .eslintrc.json

This file was deleted.

31 changes: 31 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { fileURLToPath } from 'node:url';
import { FlatCompat } from '@eslint/eslintrc';
import globals from 'globals';
import js from '@eslint/js';
import path from 'node:path';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
export default [...compat.extends('brightspace/browser-config'), {
languageOptions: {
globals: {
...globals.node,
},
},

rules: {
'no-empty': ['error', {
allowEmptyCatch: true,
}],
},
},
...compat.extends('brightspace/testing-config').map(c => ({
...c,
files: ['test/**/*']
}))
];
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@
"devDependencies": {
"@babel/core": "^7",
"@babel/eslint-parser": "^7",
"@eslint/compat": "^1",
"@eslint/eslintrc": "^3",
"@eslint/js": "^9",
"globals": "^15",
"chai": "^4",
"chai-as-promised": "^8",
"eslint": "^8",
"eslint-config-brightspace": "^1.0",
"eslint": "^9",
"eslint-config-brightspace": "^1.2.1",
"eslint-plugin-html": "^8",
"eslint-plugin-import": "^2",
"eslint-plugin-sort-class-members": "^1",
Expand Down
2 changes: 1 addition & 1 deletion plugins/sync-css-variable/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function hostSyncCssVariable(host) {
return JSON.parse(
htmlElems[0].getAttribute('data-css-vars')
);
} catch (e) {}
} catch {}
}
return {};
});
Expand Down
2 changes: 1 addition & 1 deletion plugins/sync-intl/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function hostSyncIntl(host) {
return JSON.parse(
htmlElems[0].getAttribute('data-intl-overrides')
);
} catch (e) {}
} catch {}
}
return {};
});
Expand Down
2 changes: 1 addition & 1 deletion plugins/sync-oslo/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function hostSyncOslo(host) {
osloData.collection = new window.URL(osloData.collection, window.location.origin).href;

return osloData;
} catch (e) {}
} catch {}
}
return;
});
Expand Down
2 changes: 1 addition & 1 deletion plugins/sync-timezone/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function hostSyncTimezone(host) {
return JSON.parse(
htmlElems[0].getAttribute('data-timezone')
);
} catch (e) {}
} catch {}
}
return {
identifier: '',
Expand Down
6 changes: 0 additions & 6 deletions test/.eslintrc.json

This file was deleted.

0 comments on commit 3a35268

Please sign in to comment.