mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
168 lines
5.2 KiB
JSON
168 lines
5.2 KiB
JSON
{
|
|
"defaultSeverity": "error",
|
|
"extends": ["tslint:recommended", "tslint-react", "tslint-microsoft-contrib"],
|
|
"jsRules": {},
|
|
"rules": {
|
|
// prettier is handling this
|
|
"align": false,
|
|
"newline-per-chained-call": false,
|
|
"array-type": [true, "generic"],
|
|
|
|
// Preferred by Prettier:
|
|
"arrow-parens": [true, "ban-single-arg-parens"],
|
|
|
|
"import-spacing": false,
|
|
"indent": [true, "spaces", 2],
|
|
"interface-name": [true, "never-prefix"],
|
|
|
|
// Allows us to write inline `style`s. Revisit when we have a more sophisticated
|
|
// CSS-in-JS solution:
|
|
"jsx-no-multiline-js": false,
|
|
|
|
// We'll make tradeoffs where appropriate
|
|
"jsx-no-lambda": false,
|
|
"react-this-binding-issue": false,
|
|
|
|
"linebreak-style": [true, "LF"],
|
|
|
|
// Prettier handles this for us
|
|
"max-line-length": false,
|
|
|
|
"mocha-avoid-only": true,
|
|
// Disabled until we can allow dynamically generated tests:
|
|
// https://github.com/Microsoft/tslint-microsoft-contrib/issues/85#issuecomment-371749352
|
|
"mocha-no-side-effect-code": false,
|
|
"mocha-unneeded-done": true,
|
|
|
|
// We always want 'as Type'
|
|
"no-angle-bracket-type-assertion": true,
|
|
|
|
"no-consecutive-blank-lines": [true, 2],
|
|
"object-literal-key-quotes": [true, "as-needed"],
|
|
"object-literal-sort-keys": false,
|
|
|
|
// Ignore import sources order until we can specify that we want ordering
|
|
// based on import name vs module name:
|
|
"ordered-imports": [
|
|
true,
|
|
{
|
|
"import-sources-order": "any",
|
|
"named-imports-order": "case-insensitive"
|
|
}
|
|
],
|
|
|
|
"quotemark": [
|
|
true,
|
|
"single",
|
|
"jsx-double",
|
|
"avoid-template",
|
|
"avoid-escape"
|
|
],
|
|
|
|
// Preferred by Prettier:
|
|
"semicolon": [true, "always", "ignore-bound-class-methods"],
|
|
|
|
// Preferred by Prettier:
|
|
"trailing-comma": [
|
|
true,
|
|
{
|
|
"singleline": "never",
|
|
"multiline": {
|
|
"objects": "always",
|
|
"arrays": "always",
|
|
"functions": "never",
|
|
"typeLiterals": "always"
|
|
},
|
|
"esSpecCompliant": true
|
|
}
|
|
],
|
|
|
|
// Disabling a large set of Microsoft-recommended rules
|
|
|
|
// Modifying:
|
|
|
|
// React components and namespaces are Pascal case
|
|
"variable-name": [
|
|
true,
|
|
"check-format",
|
|
"allow-leading-underscore",
|
|
"allow-pascal-case"
|
|
],
|
|
|
|
"function-name": [
|
|
true,
|
|
{
|
|
"function-regex": "^[a-z][\\w\\d]+$",
|
|
"method-regex": "^[a-z][\\w\\d]+$",
|
|
"private-method-regex": "^[a-z][\\w\\d]+$",
|
|
"protected-method-regex": "^[a-z][\\w\\d]+$",
|
|
"static-method-regex": "^[a-zA-Z][\\w\\d]+$"
|
|
}
|
|
],
|
|
|
|
// Adding select dev dependencies here for now, may turn on all in the future
|
|
"no-implicit-dependencies": [true, ["dashdash", "electron"]],
|
|
|
|
// Maybe will turn on:
|
|
|
|
// We're not trying to be comprehensive with JSDoc right now. We have the style guide.
|
|
"completed-docs": false,
|
|
// Today we have files with a single named export which isn't the filename. Eventually.
|
|
"export-name": false,
|
|
// We have a lot of 'any' in our code today
|
|
"no-any": false,
|
|
// We use this today, could get rid of it
|
|
"no-increment-decrement": false,
|
|
// This seems to detect false positives: any multi-level object literal, for example
|
|
"no-object-literal-type-assertion": false,
|
|
// I like relative references to the current dir, or absolute. Maybe can do this?
|
|
"no-relative-imports": false,
|
|
// We have a lot of 'any' in our code today
|
|
"no-unsafe-any": false,
|
|
// Not everything needs to be typed right now
|
|
"typedef": false,
|
|
|
|
// Probably won't turn on:
|
|
|
|
"possible-timing-attack": false,
|
|
// We use null
|
|
"no-null-keyword": false,
|
|
// We want to import a capitalized React, for example
|
|
"import-name": false,
|
|
// We have the styleguide for better docs
|
|
"missing-jsdoc": false,
|
|
// 'type' and 'number' are just too common
|
|
"no-reserved-keywords": false,
|
|
// The style guide needs JSDoc-style block comments to extract proptype documentation
|
|
"no-single-line-block-comment": false,
|
|
// Out-of-order functions can improve readability
|
|
"no-use-before-declare": false,
|
|
// We use Array<type> syntax
|
|
"prefer-array-literal": false,
|
|
// We prefer key: () => void syntax, because it suggests an object instead of a class
|
|
"prefer-method-signature": false,
|
|
// 'as' is nicer than angle brackets.
|
|
"prefer-type-cast": false,
|
|
// We use || and && shortcutting because we're javascript programmers
|
|
"strict-boolean-expressions": false,
|
|
"no-promise-as-boolean": true,
|
|
"no-suspicious-comment": false,
|
|
"no-backbone-get-set-outside-model": false,
|
|
"underscore-consistent-invocation": false,
|
|
"newline-before-return": false,
|
|
"number-literal-format": false,
|
|
"no-unnecessary-local-variable": false,
|
|
"react-no-dangerous-html": [
|
|
true,
|
|
{
|
|
"file": "ts/components/session/SessionHTMLRenderer.tsx",
|
|
"method": "<unknown>",
|
|
"comment": "Usage has been approved by Maxim on 13 Dec 2019"
|
|
}
|
|
],
|
|
// Reasonable functions can exceed the default of 100 lines
|
|
// due to auto-formatting
|
|
"max-func-body-length": [true, 150]
|
|
},
|
|
"rulesDirectory": ["node_modules/tslint-microsoft-contrib"]
|
|
}
|