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