Skip to content

Commit

Permalink
Allowing two dashes properties on naming-convention (#174)
Browse files Browse the repository at this point in the history
Co-authored-by: Sinesio Couceiro <[email protected]>
  • Loading branch information
strikkerpt and SinesioMM authored Dec 8, 2023
1 parent 6cfdea6 commit 2374aff
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 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,14 @@ module.exports = {
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'objectLiteralProperty',
format: [],
filter: {
regex: '^--',
match: true,
},
},
],
},
};
8 changes: 8 additions & 0 deletions packages/eslint-config-typescript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ module.exports = {
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'objectLiteralProperty',
format: [],
filter: {
regex: '^--',
match: true,
},
},
],
'@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,
};

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

0 comments on commit 2374aff

Please sign in to comment.