From 277477dd9b9f6e79df934832e2264111e43f388a Mon Sep 17 00:00:00 2001 From: zhangyi Date: Fri, 14 Mar 2025 17:37:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0eslint=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eslint.config.mjs => eslint.config.cccmjs | 0 eslint.config.js | 41 +++++++++++++++++++++++ miniprogram/app.ts | 2 +- package.json | 1 + project.private.config.json | 3 +- 5 files changed, 45 insertions(+), 2 deletions(-) rename eslint.config.mjs => eslint.config.cccmjs (100%) create mode 100644 eslint.config.js diff --git a/eslint.config.mjs b/eslint.config.cccmjs similarity index 100% rename from eslint.config.mjs rename to eslint.config.cccmjs diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..be17cf2 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,41 @@ +import js from '@eslint/js'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; +import pluginJs from '@eslint/js'; +import pluginPrettier from 'eslint-plugin-prettier'; + +export default tseslint.config( + { ignores: ['dist'] }, + { + extends: [js.configs.recommended, ...tseslint.configs.recommended], + files: ['**/*.{ts,tsx}'], + languageOptions: { + ecmaVersion: 2020, + globals: { + ...globals.browser, + ...globals.node, + ...globals.es2021, + wx: true, + App: true, + Page: true, + getCurrentPages: true, + getApp: true, + Component: true, + requirePlugin: true, + requireMiniProgram: true, + }, + }, + plugins: { + ...pluginJs.configs.recommended, + pluginPrettier, + }, + rules: { + // 'prettier/prettier': 'error', + 'no-console': 'off', + '@typescript-eslint/no-require-imports': 'warn', + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/ban-ts-comment': 'off', + 'no-unused-vars': ['error', { vars: 'all', varsIgnorePattern: '_', args: 'after-used', argsIgnorePattern: '_' }], + }, + }, +); diff --git a/miniprogram/app.ts b/miniprogram/app.ts index 0263689..754e303 100644 --- a/miniprogram/app.ts +++ b/miniprogram/app.ts @@ -23,6 +23,6 @@ App({ }, }); - const a = '1'; + const a = '123'; }, }); diff --git a/package.json b/package.json index dc3540e..cce9b27 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "doodle-mini", + "type": "module", "version": "2.0.0", "description": "", "scripts": {}, diff --git a/project.private.config.json b/project.private.config.json index 6172c3b..9004480 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -3,5 +3,6 @@ "projectname": "doodle-mini", "setting": { "compileHotReLoad": true - } + }, + "libVersion": "2.32.3" } \ No newline at end of file