Skip to content

Instantly share code, notes, and snippets.

@Duobe
Forked from smartpcr/tslint.json
Created December 13, 2018 05:23
Show Gist options
  • Select an option

  • Save Duobe/3dfda508cd33334c56a6deef4b6d86be to your computer and use it in GitHub Desktop.

Select an option

Save Duobe/3dfda508cd33334c56a6deef4b6d86be to your computer and use it in GitHub Desktop.
tslint
{
"extends": ["tslint-react"],
"rulesDirectory": "./node_modules/tslint-microsoft-contrib",
"rules": {
"function-name": [
true,
{
"method-regex": "^[a-z][\\w\\d]+$",
"private-method-regex": "^_[a-z][\\w\\d]+$",
"protected-method-regex": "^[_]?[a-z][\\w\\d]+$",
"static-method-regex": "^[a-z][\\w\\d]+$",
"function-regex": "^[_]?[a-z][\\w\\d]+$"
}
],
"jsx-curly-spacing": {
"when": "always"
},
"jsx-no-bind": true,
"jsx-boolean-value": ["never"],
"jsx-equals-spacing": "never",
"jsx-key": true,
"jsx-no-lambda": true,
"jsx-self-close": true,
"jsx-wrap-multiline": true,
"jsx-no-multiline-js": false,
"jsx-no-string-ref": true,
"jsx-ban-props": [
true,
["style", "Use className and provide css rules instead of using inline styles."],
["id", "Use data-test-id instead of id to mark test significant elements"]
],
"ban": [
true,
{
"name": ["window", "addEventListener"],
"message": "Flow the layout with CSS instead of calculating with it with js"
},
{
"name": ["*", "setState"],
"message": "Use redux to manage state instead of this.state"
},
{
"name": ["describe", "only"],
"message": "Do not commit focused test suite"
},
{
"name": ["test", "only"],
"message": "Do not commit focused test suite"
},
{
"name": ["combineReducers"],
"message": "Use common/redux combineStates() instead"
},
{
"name": ["connect"],
"message": "Use common/redux mconnect() instead"
},
{
"name": ["PubSub", "subscribe"],
"message": "Use redux instead of PubSub in react"
}
],
"ban-types": [
true,
["Dispatch", "Use common/redux MDispatch instead"],
["(Any)?Action", "Use common/redux IAction instead"],
["Reducer", "Use common/redux MReducer instead"],
["React.Component", "Use React.PureComponent instead"]
],
"no-duplicate-variable": true,
"no-default-export": true,
"use-isnan": true,
"triple-equals": [true],
"max-line-length": [true, 140],
"no-arg": true,
"radix": true,
"typedef": [true, "call-signature", "parameter", "arrow-parameter", "property-declaration"],
"prefer-const": true,
"quotemark": [true, "double", "jsx-double", "avoid-escape"],
"no-inferrable-types": [true, "ignore-params"],
"no-null-keyword": false,
"export-name": false,
"trailing-comma": [false],
"whitespace": [false],
"no-switch-case-fall-through": false,
"variable-name": [true, "check-format", "allow-leading-underscore", "allow-pascal-case", "ban-keywords"],
"class-name": true,
"comment-format": [true, "check-space"],
"curly": true,
"eofline": false,
"forin": true,
"indent": [true, "spaces", 4],
"interface-name": [true, "always-prefix"],
"label-position": true,
"member-access": true,
"member-ordering": [
true,
{
"order": [
"public-static-field",
"protected-static-field",
"private-static-field",
"public-instance-field",
"protected-instance-field",
"private-instance-field",
"public-static-method",
"protected-static-method",
"private-static-method",
"public-constructor",
"public-instance-method",
"protected-constructor",
"protected-instance-method",
"private-constructor",
"private-instance-method"
]
}
],
"missing-optional-annotation": true,
"no-any": true,
"no-bitwise": true,
"no-consecutive-blank-lines": true,
"no-console": [true, "debug", "info", "time", "timeEnd", "trace"],
"no-constant-condition": true,
"no-construct": true,
"no-debugger": true,
"no-duplicate-switch-case": true,
"no-duplicate-parameter-names": true,
"no-empty": true,
"no-eval": true,
"no-function-expression": true,
"no-internal-module": true,
"no-shadowed-variable": true,
"no-string-literal": true,
"no-trailing-whitespace": true,
"no-unnecessary-semicolons": true,
"no-unused-expression": false,
"no-unused-variable": false,
"no-use-before-declare": true,
"no-with-statement": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [true, "check-open-brace", "check-catch", "check-else", "check-whitespace"],
"ordered-imports": [
true,
{
"grouped-imports": true
}
],
"semicolon": [true, "always", "ignore-bound-class-methods"],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"use-named-parameter": true
}
}
@Duobe
Copy link
Author

Duobe commented Dec 14, 2018

{
  "compileOnSave": false,
  "compilerOptions": {
    "declaration": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "es2016",
      "dom"
    ],
    "noImplicitAny": false,
    "noImplicitReturns": true,
    "target": "es5",
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "outDir": "../dist",
    "baseUrl": ""
  },
  "files": [
    "index.ts"
  ],
  "exclude": [
    "../node_modules/**/*"
  ],
  "angularCompilerOptions": {
    "skipTemplateCodege": true,
    "genDir": "../compiled"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment