jellyfin-sdk-typescript/.eslintrc.cjs

86 lines
2.4 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',
2024-02-24 02:49:00 +00:00
'import',
'vitest'
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'
}],
2023-03-23 20:57:02 +00:00
'@typescript-eslint/consistent-type-imports': ['error'],
'@typescript-eslint/type-annotation-spacing': ['error'],
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',
'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' ],
2024-02-24 02:49:00 +00:00
plugins: [ 'vitest' ],
2021-09-16 17:12:53 +00:00
env: {
2024-02-24 02:49:00 +00:00
node: true,
2021-09-16 17:12:53 +00:00
browser: false,
},
extends: [
2024-02-24 02:49:00 +00:00
'plugin:vitest/recommended'
2021-09-16 17:12:53 +00:00
],
rules: {
2024-02-24 02:49:00 +00:00
'vitest/consistent-test-it': [ 'error' ],
'vitest/prefer-lowercase-title': [ 'error', { 'ignoreTopLevelDescribe': true } ],
'vitest/require-top-level-describe': [ 'error' ]
2021-09-16 17:12:53 +00:00
}
2021-09-16 04:15:47 +00:00
}
]
2021-08-29 05:00:52 +00:00
};