Ver código fonte

Updated TSLint rules #2

sanex3339 7 anos atrás
pai
commit
5e6169f2d5

+ 4 - 1
src/custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/CallExpressionControlFlowStorageCallNode.ts

@@ -2,7 +2,10 @@ import { inject, injectable, } from 'inversify';
 import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers';
 
 import * as ESTree from 'estree';
+
+// tslint:disable
 import { Expression } from 'estree';
+// tslint:enable
 
 import { TIdentifierNamesGeneratorFactory } from '../../../types/container/generators/TIdentifierNamesGeneratorFactory';
 import { TStatement } from '../../../types/node/TStatement';
@@ -65,7 +68,7 @@ export class CallExpressionControlFlowStorageCallNode extends AbstractCustomNode
     public initialize (
         controlFlowStorageName: string,
         controlFlowStorageKey: string,
-        callee: Expression,
+        callee: ESTree.Expression,
         expressionArguments: (ESTree.Expression | ESTree.SpreadElement)[]
     ): void {
         this.controlFlowStorageName = controlFlowStorageName;

+ 0 - 2
src/custom-nodes/string-array-nodes/StringArrayCallsWrapper.ts

@@ -153,8 +153,6 @@ export class StringArrayCallsWrapper extends AbstractCustomNode {
                         stringArrayCallsWrapperName: this.stringArrayCallsWrapperName
                     }
                 );
-
-                break;
         }
 
         return decodeStringArrayTemplate;

+ 0 - 1
src/declarations/ESTree.d.ts

@@ -1,7 +1,6 @@
 /* tslint:disable:interface-name */
 
 import * as escodegen from 'escodegen-wallaby';
-import * as ESTree from 'estree';
 
 declare module 'estree' {
     export interface BaseNodeMetadata {

+ 1 - 1
src/node-transformers/converting-transformers/TemplateLiteralTransformer.ts

@@ -101,7 +101,7 @@ export class TemplateLiteralTransformer extends AbstractNodeTransformer {
             );
 
             nodes.forEach((node: ESTree.Literal | ESTree.Expression) => {
-                root = NodeFactory.binaryExpressionNode('+', root, <ESTree.Literal | ESTree.Expression>node);
+                root = NodeFactory.binaryExpressionNode('+', root, node);
             });
 
             return root;

+ 4 - 1
tslint.json

@@ -53,12 +53,13 @@
       "always-prefix"
     ],
     "interface-over-type-literal": true,
+    "import-name": false,
     "import-spacing": true,
     "jsdoc-format": true,
     "label-position": true,
     "max-classes-per-file": [true, 1],
     "max-func-body-length": [true, 200],
-    "max-line-length": [true, 150],
+    "max-line-length": false,
     "member-access": [true],
     "member-ordering": [
       true,
@@ -101,6 +102,7 @@
     "no-ex-assign": true,
     "no-extra-boolean-cast": true,
     "no-extra-semi": true,
+    "no-import-side-effect": false,
     "no-inferrable-types": false,
     "no-inner-declarations": [true, "both"],
     "no-implicit-dependencies": false,
@@ -142,6 +144,7 @@
     "no-useless-files": true,
     "no-var-keyword": true,
     "no-var-requires": true,
+    "non-literal-require": false,
     "max-file-line-count": [true, 500],
     "object-curly-spacing": [true, "always"],
     "object-literal-sort-keys": false,