node-pkware
Version:
node.js implementation of StormLib's pkware compressor/de-compressor
88 lines (84 loc) • 3.52 kB
text/typescript
import unusedImports from 'eslint-plugin-unused-imports'
import type { FlatXoConfig } from 'xo'
const xoConfig: FlatXoConfig = {
space: true,
semicolon: false,
prettier: true,
plugins: {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- god knows why this keeps coming back...
'unused-imports': unusedImports,
},
files: ['xo.config.ts', 'src/**/*.ts'],
rules: {
'capitalized-comments': 'off',
'no-bitwise': 'off',
'no-warning-comments': 'off',
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/ban-types': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/no-static-only-class': 'off',
'unicorn/prefer-math-trunc': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prevent-abbreviations': 'off',
curly: ['error', 'all'],
'func-style': ['error', 'declaration'],
'no-use-before-define': ['error', { functions: true, classes: true, variables: true, allowNamedExports: false }],
'@typescript-eslint/naming-convention': [
'error',
{ selector: 'variable', format: ['camelCase', 'UPPER_CASE', 'PascalCase'] },
],
'@typescript-eslint/class-literal-property-style': ['error', 'fields'],
'@typescript-eslint/prefer-literal-enum-member': ['error', { allowBitwiseExpressions: true }],
'@typescript-eslint/consistent-type-imports': [
'error',
{ fixStyle: 'separate-type-imports', prefer: 'type-imports' },
],
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/array-type': [
'error',
{
default: 'array-simple',
},
],
'@typescript-eslint/parameter-properties': ['error', { prefer: 'class-property' }],
'operator-assignment': ['error', 'never'],
'logical-assignment-operators': ['error', 'never'],
'@typescript-eslint/no-inferrable-types': ['error', { ignoreParameters: true, ignoreProperties: true }],
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
'unicorn/prefer-ternary': 'off',
'no-ternary': 'error',
'no-await-in-loop': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'unicorn/prefer-number-properties': ['error', { checkInfinity: true, checkNaN: true }],
'unused-imports/no-unused-imports': 'error',
'guard-for-in': 'off',
'arrow-body-style': ['error', 'always'],
'@typescript-eslint/unified-signatures': 'off',
'unicorn/no-for-loop': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'object-shorthand': ['error', 'always', { avoidQuotes: true }],
'@typescript-eslint/no-import-type-side-effects': 'error',
'unicorn/prefer-string-raw': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'require-await': 'off',
'@typescript-eslint/require-await': 'error',
'no-return-await': 'off',
'@typescript-eslint/return-await': ['error', 'always'],
'no-plusplus': [
'error',
{
allowForLoopAfterthoughts: true,
},
],
'no-implicit-coercion': 'off',
// TODO: check these rules out and remove them in the future if that's viable
'@typescript-eslint/no-restricted-types': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'unicorn/no-this-assignment': 'off',
'@typescript-eslint/no-this-alias': 'off',
},
}
export default xoConfig