diff --git a/packages/eslint-config-typescript-react/index.js b/packages/eslint-config-typescript-react/index.js index f8d7da8..3028875 100644 --- a/packages/eslint-config-typescript-react/index.js +++ b/packages/eslint-config-typescript-react/index.js @@ -25,6 +25,15 @@ module.exports = { leadingUnderscore: 'forbid', trailingUnderscore: 'forbid', }, + { + selector: 'property', + format: ['strictCamelCase'], + leadingUnderscore: 'allow', + filter: { + regex: '^--', + match: false + } + }, ], }, }; diff --git a/packages/eslint-config-typescript/index.js b/packages/eslint-config-typescript/index.js index 7fb62ac..4d5dc7f 100644 --- a/packages/eslint-config-typescript/index.js +++ b/packages/eslint-config-typescript/index.js @@ -51,6 +51,15 @@ module.exports = { leadingUnderscore: 'forbid', trailingUnderscore: 'forbid', }, + { + selector: 'property', + format: ['strictCamelCase'], + leadingUnderscore: 'allow', + filter: { + regex: '^--', + match: false + } + }, ], '@typescript-eslint/no-confusing-void-expression': 'error', '@typescript-eslint/no-magic-numbers': 'off', diff --git a/packages/test-eslint-config-typescript/index.ts b/packages/test-eslint-config-typescript/index.ts index 81da0c4..4b87b2d 100644 --- a/packages/test-eslint-config-typescript/index.ts +++ b/packages/test-eslint-config-typescript/index.ts @@ -55,3 +55,11 @@ sayCheese(undefined, 'Sandwich'); function functionWithParameter(value: MyInterface): string { return value.a + value.b; } + +function twoDashProperty(): boolean { + const myObject = { + '--my-property': true, + } + + return myObject['--my-property']; +} \ No newline at end of file