Skip to content

Commit

Permalink
chore(permission-controller): Fix package eslintrc
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks committed Jul 12, 2024
1 parent 085e636 commit a45cc50
Showing 1 changed file with 58 additions and 4 deletions.
62 changes: 58 additions & 4 deletions packages/permission-controller/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,71 @@ module.exports = {
rules: {
'@typescript-eslint/naming-convention': [
'error',
// We have to disable the default selector, or it doesn't work.
// {
// selector: 'default',
// format: ['camelCase'],
// leadingUnderscore: 'allow',
// trailingUnderscore: 'forbid',
// },
{
selector: 'enumMember',
format: ['PascalCase'],
},
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: false,
},
},
{
selector: 'objectLiteralMethod',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
},
{
selector: 'objectLiteralProperty',
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
filter: {
regex: '^[a-z][a-zA-Z0-9]*_w+$',
// Match RPC method names like foo_bar, foo_barBaz, etc., and metamask.io
regex: '(^[a-z]+_[a-z]+[a-zA-Z0-9]*)|metamask\\.io$',
match: false,
},
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: 'typeParameter',
format: ['PascalCase'],
custom: {
regex: '^.{3,}',
match: true,
},
},
{
selector: 'objectLiteralProperty',
selector: 'variable',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
leadingUnderscore: 'allow',
},
{
selector: 'parameter',
format: ['camelCase', 'PascalCase'],
leadingUnderscore: 'allow',
},
{
selector: [
'classProperty',
'objectLiteralProperty',
'typeProperty',
'classMethod',
'objectLiteralMethod',
'typeMethod',
'accessor',
'enumMember',
],
format: null,
modifiers: ['requiresQuotes'],
},
Expand Down

0 comments on commit a45cc50

Please sign in to comment.