mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add eslint rules for consistent naming
This commit is contained in:
parent
2564902573
commit
f9092e0678
1 changed files with 38 additions and 0 deletions
38
.eslintrc.js
38
.eslintrc.js
|
@ -273,6 +273,44 @@ module.exports = {
|
||||||
__WEBPACK_SERVE__: 'readonly'
|
__WEBPACK_SERVE__: 'readonly'
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
'@typescript-eslint/naming-convention': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
selector: 'default',
|
||||||
|
format: [ 'camelCase', 'PascalCase' ],
|
||||||
|
leadingUnderscore: 'allow'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: 'variable',
|
||||||
|
format: [ 'camelCase', 'PascalCase', 'UPPER_CASE' ],
|
||||||
|
leadingUnderscore: 'allowSingleOrDouble',
|
||||||
|
trailingUnderscore: 'allowSingleOrDouble'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: 'typeLike',
|
||||||
|
format: [ 'PascalCase' ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: 'enumMember',
|
||||||
|
format: [ 'PascalCase', 'UPPER_CASE' ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: [ 'objectLiteralProperty', 'typeProperty' ],
|
||||||
|
format: [ 'camelCase', 'PascalCase' ],
|
||||||
|
leadingUnderscore: 'allowSingleOrDouble',
|
||||||
|
trailingUnderscore: 'allowSingleOrDouble'
|
||||||
|
},
|
||||||
|
// Ignore numbers, locale strings (en-us), aria/data attributes, CSS selectors,
|
||||||
|
// and api_key parameter
|
||||||
|
{
|
||||||
|
selector: [ 'objectLiteralProperty', 'typeProperty' ],
|
||||||
|
format: null,
|
||||||
|
filter: {
|
||||||
|
regex: '[ &\\-]|^([0-9]+)$|^api_key$',
|
||||||
|
match: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
'@typescript-eslint/prefer-string-starts-ends-with': ['error']
|
'@typescript-eslint/prefer-string-starts-ends-with': ['error']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue