feat: 更新eslint配置
This commit is contained in:
@@ -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: '_' }],
|
||||
},
|
||||
},
|
||||
);
|
||||
+1
-1
@@ -23,6 +23,6 @@ App<IAppOption>({
|
||||
},
|
||||
});
|
||||
|
||||
const a = '1';
|
||||
const a = '123';
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "doodle-mini",
|
||||
"type": "module",
|
||||
"version": "2.0.0",
|
||||
"description": "",
|
||||
"scripts": {},
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"projectname": "doodle-mini",
|
||||
"setting": {
|
||||
"compileHotReLoad": true
|
||||
}
|
||||
},
|
||||
"libVersion": "2.32.3"
|
||||
}
|
||||
Reference in New Issue
Block a user