From 7d41858bab07730694c36b551bb474065b1fca07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 10 Jun 2025 03:59:27 +0200 Subject: [PATCH] tools: Switch to flat config for eslint Both the .json and .yml config formats are deprecated in favor of flat configs exported from eslint.config.js files. The good news is that gjs' config is now available as a shared config from the `eslint-config-gnome` package in World/javascript, so we no longer have to copy the entire thing. Part-of: --- eslint.config.js | 1 + tools/eslint.config.js | 37 +++++++++++++++++++++++++++++++++++++ tools/package-lock.json | Bin 61024 -> 61448 bytes tools/package.json | 2 +- 4 files changed, 39 insertions(+), 1 deletion(-) create mode 120000 eslint.config.js create mode 100644 tools/eslint.config.js diff --git a/eslint.config.js b/eslint.config.js new file mode 120000 index 00000000..8e6e2c0d --- /dev/null +++ b/eslint.config.js @@ -0,0 +1 @@ +tools/eslint.config.js \ No newline at end of file diff --git a/tools/eslint.config.js b/tools/eslint.config.js new file mode 100644 index 00000000..27df2ce6 --- /dev/null +++ b/tools/eslint.config.js @@ -0,0 +1,37 @@ +// SPDX-FileCopyrightText: 2025 Florian Müllner +// SPDX-License-Identifier: MIT OR LGPL-2.0-or-later + +import {defineConfig} from '@eslint/config-helpers'; +import gnome from 'eslint-config-gnome'; + +export default defineConfig([ + gnome.configs.recommended, + gnome.configs.jsdoc, + { + rules: { + camelcase: ['error', { + properties: 'never', + }], + 'consistent-return': 'error', + 'eqeqeq': ['error', 'smart'], + 'key-spacing': ['error', { + mode: 'minimum', + beforeColon: false, + afterColon: true, + }], + 'prefer-arrow-callback': 'error', + 'jsdoc/require-param-description': 'off', + 'jsdoc/require-jsdoc': ['error', { + exemptEmptyFunctions: true, + publicOnly: { + esm: true, + }, + }], + }, + languageOptions: { + globals: { + global: 'readonly', + }, + }, + }, +]); diff --git a/tools/package-lock.json b/tools/package-lock.json index 5c3647450c37ac3c1ef8be91c61d1105461b8599..25e08d2d1ebeb162d403c34c43d84e85859c5da3 100644 GIT binary patch delta 237 zcmaEGhq>bc^M+nVp5*+zw9Itf^t}As)XCs>6w!aIn+0wX3XcF zoL%WU`7O7~=Iy+XSSMM^PW~qtx>;VNIF1`h$K=B45|jF*CvSJqbHHw1iE^@uxn+uh zsb#7~ie+k|rDd{llBsdBQEH-zabi-Md0I-6foW=zso`WsH3=RC{~!e)_W&PVBR#{3 ze|0C@a&t_s&0(LsK1YDjXmX>6FrR)_v67X7Qk