UNPKG

rome

Version:

Rome is a toolchain for the web: formatter, linter and more

1,434 lines (1,433 loc) 45.5 kB
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Configuration", "description": "The configuration that is contained inside the file `rome.json`", "type": "object", "properties": { "$schema": { "description": "A field for the [JSON schema](https://json-schema.org/) specification", "type": ["string", "null"] }, "files": { "description": "The configuration of the filesystem", "anyOf": [ { "$ref": "#/definitions/FilesConfiguration" }, { "type": "null" } ] }, "formatter": { "description": "The configuration of the formatter", "anyOf": [ { "$ref": "#/definitions/FormatterConfiguration" }, { "type": "null" } ] }, "javascript": { "description": "Specific configuration for the JavaScript language", "anyOf": [ { "$ref": "#/definitions/JavascriptConfiguration" }, { "type": "null" } ] }, "linter": { "description": "The configuration for the linter", "anyOf": [ { "$ref": "#/definitions/LinterConfiguration" }, { "type": "null" } ] }, "organizeImports": { "description": "The configuration of the import sorting", "anyOf": [{ "$ref": "#/definitions/OrganizeImports" }, { "type": "null" }] }, "vcs": { "description": "The configuration of the VCS integration", "anyOf": [ { "$ref": "#/definitions/VcsConfiguration" }, { "type": "null" } ] } }, "additionalProperties": false, "definitions": { "A11y": { "description": "A list of rules that belong to this group", "type": "object", "properties": { "all": { "description": "It enables ALL rules for this group.", "type": ["boolean", "null"] }, "noAccessKey": { "description": "Enforce that the accessKey attribute is not used on any HTML element.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noAutofocus": { "description": "Enforce that autoFocus prop is not used on elements.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noBlankTarget": { "description": "Disallow target=\"_blank\" attribute without rel=\"noreferrer\"", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noDistractingElements": { "description": "Enforces that no distracting elements are used.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noHeaderScope": { "description": "The scope prop should be used only on <th> elements.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noNoninteractiveElementToInteractiveRole": { "description": "Enforce that interactive ARIA roles are not assigned to non-interactive HTML elements.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noPositiveTabindex": { "description": "Prevent the usage of positive integers on tabIndex property", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noRedundantAlt": { "description": "Enforce img alt prop does not contain the word \"image\", \"picture\", or \"photo\".", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noSvgWithoutTitle": { "description": "Enforces the usage of the title element for the svg element.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "recommended": { "description": "It enables the recommended rules for this group", "type": ["boolean", "null"] }, "useAltText": { "description": "Enforce that all elements that require alternative text have meaningful information to relay back to the end user.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useAnchorContent": { "description": "Enforce that anchors have content and that the content is accessible to screen readers.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useAriaPropsForRole": { "description": "Enforce that elements with ARIA roles must have all required ARIA attributes for that role.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useButtonType": { "description": "Enforces the usage of the attribute type for the element button", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useHtmlLang": { "description": "Enforce that html element has lang attribute.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useIframeTitle": { "description": "Enforces the usage of the attribute title for the element iframe.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useKeyWithClickEvents": { "description": "Enforce onClick is accompanied by at least one of the following: onKeyUp, onKeyDown, onKeyPress.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useKeyWithMouseEvents": { "description": "Enforce onMouseOver / onMouseOut are accompanied by onFocus / onBlur.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useMediaCaption": { "description": "Enforces that audio and video elements must have a track for captions.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useValidAnchor": { "description": "Enforce that all anchors are valid, and they are navigable elements.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useValidAriaProps": { "description": "Ensures that ARIA properties aria-* are all valid.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useValidLang": { "description": "Ensure that the attribute passed to the lang attribute is a correct ISO language and/or country.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] } } }, "Complexity": { "description": "A list of rules that belong to this group", "type": "object", "properties": { "all": { "description": "It enables ALL rules for this group.", "type": ["boolean", "null"] }, "noExtraBooleanCast": { "description": "Disallow unnecessary boolean casts", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noExtraSemicolon": { "description": "Typing mistakes and misunderstandings about where semicolons are required can lead to semicolons that are unnecessary. While not technically an error, extra semicolons can cause confusion when reading code.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noMultipleSpacesInRegularExpressionLiterals": { "description": "Disallow unclear usage of multiple space characters in regular expression literals", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUselessCatch": { "description": "Disallow unnecessary catch clauses.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUselessConstructor": { "description": "Disallow unnecessary constructors.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUselessFragments": { "description": "Disallow unnecessary fragments", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUselessLabel": { "description": "Disallow unnecessary labels.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUselessRename": { "description": "Disallow renaming import, export, and destructured assignments to the same name.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUselessSwitchCase": { "description": "Disallow useless case in switch statements.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUselessTypeConstraint": { "description": "Disallow using any or unknown as type constraint.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noWith": { "description": "Disallow with statements in non-strict contexts.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "recommended": { "description": "It enables the recommended rules for this group", "type": ["boolean", "null"] }, "useFlatMap": { "description": "Promotes the use of .flatMap() when map().flat() are used together.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useOptionalChain": { "description": "Enforce using concise optional chain instead of chained logical expressions.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useSimplifiedLogicExpression": { "description": "Discard redundant terms from logical expressions.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] } } }, "Correctness": { "description": "A list of rules that belong to this group", "type": "object", "properties": { "all": { "description": "It enables ALL rules for this group.", "type": ["boolean", "null"] }, "noChildrenProp": { "description": "Prevent passing of children as props.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noConstAssign": { "description": "Prevents from having const variables being re-assigned.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noConstructorReturn": { "description": "Disallow returning a value from a constructor.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noEmptyPattern": { "description": "Disallows empty destructuring patterns.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noGlobalObjectCalls": { "description": "Disallow calling global object properties as functions", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noInnerDeclarations": { "description": "Disallow function and var declarations that are accessible outside their block.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noInvalidConstructorSuper": { "description": "Prevents the incorrect use of super() inside classes. It also checks whether a call super() is missing from classes that extends other constructors.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noNewSymbol": { "description": "Disallow new operators with the Symbol object", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noPrecisionLoss": { "description": "Disallow literal numbers that lose precision", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noRenderReturnValue": { "description": "Prevent the usage of the return value of React.render.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noSetterReturn": { "description": "Disallow returning a value from a setter", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noStringCaseMismatch": { "description": "Disallow comparison of expressions modifying the string case with non-compliant value.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noSwitchDeclarations": { "description": "Disallow lexical declarations in switch clauses.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUndeclaredVariables": { "description": "Prevents the usage of variables that haven't been declared inside the document", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUnnecessaryContinue": { "description": "Avoid using unnecessary continue.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUnreachable": { "description": "Disallow unreachable code", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUnreachableSuper": { "description": "Ensures the super() constructor is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUnsafeFinally": { "description": "Disallow control flow statements in finally blocks.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUnsafeOptionalChaining": { "description": "Disallow the use of optional chaining in contexts where the undefined value is not allowed.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUnusedLabels": { "description": "Disallow unused labels.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUnusedVariables": { "description": "Disallow unused variables.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noVoidElementsWithChildren": { "description": "This rules prevents void elements (AKA self-closing elements) from having children.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noVoidTypeReturn": { "description": "Disallow returning a value from a function with the return type 'void'", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "recommended": { "description": "It enables the recommended rules for this group", "type": ["boolean", "null"] }, "useValidForDirection": { "description": "Enforce \"for\" loop update clause moving the counter in the right direction.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useYield": { "description": "Require generator functions to contain yield.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] } } }, "FilesConfiguration": { "description": "The configuration of the filesystem", "type": "object", "properties": { "ignore": { "description": "A list of Unix shell style patterns. Rome tools will ignore files/folders that will match these patterns.", "anyOf": [{ "$ref": "#/definitions/StringSet" }, { "type": "null" }] }, "maxSize": { "description": "The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reason. Defaults to 1 MiB", "default": null, "type": ["integer", "null"], "format": "uint64", "minimum": 1.0 } }, "additionalProperties": false }, "FormatterConfiguration": { "description": "Options applied to the formatter", "type": "object", "properties": { "enabled": { "default": true, "type": ["boolean", "null"] }, "formatWithErrors": { "description": "Stores whether formatting should be allowed to proceed if a given file has syntax errors", "default": false, "type": ["boolean", "null"] }, "ignore": { "description": "A list of Unix shell style patterns. The formatter will ignore files/folders that will match these patterns.", "anyOf": [{ "$ref": "#/definitions/StringSet" }, { "type": "null" }] }, "indentSize": { "description": "The size of the indentation, 2 by default", "default": 2, "type": ["integer", "null"], "format": "uint8", "minimum": 0.0 }, "indentStyle": { "description": "The indent style.", "default": "tab", "anyOf": [ { "$ref": "#/definitions/PlainIndentStyle" }, { "type": "null" } ] }, "lineWidth": { "description": "What's the max width of a line. Defaults to 80.", "default": 80, "anyOf": [{ "$ref": "#/definitions/LineWidth" }, { "type": "null" }] } }, "additionalProperties": false }, "JavascriptConfiguration": { "type": "object", "properties": { "formatter": { "anyOf": [ { "$ref": "#/definitions/JavascriptFormatter" }, { "type": "null" } ] }, "globals": { "description": "A list of global bindings that should be ignored by the analyzers\n\nIf defined here, they should not emit diagnostics.", "anyOf": [{ "$ref": "#/definitions/StringSet" }, { "type": "null" }] }, "organize_imports": { "anyOf": [ { "$ref": "#/definitions/JavascriptOrganizeImports" }, { "type": "null" } ] } }, "additionalProperties": false }, "JavascriptFormatter": { "type": "object", "properties": { "quoteProperties": { "description": "When properties in objects are quoted. Defaults to asNeeded.", "default": null, "anyOf": [ { "$ref": "#/definitions/QuoteProperties" }, { "type": "null" } ] }, "quoteStyle": { "description": "The style for quotes. Defaults to double.", "default": null, "anyOf": [{ "$ref": "#/definitions/QuoteStyle" }, { "type": "null" }] }, "semicolons": { "description": "Whether the formatter prints semicolons for all statements or only in for statements where it is necessary because of ASI.", "default": null, "anyOf": [{ "$ref": "#/definitions/Semicolons" }, { "type": "null" }] }, "trailingComma": { "description": "Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to \"all\".", "default": null, "anyOf": [ { "$ref": "#/definitions/TrailingComma" }, { "type": "null" } ] } }, "additionalProperties": false }, "JavascriptOrganizeImports": { "type": "object", "additionalProperties": false }, "LineWidth": { "description": "Validated value for the `line_width` formatter options\n\nThe allowed range of values is 1..=320", "type": "integer", "format": "uint16", "minimum": 0.0 }, "LinterConfiguration": { "type": "object", "properties": { "enabled": { "description": "if `false`, it disables the feature and the linter won't be executed. `true` by default", "default": true, "type": ["boolean", "null"] }, "ignore": { "description": "A list of Unix shell style patterns. The formatter will ignore files/folders that will match these patterns.", "anyOf": [{ "$ref": "#/definitions/StringSet" }, { "type": "null" }] }, "rules": { "description": "List of rules", "default": { "recommended": true }, "anyOf": [{ "$ref": "#/definitions/Rules" }, { "type": "null" }] } }, "additionalProperties": false }, "Nursery": { "description": "A list of rules that belong to this group", "type": "object", "properties": { "all": { "description": "It enables ALL rules for this group.", "type": ["boolean", "null"] }, "noAccumulatingSpread": { "description": "Disallow the use of spread (...) syntax on accumulators.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noAriaUnsupportedElements": { "description": "Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noBannedTypes": { "description": "Disallow certain types.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noConfusingArrow": { "description": "Disallow arrow functions where they could be confused with comparisons.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noConsoleLog": { "description": "Disallow the use of console.log", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noConstantCondition": { "description": "Disallow constant expressions in conditions", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noDuplicateJsxProps": { "description": "Prevents JSX properties to be assigned multiple times.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noForEach": { "description": "Prefer for...of statement instead of Array.forEach.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noNoninteractiveTabindex": { "description": "Enforce that tabIndex is not assigned to non-interactive HTML elements.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noRedundantRoles": { "description": "Enforce explicit role property is not the same as implicit/default role property on an element.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noSelfAssign": { "description": "Disallow assignments where both sides are exactly the same.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "recommended": { "description": "It enables the recommended rules for this group", "type": ["boolean", "null"] }, "useAriaPropTypes": { "description": "Enforce that ARIA state and property values are valid.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useCamelCase": { "description": "Enforce camel case naming convention.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useExhaustiveDependencies": { "description": "Enforce all dependencies are correctly specified.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useGroupedTypeImport": { "description": "Enforce the use of import type when an import only has specifiers with type qualifier.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useHeadingContent": { "description": "Enforce that heading elements (h1, h2, etc.) have content and that the content is accessible to screen readers. Accessible means that it is not hidden using the aria-hidden prop.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useHookAtTopLevel": { "description": "Enforce that all React hooks are being called from the Top Level component functions.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useIsNan": { "description": "Require calls to isNaN() when checking for NaN.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useLiteralEnumMembers": { "description": "Require all enum members to be literal values.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useLiteralKeys": { "description": "Enforce the usage of a literal access to properties over computed property access.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useSimpleNumberKeys": { "description": "Disallow number literal object member names which are not base10 or uses underscore as separator", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] } } }, "OrganizeImports": { "type": "object", "properties": { "enabled": { "description": "Enables the organization of imports", "default": false, "type": ["boolean", "null"] }, "ignore": { "description": "A list of Unix shell style patterns. The formatter will ignore files/folders that will match these patterns.", "anyOf": [{ "$ref": "#/definitions/StringSet" }, { "type": "null" }] } }, "additionalProperties": false }, "Performance": { "description": "A list of rules that belong to this group", "type": "object", "properties": { "all": { "description": "It enables ALL rules for this group.", "type": ["boolean", "null"] }, "noDelete": { "description": "Disallow the use of the delete operator.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "recommended": { "description": "It enables the recommended rules for this group", "type": ["boolean", "null"] } } }, "PlainIndentStyle": { "oneOf": [ { "description": "Tab", "type": "string", "enum": ["tab"] }, { "description": "Space", "type": "string", "enum": ["space"] } ] }, "QuoteProperties": { "type": "string", "enum": ["asNeeded", "preserve"] }, "QuoteStyle": { "type": "string", "enum": ["double", "single"] }, "RuleConfiguration": { "anyOf": [ { "$ref": "#/definitions/RulePlainConfiguration" }, { "$ref": "#/definitions/RuleWithOptions" } ] }, "RulePlainConfiguration": { "type": "string", "enum": ["warn", "error", "off"] }, "RuleWithOptions": { "type": "object", "required": ["level", "options"], "properties": { "level": { "$ref": "#/definitions/RulePlainConfiguration" }, "options": true }, "additionalProperties": false }, "Rules": { "type": "object", "properties": { "a11y": { "anyOf": [{ "$ref": "#/definitions/A11y" }, { "type": "null" }] }, "all": { "description": "It enables ALL rules. The rules that belong to `nursery` won't be enabled.", "type": ["boolean", "null"] }, "complexity": { "anyOf": [{ "$ref": "#/definitions/Complexity" }, { "type": "null" }] }, "correctness": { "anyOf": [{ "$ref": "#/definitions/Correctness" }, { "type": "null" }] }, "nursery": { "anyOf": [{ "$ref": "#/definitions/Nursery" }, { "type": "null" }] }, "performance": { "anyOf": [{ "$ref": "#/definitions/Performance" }, { "type": "null" }] }, "recommended": { "description": "It enables the lint rules recommended by Rome. `true` by default.", "type": ["boolean", "null"] }, "security": { "anyOf": [{ "$ref": "#/definitions/Security" }, { "type": "null" }] }, "style": { "anyOf": [{ "$ref": "#/definitions/Style" }, { "type": "null" }] }, "suspicious": { "anyOf": [{ "$ref": "#/definitions/Suspicious" }, { "type": "null" }] } }, "additionalProperties": false }, "Security": { "description": "A list of rules that belong to this group", "type": "object", "properties": { "all": { "description": "It enables ALL rules for this group.", "type": ["boolean", "null"] }, "noDangerouslySetInnerHtml": { "description": "Prevent the usage of dangerous JSX props", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noDangerouslySetInnerHtmlWithChildren": { "description": "Report when a DOM element or a component uses both children and dangerouslySetInnerHTML prop.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "recommended": { "description": "It enables the recommended rules for this group", "type": ["boolean", "null"] } } }, "Semicolons": { "type": "string", "enum": ["always", "asNeeded"] }, "StringSet": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }, "Style": { "description": "A list of rules that belong to this group", "type": "object", "properties": { "all": { "description": "It enables ALL rules for this group.", "type": ["boolean", "null"] }, "noArguments": { "description": "Disallow the use of arguments", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noCommaOperator": { "description": "Disallow comma operator.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noImplicitBoolean": { "description": "Disallow implicit true values on JSX boolean attributes", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noInferrableTypes": { "description": "Disallow type annotations for variables, parameters, and class properties initialized with a literal expression.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noNamespace": { "description": "Disallow the use of TypeScript's namespaces.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noNegationElse": { "description": "Disallow negation in the condition of an if statement if it has an else clause", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noNonNullAssertion": { "description": "Disallow non-null assertions using the ! postfix operator.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noParameterAssign": { "description": "Disallow reassigning function parameters.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noParameterProperties": { "description": "Disallow the use of parameter properties in class constructors.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noRestrictedGlobals": { "description": "This rule allows you to specify global variable names that you don’t want to use in your application.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noShoutyConstants": { "description": "Disallow the use of constants which its value is the upper-case version of its name.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUnusedTemplateLiteral": { "description": "Disallow template literals if interpolation and special-character handling are not needed", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noVar": { "description": "Disallow the use of var", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "recommended": { "description": "It enables the recommended rules for this group", "type": ["boolean", "null"] }, "useBlockStatements": { "description": "Requires following curly brace conventions. JavaScript allows the omission of curly braces when a block contains only one statement. However, it is considered by many to be best practice to never omit curly braces around blocks, even when they are optional, because it can lead to bugs and reduces code clarity.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useConst": { "description": "Require const declarations for variables that are never reassigned after declared.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useDefaultParameterLast": { "description": "Enforce default function parameters and optional parameters to be last.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useEnumInitializers": { "description": "Require that each enum member value be explicitly initialized.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useExponentiationOperator": { "description": "Disallow the use of Math.pow in favor of the ** operator.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useFragmentSyntax": { "description": "This rule enforces the use of <>...</> over <Fragment>...</Fragment>.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useNumericLiterals": { "description": "Disallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useSelfClosingElements": { "description": "Prevent extra closing tags for components without children", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useShorthandArrayType": { "description": "When expressing array types, this rule promotes the usage of T[] shorthand instead of Array<T>.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useSingleCaseStatement": { "description": "Enforces switch clauses have a single statement, emits a quick fix wrapping the statements in a block.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useSingleVarDeclarator": { "description": "Disallow multiple variable declarations in the same variable statement", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useTemplate": { "description": "Template literals are preferred over string concatenation.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useWhile": { "description": "Enforce the use of while loops instead of for loops when the initializer and update expressions are not needed", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] } } }, "Suspicious": { "description": "A list of rules that belong to this group", "type": "object", "properties": { "all": { "description": "It enables ALL rules for this group.", "type": ["boolean", "null"] }, "noArrayIndexKey": { "description": "Discourage the usage of Array index in keys.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noAssignInExpressions": { "description": "Disallow assignments in expressions.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noAsyncPromiseExecutor": { "description": "Disallows using an async function as a Promise executor.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noCatchAssign": { "description": "Disallow reassigning exceptions in catch clauses.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noClassAssign": { "description": "Disallow reassigning class members.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noCommentText": { "description": "Prevent comments from being inserted as text nodes", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noCompareNegZero": { "description": "Disallow comparing against -0", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noConfusingLabels": { "description": "Disallow labeled statements that are not loops.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noConstEnum": { "description": "Disallow TypeScript const enum", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noDebugger": { "description": "Disallow the use of debugger", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noDoubleEquals": { "description": "Require the use of === and !==", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noDuplicateCase": { "description": "Disallow duplicate case labels. If a switch statement has duplicate test expressions in case clauses, it is likely that a programmer copied a case clause but forgot to change the test expression.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noDuplicateClassMembers": { "description": "Disallow duplicate class members.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noDuplicateObjectKeys": { "description": "Prevents object literals having more than one property declaration for the same name. If an object property with the same name is defined multiple times (except when combining a getter with a setter), only the last definition makes it into the object and previous definitions are ignored, which is likely a mistake.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noDuplicateParameters": { "description": "Disallow duplicate function parameter name.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noEmptyInterface": { "description": "Disallow the declaration of empty interfaces.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noExplicitAny": { "description": "Disallow the any type usage.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noExtraNonNullAssertion": { "description": "Prevents the wrong usage of the non-null assertion operator (!) in TypeScript files.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noFunctionAssign": { "description": "Disallow reassigning function declarations.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noImportAssign": { "description": "Disallow assigning to imported bindings", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noLabelVar": { "description": "Disallow labels that share a name with a variable", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noPrototypeBuiltins": { "description": "Disallow direct use of Object.prototype builtins.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noRedeclare": { "description": "Disallow variable, function, class, and type redeclarations in the same scope.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noRedundantUseStrict": { "description": "Prevents from having redundant \"use strict\".", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noSelfCompare": { "description": "Disallow comparisons where both sides are exactly the same.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noShadowRestrictedNames": { "description": "Disallow identifiers from shadowing restricted names.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noSparseArray": { "description": "Disallow sparse arrays", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "noUnsafeNegation": { "description": "Disallow using unsafe negation.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "recommended": { "description": "It enables the recommended rules for this group", "type": ["boolean", "null"] }, "useDefaultSwitchClauseLast": { "description": "Enforce default clauses in switch statements to be last", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useNamespaceKeyword": { "description": "Require using the namespace keyword over the module keyword to declare TypeScript namespaces.", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] }, "useValidTypeof": { "description": "This rule verifies the result of typeof $expr unary expressions is being compared to valid values, either string literals containing valid type names or other typeof expressions", "anyOf": [ { "$ref": "#/definitions/RuleConfiguration" }, { "type": "null" } ] } } }, "TrailingComma": { "description": "Print trailing commas wherever possible in multi-line comma-separated syntactic structures.", "oneOf": [ { "description": "Trailing commas wherever possible (including function parameters and calls).", "type": "string", "enum": ["all"] }, { "description": "Trailing commas where valid in ES5 (objects, arrays, etc.). No trailing commas in type parameters in TypeScript.", "type": "string", "enum": ["es5"] }, { "description": "No trailing commas.", "type": "string", "enum": ["none"] } ] }, "VcsClientKind": { "oneOf": [ { "description": "Integration with the git client as VCS", "type": "string", "enum": ["git"] } ] }, "VcsConfiguration": { "description": "Set of properties to integrate Rome with a VCS software.", "type": "object", "properties": { "clientKind": { "description": "The kind of client.", "anyOf": [ { "$ref": "#/definitions/VcsClientKind" }, { "type": "null" } ] }, "enabled": { "description": "Whether Rome should integrate itself with the VCS client", "type": ["boolean", "null"] }, "root": { "description": "The folder where Rome should check for VCS files. By default, Rome will use the same folder where `rome.json` was found.\n\nIf Rome can't find the configuration, it will attempt to use the current working directory. If no current working directory can't be found, Rome won't use the VCS integration, and a diagnostic will be emitted", "type": ["string", "null"] }, "useIgnoreFile": { "description": "Whether Rome should use the VCS ignore file. When [true], Rome will ignore the files specified in the ignore file.", "type": ["boolean", "null"] } }, "additionalProperties": false } } }