signal-desktop/tslint.json

162 lines
4.7 KiB
JSON
Raw Normal View History

{
"defaultSeverity": "error",
"extends": ["tslint:recommended", "tslint-react", "tslint-microsoft-contrib"],
"jsRules": {},
"rules": {
// prettier is handling this
2019-01-14 21:49:58 +00:00
"align": false,
"newline-per-chained-call": false,
"array-type": [true, "generic"],
"number-literal-format": false,
2018-04-14 02:06:55 +00:00
// Preferred by Prettier:
"arrow-parens": [true, "ban-single-arg-parens"],
"import-spacing": false,
"indent": [true, "spaces", 2],
2018-04-11 15:02:42 +00:00
"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,
2018-10-11 19:24:58 +00:00
// We'll make tradeoffs where appropriate
"jsx-no-lambda": false,
"react-this-binding-issue": false,
2018-04-13 19:51:09 +00:00
"linebreak-style": [true, "LF"],
2018-04-14 02:06:55 +00:00
2018-10-11 19:24:58 +00:00
// Prettier handles this for us
"max-line-length": false,
2018-04-11 23:45:48 +00:00
"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],
2018-04-11 15:02:42 +00:00
"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"
}
],
2018-04-11 15:02:42 +00:00
"quotemark": [
true,
"single",
"jsx-double",
"avoid-template",
"avoid-escape"
],
2018-04-14 02:06:55 +00:00
// Preferred by Prettier:
"semicolon": [true, "always", "ignore-bound-class-methods"],
2018-04-11 15:02:42 +00:00
2018-04-14 02:06:55 +00:00
// Preferred by Prettier:
"trailing-comma": [
true,
{
"singleline": "never",
"multiline": {
"objects": "always",
"arrays": "always",
"functions": "never",
"typeLiterals": "always"
},
"esSpecCompliant": true
}
],
// Crashing!
"use-default-type-parameter": false,
// Disabling a large set of Microsoft-recommended rules
// Modifying:
// React components and namespaces are Pascal case
"variable-name": [true, "allow-pascal-case"],
2019-01-14 21:49:58 +00:00
"variable-name": [
true,
"check-format",
"allow-leading-underscore",
"allow-pascal-case"
],
"function-name": [
true,
{
"function-regex": "^_?[a-z][\\w\\d]+$",
"static-method-regex": "^_?[a-z][\\w\\d]+$"
}
],
// Adding select dev dependencies here for now, may turn on all in the future
2020-02-07 20:07:43 +00:00
"no-implicit-dependencies": [
true,
[
"dashdash",
"electron",
"@storybook/react",
"@storybook/addon-actions",
"@storybook/addon-knobs"
]
],
// 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:
2019-01-14 21:49:58 +00:00
"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
},
"rulesDirectory": ["node_modules/tslint-microsoft-contrib"]
}