Skip to content

Commit

Permalink
Allowing two dashes properties on naming-convention
Browse files Browse the repository at this point in the history
  • Loading branch information
SinesioMM committed Oct 17, 2023
1 parent 05e0480 commit 54646ed
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/eslint-config-typescript-react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ module.exports = {
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'property',
format: ['strictCamelCase'],
leadingUnderscore: 'allow',
filter: {
regex: '^--',
match: false
}
},
],
},
};
9 changes: 9 additions & 0 deletions packages/eslint-config-typescript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
8 changes: 8 additions & 0 deletions packages/test-eslint-config-typescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Check failure on line 61 in packages/test-eslint-config-typescript/index.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Object Literal Property name `--my-property` must match one of the following formats: strictCamelCase

Check failure on line 61 in packages/test-eslint-config-typescript/index.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Object Literal Property name `--my-property` must match one of the following formats: strictCamelCase
}

return myObject['--my-property'];
}

0 comments on commit 54646ed

Please sign in to comment.