// this is internal and only used to slim pro sizeexportconstenumLifecycleHooks{BEFORE_CREATE='bc',CREATED='c',BEFORE_MOUNT='bm',MOUNTED='m',BEFORE_UPDATE='bu',UPDATED='u',BEFORE_UNMOUNT='bum',UNMOUNTED='um',DEACTIVATED='da',ACTIVATED='a',RENDER_TRIGGERED='rtg',RENDER_TRACKED='rtc',...
// 禁止枚举同时具有数字和字符串成员 '@typescript-eslint/no-mixed-enums': 'off', // 禁止 TypeScript 命名空间,但是允许使用 declare namespace ... {} 来定义外部命名空间 '@typescript-eslint/no-namespace': ['error', { allowDeclarations: true, allowDefinitionFiles: true }], // 不允许在空...
enum PossibleType {Foo ="Foo",Bar ="Bar",Baz ="Baz",}functionchecker(input: PossibleType) {switch (input) {casePossibleType.Foo:console.log("foo!");break;casePossibleType.Bar:console.log("bar!");break;casePossibleType.Baz:console.log("baz!");break;default:const _exhaustiveCheck: never...
配合naming-convention 规则(能够用于检查接口是否按照规范命名),我们能够在看见IFoo时立刻知道它是一个 接口,看见Bar时立刻知道它是一个类型别名,配置: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 {"@typescript-eslint/naming-convention":["error",{"selector":"interface","format":["PascalCase"],...
enum-initializers @typescript-eslint/prefer-for-of @typescript-eslint/prefer-function-type @typescript-eslint/prefer-includes @typescript-eslint/prefer-literal-enum-member @typescript-eslint/prefer-namespace-keyword @typescript-eslint/prefer-nullish-coalescing @typescript-eslint/prefer-optional-...
配合naming-convention 规则(能够用于检查接口是否按照规范命名),我们能够在看见IFoo时立刻知道它是一个 接口,看见Bar时立刻知道它是一个类型别名,配置: { "@typescript-eslint/naming-convention": [ "error", { selector: "interface", format: ["PascalCase"], custom: { regex: "^I[A-Z]", match: ...
@typescript-eslint/prefer-enum-initializers @typescript-eslint/prefer-for-of @typescript-eslint/prefer-function-type @typescript-eslint/prefer-includes @typescript-eslint/prefer-literal-enum-member @typescript-eslint/prefer-namespace-keyword ...
[naming-convention] enumMembers should be default PascalCase#7879 👍2 I am ok to takenaming-conventionto eslint.style even tho it's a bit beyond our scope, but if taking them could help the community, then I am happy to host it. ...
var definition = new TypeScriptEnumDefinition { Name = "Direction", Sets = { new NameValue { Name = "Up", Value = "100" }, new NameValue { Name = "Down", Value = "200" }, new NameValue { Name = "Right", Value = "300" }, new NameValue { Name = "Left", Value = "400...
EN有需求需要将json的字段转换为小写,使用正则表达式实现,代码如下 正则表达式为 \"[a-zA-Z0-9]...