From c7341a736d169ac6df9036407d485e4268d85721 Mon Sep 17 00:00:00 2001 From: yuntian001 Date: Sun, 8 Jan 2023 19:10:20 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20eslint=20name=20=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E8=A7=84=E5=88=99=E6=9B=B4=E5=AE=BD=E6=9D=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.cjs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 44178d99..ace1fe06 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -62,10 +62,10 @@ module.exports = { { selector: 'default', format: ['camelCase'], - leadingUnderscore: 'allow', + leadingUnderscore: 'allowSingleOrDouble', filter: { // you can expand this regex to add more allowed names - regex: '^((__v_.*)|([0-9]+)|(__.*))$', + regex: '^((__v_.*)|([0-9]+))$', match: false, }, }, @@ -73,31 +73,27 @@ module.exports = { selector: 'variable', modifiers: ['const'], format: ['camelCase', 'UPPER_CASE', 'PascalCase'], - leadingUnderscore: 'allow', - filter: { - // you can expand this regex to add more allowed names - regex: '^__.*$', - match: false, - }, + leadingUnderscore: 'allowSingleOrDouble', }, { selector: ['memberLike'], format: ['camelCase', 'PascalCase'], - leadingUnderscore: 'allow', + leadingUnderscore: 'allowSingleOrDouble', filter: { // you can expand this regex to add more allowed names - regex: '^((__v_.*)|[0-9]+)$', + regex: '^((__v_.*)|([0-9]+))$', match: false, }, }, { selector: 'enumMember', - format: ['UPPER_CASE'], + format: ['camelCase', 'PascalCase', 'UPPER_CASE'], + leadingUnderscore: 'allowSingleOrDouble', }, { - selector: 'typeLike', + selector: ['typeLike', 'enum'], format: ['PascalCase'], - leadingUnderscore: 'allow', + leadingUnderscore: 'allowSingleOrDouble', }, { selector: ['default'],