Files
smpp-js/eslint.config.js
lilleman bf1bddba3b
Mirror / push (push) Has been cancelled
Test / lint (pull_request) Successful in 21s
Test / test (18) (pull_request) Successful in 29s
Test / test (20) (pull_request) Successful in 29s
Test / test (22) (pull_request) Successful in 30s
Test / test (24) (pull_request) Successful in 29s
Test / test (26) (pull_request) Successful in 34s
Name files for what they export, and move the session files into session/
2026-09-30 20:33:13 +02:00

56 lines
1.6 KiB
JavaScript

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{ ignores: ['dist/', 'dist-test/'] },
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/no-floating-promises': ['error', {
allowForKnownSafeCalls: [
{ from: 'package', name: ['describe', 'it', 'test'], package: 'node:test' },
],
}],
'@typescript-eslint/no-non-null-assertion': 'error',
'no-console': 'error',
},
},
{
files: ['src/**/*.ts'],
rules: {
complexity: ['error', 10],
'max-lines': ['error', { max: 350, skipBlankLines: true, skipComments: true }],
'max-lines-per-function': ['error', { max: 40, skipBlankLines: true, skipComments: true }],
'max-params': ['error', 5],
},
},
{
// The spec tables are data: their length tracks the specification, not any complexity.
files: ['src/codec/{commands,constants,encodings,errors,tlvs,types}.ts'],
rules: { 'max-lines': 'off' },
},
{
// ESLint counts every ?. and ?? in dlrFromPdu as a branch; the 19 is 26 lines of flat field resolution.
files: ['src/protocol/dlr.ts'],
rules: { complexity: ['error', 19] },
},
{
// ESC (0x1B) is the GSM 03.38 escape character, so it belongs in these patterns.
files: ['src/codec/encodings.ts'],
rules: { 'no-control-regex': 'off' },
},
{
files: ['eslint.config.js'],
extends: [tseslint.configs.disableTypeChecked],
},
);