UNPKG

scandit-sdk

Version:

Scandit Barcode Scanner SDK for the Web

392 lines (390 loc) 9.73 kB
{ "rulesDirectory": [ "node_modules/tslint-misc-rules/rules", "node_modules/tslint-microsoft-contrib", "node_modules/tslint-eslint-rules/dist/rules" ], "extends": [ "tslint:recommended", "tslint-microsoft-contrib", "tslint-eslint-rules", "tslint-config-prettier", "tslint-sonarts" ], "linterOptions": { "exclude": ["src/types/**/*"] }, "rules": { // ----- // tslint-misc-rules // ----- "prefer-es6-imports": true, "class-method-newlines": true, "prefer-or-operator-over-ternary": true, // ----- // tslint-eslint-rules // ----- "array-bracket-spacing": [true, "never"], "block-spacing": [true, "always"], "brace-style": [ true, "1tbs", { "allowSingleLine": false } ], // ter-max-len already handled by max-line-length rule "object-curly-spacing": [true, "always"], "space-in-parens": [true, "never"], "ter-arrow-body-style": [true, "always"], "ter-arrow-parens": [true, "as-needed"], "ter-arrow-spacing": [true], "ter-prefer-arrow-callback": [true], "no-constant-condition": true, "no-control-regex": true, "no-duplicate-switch-case": true, "no-empty-character-class": true, "no-ex-assign": true, "no-extra-boolean-cast": true, "no-extra-semi": true, "no-inner-declarations": [true, "both"], "no-invalid-regexp": true, // no-irregular-whitespace handled by no-irregular-whitespace rule "no-regex-spaces": true, "no-unexpected-multiline": true, "valid-jsdoc": { "severity": "warning", "options": { "requireReturn": false, "prefer": { "arg": "param", "argument": "param", "class": "constructor", "return": "returns", "virtual": "abstract" }, "requireParamType": false, "requireReturnType": false, "requireParamDescription": true, "requireReturnDescription": true } }, "no-multi-spaces": true, // ----- // custom - various // ----- "cyclomatic-complexity": false, "no-any": true, "no-unsafe-any": false, "completed-docs": false, "no-void-expression": false, "no-console": [false], "comment-format": [true, "check-space"], "max-line-length": [true, 120], "member-ordering": [ true, { "order": [ "public-static-field", "protected-static-field", "private-static-field", "public-instance-field", "protected-instance-field", "private-instance-field", "constructor", "public-static-method", "protected-static-method", "private-static-method", "public-instance-method", "protected-instance-method", "private-instance-method" ] } ], "only-arrow-functions": [true, "allow-declarations"], "typedef": [ true, "call-signature", "parameter", "property-declaration", "variable-declaration", "member-variable-declaration" ], "typedef-whitespace": [ true, { "call-signature": "nospace", "index-signature": "nospace", "parameter": "nospace", "property-declaration": "nospace", "variable-declaration": "nospace" }, { "call-signature": "space", "index-signature": "space", "parameter": "space", "property-declaration": "space", "variable-declaration": "space" } ], "variable-name": [true, "ban-keywords", "check-format"], "one-line": [true, "check-open-brace", "check-catch", "check-else", "check-finally", "check-whitespace"], "interface-name": [true, "never-prefix"], "no-import-side-effect": [ true, { "ignore-pattern": "/rxjs.*/" } ], "no-invalid-this": false, "no-parameter-properties": false, "promise-function-async": false, "no-submodule-imports": [true, "ava", "howler", "webrtc-adapter"], "no-parameter-reassignment": false, "switch-final-break": [true, "always"], // ----- // custom - tslint-microsoft-contrib // ----- "import-name": false, // TODO: Currently broken "no-string-based-set-timeout": false, // TODO: Currently broken "max-func-body-length": [ true, 100, { "ignore-comments": true } ], "no-cookies": false, "no-relative-imports": false, "no-stateless-class": false, "export-name": false, "no-increment-decrement": false, "no-backbone-get-set-outside-model": false, "no-null-keyword": false, "function-name": [ true, { "method-regex": "^[a-z][\\w\\d]+$", "private-method-regex": "^[a-z][\\w\\d]+$", "static-method-regex": "^[a-z][\\w\\d]+$", "function-regex": "^[a-z][\\w\\d]+$" } ], "no-suspicious-comment": { "severity": "warning" }, // ----- // custom - tslint-sonarts // ----- "arguments-order": { "severity": "warning" }, "bool-param-default": { "severity": "warning" }, "cognitive-complexity": { "severity": "warning", "options": [20] }, "consecutive-overloads": { "severity": "warning" }, "max-switch-cases": { "severity": "warning" }, "max-union-size": { "severity": "warning", "options": [5] }, "mccabe-complexity": { "severity": "warning", "options": [15] }, "no-accessor-field-mismatch": { "severity": "warning" }, "no-all-duplicated-branches": { "severity": "warning" }, "no-alphabetical-sort": { "severity": "warning" }, "no-array-delete": { "severity": "warning" }, "no-big-function": false, // Already covered by max-func-body-length "no-case-with-or": { "severity": "warning" }, "no-collapsible-if": { "severity": "warning" }, "no-collection-size-mischeck": { "severity": "warning" }, "no-commented-code": { "severity": "warning" }, "no-dead-store": { "severity": "warning" }, "no-duplicate-in-composite": { "severity": "warning" }, "no-duplicate-string": { "severity": "warning" }, "no-duplicated-branches": { "severity": "warning" }, "no-element-overwrite": { "severity": "warning" }, "no-empty-array": { "severity": "warning" }, "no-empty-destructuring": { "severity": "warning" }, "no-empty-nested-blocks": { "severity": "warning" }, "no-extra-semicolon": { "severity": "warning" }, "no-gratuitous-expressions": { "severity": "warning" }, "no-hardcoded-credentials": { "severity": "warning" }, "no-identical-conditions": { "severity": "warning" }, "no-identical-expressions": { "severity": "warning" }, "no-identical-functions": { "severity": "warning" }, "no-ignored-initial-value": { "severity": "warning" }, "no-ignored-return": { "severity": "warning" }, "no-in-misuse": { "severity": "warning" }, "no-inconsistent-return": { "severity": "warning" }, "no-invalid-await": { "severity": "warning" }, "no-invariant-return": { "severity": "warning" }, "no-inverted-boolean-check": { "severity": "warning" }, "no-misleading-array-reverse": { "severity": "warning" }, "no-misspelled-operator": { "severity": "warning" }, "no-multiline-string-literals": { "severity": "warning" }, "no-nested-incdec": false, "no-nested-switch": { "severity": "warning" }, "no-nested-template-literals": { "severity": "warning" }, "no-redundant-boolean": { "severity": "warning" }, "no-redundant-jump": { "severity": "warning" }, "no-redundant-parentheses": { "severity": "warning" }, "no-return-type-any": false, // Already covered by no-any "no-same-line-conditional": { "severity": "warning" }, "no-self-assignment": { "severity": "warning" }, "no-small-switch": { "severity": "warning" }, "no-statements-same-line": { "severity": "warning" }, "no-try-promise": { "severity": "warning" }, "no-unconditional-jump": { "severity": "warning" }, "no-undefined-argument": { "severity": "warning" }, "no-unenclosed-multiline-block": { "severity": "warning" }, "no-unthrown-error": { "severity": "warning" }, "no-unused-array": { "severity": "warning" }, "no-use-of-empty-return-value": { "severity": "warning" }, "no-useless-cast": { "severity": "warning" }, "no-useless-catch": { "severity": "warning" }, "no-useless-increment": { "severity": "warning" }, "no-useless-intersection": { "severity": "warning" }, "no-variable-usage-before-declaration": { "severity": "warning" }, "parameters-max-number": { "severity": "warning" }, "prefer-default-last": { "severity": "warning" }, "prefer-immediate-return": { "severity": "warning" }, "prefer-optional": { "severity": "warning" }, "prefer-promise-shorthand": { "severity": "warning" }, "prefer-type-guard": { "severity": "warning" }, "use-primitive-type": { "severity": "warning" }, "use-type-alias": { "severity": "warning" } } }