let bigIntLiteral: bigint = 100n; // 注意,bigint 是另一种数字类型,但不在基础类型分类中 2. 字符串(String) 字符串类型用于表示文本数据。你可以使用单引号(')、双引号(")或反引号(`)来定义字符串。 typescript let color: string = "blue"; let multiLine: string = `This is a multi-line s...
console.log(str === 'Line1\nLine2'); // true //***output*** //Line1 //Line2 //trueString Interpolation String interpolation (expression Interpolation) is the process of evaluating a string literal containing one or more expressions. It evaluates the expression and coerces the result into...
return emitLiteral(<LiteralExpression>node); } } 3.6.5. emitLiteral 比如我们节点类型是TemplateHead,那么就会执行emitLiteral函数进行发射代码。 4. 课后作业 学习随课代码中关于mini-typescript的实现。 ActionScript
'@typescript-eslint/prefer-regexp-exec': 'off', // 类的方法返回值是 this 时,类型必须设置为 this '@typescript-eslint/prefer-return-this-type': 'off', // 使用 String#startsWith 而不是其它方式 '@typescript-eslint/prefer-string-starts-ends-with': 'off', // async 函数的返回值必须是...
// 禁止对对象字面量进行类型断言(断言成 any 是允许的)"no-object-literal-type-assertion":true, // 禁止没必要的 return await"no-return-await":true, // 禁止在数组中出现连续的逗号,如 let foo = [,,]"no-sparse-arrays":true, // 禁止 throw 字符串,必须 throw 一个 Error 对象"no-string-...
'no-throw-literal': 2, 'no-trailing-spaces': 2, 'no-undef': 2, 'no-undef-init': 2, 'no-unexpected-multiline': 2, 'no-unmodified-loop-condition': 2, 'no-unneeded-ternary': [2, { 'defaultAssignment': false }], 'no-unreachable': 2, 'no-unsafe-finally': 2, 'no-unused-vars...
())"curly":[true,"ignore-same-line"],"arrow-parens":[true,"ban-single-arg-parens"],"semicolon":[true,"never"],//是否提示不必要的分号"trailing-comma":[true,{"multiline":{"objects":"ignore","arrays":"ignore","functions":"ignore","typeLiterals":"ignore"},"esSpecCompliant":true}]...
"no-throw-literal": 2,//禁止抛出字面量错误 throw "error"; "no-undef": 1,//不能有未定义的变量 "no-undef-init": 2,//变量初始化时不能直接给它赋值为undefined "no-undefined": 2,//不能使用undefined "no-unexpected-multiline": 2,//避免多行表达式 ...
详细见官网 "no-throw-literal": 2, //行末禁止加空格 "no-trailing-spaces": 2, //禁止使用没有定义的变量,除非在/*global*/已经申明 "no-undef": 2, //禁止把undefined赋值给一个变量 "no-undef-init": 2, //禁止在不需要分行的时候使用了分行 "no-unexpected-multiline": 2, //禁止使用没有...
(interface-over-type-literal from TSLint) // breaks `export type Message = string | ((colorizer: any) => string);` 'typescript/no-type-alias': 'off', // enforces a standard member declaration order. (member-ordering from TSLint) <FEEDBACK> 'typescript/member-ordering': [ 'error',...