jellyfin-sdk-typescript/.eslintrc.cjs

85 lines
2.3 KiB
JavaScript
Raw Normal View History

2021-08-29 05:00:52 +00:00
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
2021-09-16 04:26:02 +00:00
'@typescript-eslint',
'import'
2021-08-29 05:00:52 +00:00
],
2021-09-16 04:15:47 +00:00
env: {
node: true
},
2021-08-29 05:00:52 +00:00
extends: [
'eslint:recommended',
2021-09-16 04:26:02 +00:00
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript'
2021-08-29 05:00:52 +00:00
],
2021-09-16 04:15:47 +00:00
rules: {
2021-09-16 04:26:02 +00:00
'import/order': ['error', {
'alphabetize': { 'order': 'asc', 'caseInsensitive': true },
'newlines-between': 'always-and-inside-groups'
}],
2021-09-16 04:15:47 +00:00
'array-callback-return': ['error'],
2021-10-04 16:51:08 +00:00
'arrow-spacing': ['error'],
2021-09-16 04:15:47 +00:00
'block-spacing': ['error'],
'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
'comma-dangle': ['error', 'never'],
'comma-spacing': ['error'],
'curly': ['error', 'multi-line'],
2021-09-16 04:15:47 +00:00
'eol-last': ['error'],
'indent': ['error', 'tab', { 'SwitchCase': 1 }],
'jsx-quotes': ['error', 'prefer-single'],
2021-09-24 12:56:40 +00:00
'key-spacing': ['error'],
2021-09-16 04:15:47 +00:00
'keyword-spacing': ['error'],
'max-statements-per-line': ['error'],
'no-floating-decimal': ['error'],
'no-multi-spaces': ['error'],
'no-multiple-empty-lines': ['error', { 'max': 1 }],
'no-restricted-globals': ['error'],
'no-trailing-spaces': ['error'],
2021-09-17 15:00:46 +00:00
'no-unreachable': ['error'],
2021-09-16 04:15:47 +00:00
'no-unused-expressions': ['error', { 'allowShortCircuit': true, 'allowTernary': true, 'allowTaggedTemplates': true }],
2021-10-04 16:51:08 +00:00
'object-curly-spacing': ['error', 'always'],
2021-09-16 04:15:47 +00:00
'one-var': ['error', 'never'],
'padded-blocks': ['error', 'never'],
2021-10-04 16:51:08 +00:00
'prefer-const': ['error', { 'destructuring': 'all' }],
2021-09-16 04:15:47 +00:00
'quotes': ['error', 'single', { 'avoidEscape': true, 'allowTemplateLiterals': false }],
'semi': ['error'],
'no-var': ['error'],
'space-before-blocks': ['error'],
'space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always' }],
'space-infix-ops': 'error',
2021-09-24 12:56:40 +00:00
'@typescript-eslint/type-annotation-spacing': ['error'],
2021-09-16 04:15:47 +00:00
'yoda': 'error'
},
overrides: [
{
2021-09-16 17:12:53 +00:00
files: [ './src/**' ],
2021-09-16 04:15:47 +00:00
env: {
node: false,
browser: true
}
2021-09-16 17:12:53 +00:00
},
{
files: [ './**/*.test.ts' ],
plugins: [ 'jest' ],
env: {
node: false,
browser: false,
'jest/globals': true
},
extends: [
'plugin:jest/recommended',
'plugin:jest/style'
],
rules: {
'jest/consistent-test-it': [ 'error' ],
2021-10-12 13:27:49 +00:00
'jest/prefer-lowercase-title': [ 'error', { 'ignoreTopLevelDescribe': true } ],
2021-09-16 17:12:53 +00:00
'jest/require-top-level-describe': [ 'error' ]
}
2021-09-16 04:15:47 +00:00
}
]
2021-08-29 05:00:52 +00:00
};