diff --git a/.eslintrc.js b/.eslintrc.js index c5d2ac60cf..9b91d234fa 100755 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -144,11 +144,28 @@ const tsRules = Object.assign({}, jsRules, { selector: 'variableLike', format: ['camelCase', 'PascalCase', 'snake_case', 'UPPER_CASE'], }, - {selector: 'memberLike', format: ['camelCase', 'PascalCase', 'snake_case']}, {selector: 'typeLike', format: ['PascalCase']}, + { + selector: 'memberLike', + format: ['camelCase', 'PascalCase', 'snake_case'], + leadingUnderscore: 'allowSingleOrDouble', + trailingUnderscore: 'allowSingleOrDouble', + filter: { + // Allow snake_case with in-between double underscores + regex: '^([a-zA-Z]+(?:_{1,2}[a-zA-Z]+)*)$', + match: false, + }, + }, { selector: 'property', format: ['camelCase', 'PascalCase', 'snake_case', 'UPPER_CASE'], + leadingUnderscore: 'allowSingleOrDouble', + trailingUnderscore: 'allowSingleOrDouble', + filter: { + // Allow snake_case with in-between double underscores + regex: '^([a-zA-Z]+(?:_{1,2}[a-zA-Z]+)*)$', + match: false, + }, }, {selector: 'method', format: ['camelCase']}, {