{"record":{"id":"db320ad03b8e2bb2","repo":"Semantic-Org/Semantic-UI","slug":"name-must-be-an-integer","errorCode":null,"errorMessage":"{name} must be an integer","messagePattern":"(.+?) must be an integer","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/definitions/behaviors/form.js","lineNumber":1259,"sourceCode":"    escape  : /[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g,\n    flags   : /^\\/(.*)\\/(.*)?/,\n    integer : /^\\-?\\d+$/,\n    number  : /^\\-?\\d*(\\.\\d+)?$/,\n    url     : /(https?:\\/\\/(?:www\\.|(?!www))[^\\s\\.]+\\.[^\\s]{2,}|www\\.[^\\s]+\\.[^\\s]{2,})/i\n  },\n\n  text: {\n    unspecifiedRule  : 'Please enter a valid value',\n    unspecifiedField : 'This field'\n  },\n\n  prompt: {\n    empty                : '{name} must have a value',\n    checked              : '{name} must be checked',\n    email                : '{name} must be a valid e-mail',\n    url                  : '{name} must be a valid url',\n    regExp               : '{name} is not formatted correctly',\n    integer              : '{name} must be an integer',\n    decimal              : '{name} must be a decimal number',\n    number               : '{name} must be set to a number',\n    is                   : '{name} must be \"{ruleValue}\"',\n    isExactly            : '{name} must be exactly \"{ruleValue}\"',\n    not                  : '{name} cannot be set to \"{ruleValue}\"',\n    notExactly           : '{name} cannot be set to exactly \"{ruleValue}\"',\n    contain              : '{name} must contain \"{ruleValue}\"',\n    containExactly       : '{name} must contain exactly \"{ruleValue}\"',\n    doesntContain        : '{name} cannot contain  \"{ruleValue}\"',\n    doesntContainExactly : '{name} cannot contain exactly \"{ruleValue}\"',\n    minLength            : '{name} must be at least {ruleValue} characters',\n    length               : '{name} must be at least {ruleValue} characters',\n    exactLength          : '{name} must be exactly {ruleValue} characters',\n    maxLength            : '{name} cannot be longer than {ruleValue} characters',\n    match                : '{name} must match {ruleValue} field',\n    different            : '{name} must have a different value than {ruleValue} field',\n    creditCard           : '{name} must be a valid credit card number',\n    minCount             : '{name} must have at least {ruleValue} choices',","sourceCodeStart":1241,"sourceCodeEnd":1277,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/behaviors/form.js#L1241-L1277","documentation":"Default prompt for the Semantic UI Form `integer` rule (settings.rules.integer, form.js:1380). Shown when a value fails the integer regex `/^-?\\d+$/` (form.js:1243) or falls outside an optional range supplied as `[min..max]`, `[n]`, `[min..]`, or `[..max]`. `{ruleValue}` is replaced with the range string by `module.get.prompt` (form.js:460).","triggerScenarios":"`{type:'integer'}` with input `3.5`, `abc`, or empty; `{type:'integer[1..10]'}` with input `0` or `11`; `{type:'integer[18]'}` requiring exactly 18.","commonSituations":"Allowing decimals where an integer was required, forgetting the range bracket, or a range written as `1...10` (three dots) which breaks the `split('..',2)` logic at form.js:1396.","solutions":["Enter a whole number within the configured range.","Use exactly two dots in ranges: `integer[1..10]`.","If decimals are valid for your field, switch the rule to `decimal` or `number`.","Add a descriptive `prompt` that states the allowed range."],"exampleFix":"// before\nrules: [{ type: 'integer[1...10]' }]  // triple-dot breaks split -> range ignored\n\n// after\nrules: [{ type: 'integer[1..10]', prompt: 'Enter a whole number from 1 to 10' }]","handlingStrategy":"validation","validationCode":"function inRange(n, min, max) { return Number.isInteger(n) && (min==null||n>=min) && (max==null||n<=max); }\nconst n = Number($field.val());\nif (!inRange(n, 1, 10)) { /* warn */ }","typeGuard":"const isIntInRange = (v, min, max) => /^-?\\d+$/.test(String(v)) && inRange(Number(v), min, max);","tryCatchPattern":null,"preventionTips":["Use exactly two dots in ranges (integer[1..10]).","Pick integer vs decimal vs number deliberately per field.","Set an explicit prompt naming the allowed range."],"tags":["semantic-ui","form-validation","integer","range","client-side"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}