refactor: Update ESLint configuration to use latest ECMAScript version and warn about indentation

This commit is contained in:
Harvey Zack committed 2024-05-26 20:01:27 +08:00
1 parent 2b8c1e2d32
commit c08798fb05
2 files changed
+18 -16

No files matched your search

+2 -2
View File
@@ -5,7 +5,7 @@ export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2021,
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
@@ -14,7 +14,7 @@ export default [
},
rules: {
'no-console': 'off',
indent: ['error', 4],
indent: ['warn', 4],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
semi: ['error', 'always'],
@@ -63,20 +63,22 @@ export default class Setting {
art.on('fullscreenWeb', (state) => this.onFullscreen(state));
}
static icons = {
$on,
$off,
$config,
$style,
$mode_0_off,
$mode_0_on,
$mode_1_off,
$mode_1_on,
$mode_2_off,
$mode_2_on,
$check_on,
$check_off,
};
static get icons() {
return {
$on,
$off,
$config,
$style,
$mode_0_off,
$mode_0_on,
$mode_1_off,
$mode_1_on,
$mode_2_off,
$mode_2_on,
$check_on,
$check_off,
};
}
get option() {
return this.danmuku.option;