IDS lint rules
The IDS audit answers "is this a valid IDS 1.0 file?". Lint answers "does this IDS mean what the author intends, and will it behave well?": abstract entities that match nothing, ^ in XSD patterns, millimetres where metres are expected, requirements that can never fail or never pass. Lint runs on a StudioDocument from @ifc-lite/ids-authoring and returns diagnostics with stable codes.
import { createLintContext, createLinter, fromIdsDocument } from '@ifc-lite/ids-authoring';
import { parseIDS } from '@ifc-lite/ids';
declare const xml: string;
const linter = createLinter(await createLintContext());
const { diagnostics } = linter.lint(fromIdsDocument(parseIDS(xml)));
for (const d of diagnostics) console.log(d.code, d.severity, d.message, d.fixes?.map((f) => f.label));
Keep one linter per open document: specification-level findings are cached and only changed specifications are re-checked. A quick fix is a batch of Studio ops; check it with checkQuickFix (the grounding gate) and commit it like any other edit. A suppression in the sidecar (meta.suppressions, with a reason) silences a rule on a node and everything below it.
Rules that depend on an IDS semantic the standard leaves open ship at info until the semantic is verified against the buildingSMART test cases; each rule page lists what was verified.
Rules marked opt-in are off by default because they fire on most real documents. Enable one by giving it a severity in the linter config (severity: { 'IDSL-SPEC-008': 'info' }) or by naming it in rules.
Entities
| Code |
Severity |
Rule |
Quick fix |
| IDSL-ENT-001 |
error |
Abstract entity in an entity facet |
yes |
| IDSL-ENT-002 |
info |
Entity removed in IFC4X3 |
yes |
| IDSL-ENT-003 |
info (opt-in) |
Entity has subtypes the author may also mean |
yes |
| IDSL-ENT-004 |
warning |
Type entity where an occurrence is meant |
yes |
| IDSL-ENT-005 |
warning |
Entity name not in upper case |
yes |
Predefined types
| Code |
Severity |
Rule |
Quick fix |
| IDSL-PDT-001 |
error |
Predefined type not in the entity enumeration |
yes |
| IDSL-PDT-002 |
info |
USERDEFINED predefined type without an ObjectType requirement |
yes |
| IDSL-PDT-003 |
info |
Undeclared user-defined predefined type |
yes |
Attributes
| Code |
Severity |
Rule |
Quick fix |
| IDSL-ATT-001 |
error |
Attribute not defined on the entity |
yes |
| IDSL-ATT-002 |
warning |
Value check on an entity-typed attribute |
yes |
Property sets
| Code |
Severity |
Rule |
Quick fix |
| IDSL-PSET-001 |
warning |
Standard property set not applicable to the entity |
yes |
| IDSL-PSET-002 |
error |
Custom property set with a reserved prefix |
yes |
| IDSL-PSET-003 |
warning |
Quantity set with a non-measure data type or value |
yes |
Properties
| Code |
Severity |
Rule |
Quick fix |
| IDSL-PROP-001 |
error |
Property not in the standard property set |
yes |
| IDSL-PROP-002 |
warning |
Data type differs from the standard property |
yes |
| IDSL-PROP-003 |
info |
Numeric constraint without a data type |
yes |
Values
| Code |
Severity |
Rule |
Quick fix |
| IDSL-VAL-001 |
error |
Value not in the standard enumeration |
yes |
| IDSL-VAL-002 |
warning |
Restriction base incompatible with the data type |
yes |
| IDSL-VAL-003 |
warning |
Simple value that looks like a list |
yes |
| IDSL-VAL-004 |
warning |
Simple value that looks like a comparison |
yes |
| IDSL-VAL-005 |
warning |
Boolean literal in a form IDS does not accept |
yes |
| IDSL-VAL-006 |
info |
Leading or trailing whitespace, or invisible characters |
yes |
| IDSL-VAL-008 |
info |
Exact match on a real number |
no |
Units
| Code |
Severity |
Rule |
Quick fix |
| IDSL-UNIT-001 |
warning |
Magnitude suggests a non-SI unit |
yes |
Patterns
Cardinality
| Code |
Severity |
Rule |
Quick fix |
| IDSL-CARD-001 |
warning |
Prohibited requirement with a value or data type |
yes |
| IDSL-CARD-002 |
info |
Optional requirement that checks nothing |
yes |
| IDSL-CARD-003 |
warning |
Prohibited specification with requirements |
yes |
| IDSL-CARD-004 |
info |
Required specification with a narrow applicability |
yes |
Specifications
Document
| Code |
Severity |
Rule |
Quick fix |
| IDSL-DOC-001 |
error |
Author is not an e-mail address, or date is not xs:date |
yes |
IFC versions
| Code |
Severity |
Rule |
Quick fix |
| IDSL-VER-001 |
warning |
Name valid in only some IFC versions of the specification |
yes |
partOf relations
| Code |
Severity |
Rule |
Quick fix |
| IDSL-PART-001 |
info |
Unlikely partOf relation for these entities |
yes |
bSDD references
| Code |
Severity |
Rule |
Quick fix |
| IDSL-BSDD-001 |
warning |
bSDD URI not found or inactive |
yes |
| IDSL-BSDD-002 |
info |
Classification system differs from the bSDD dictionary name |
yes |
| IDSL-BSDD-003 |
warning |
Value outside the allowed values bSDD publishes |
yes |