浏览代码

ref: eslint config type

Sv443 7 月之前
父节点
当前提交
7ea2941eba
共有 2 个文件被更改,包括 5 次插入3 次删除
  1. 4 2
      eslint.config.mjs
  2. 1 1
      package.json

+ 4 - 2
eslint.config.mjs

@@ -16,7 +16,8 @@ const compat = new FlatCompat({
   allConfig: js.configs.all,
 });
 
-export default [
+/** @type {import("eslint").Linter.Config} */
+const config = [
   {
     ignores: [
       "**/*.min.*",
@@ -44,7 +45,6 @@ export default [
         GM: "readonly",
         unsafeWindow: "writable",
       },
-
       parser: tsParser,
       ecmaVersion: "latest",
       sourceType: "module",
@@ -99,3 +99,5 @@ export default [
     },
   },
 ];
+
+export default config;

+ 1 - 1
package.json

@@ -9,7 +9,7 @@
   "scripts": {
     "dev": "concurrently \"nodemon --exec pnpm run build-private-dev\" \"pnpm run serve\"",
     "serve": "pnpm run node-ts ./src/tools/serve.ts",
-    "lint": "tsc --noEmit && eslint .",
+    "lint": "eslint . && tsc --noEmit",
     "build": "rollup -c",
     "build-private-dev": "rollup -c --config-mode development --config-host github --config-branch develop --config-assetSource=local",
     "build-dev": "rollup -c --config-mode development --config-host github --config-branch develop",