UNPKG

projen

Version:

CDK for software projects

1,581 lines • 77.2 kB
/** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. */ export type IRuleAssistConfiguration = "on" | "off"; export type IStringSet = string[]; export type IIndentStyle = "tab" | "space"; export type IIndentWidth = number; export type ILineEnding = "lf" | "crlf" | "cr"; /** * Validated value for the `line_width` formatter options * * The allowed range of values is 1..=320 */ export type ILineWidth = number; export type IQuoteStyle = "double" | "single"; export type IAttributePosition = "auto" | "multiline"; export type IBracketSpacing = boolean; export type IArrowParentheses = "always" | "asNeeded"; export type IQuoteProperties = "asNeeded" | "preserve"; export type ISemicolons = "always" | "asNeeded"; /** * Print trailing commas wherever possible in multi-line comma-separated syntactic structures. */ export type ITrailingCommas = "all" | "es5" | "none"; /** * Indicates the type of runtime or transformation used for interpreting JSX. */ export type IJsxRuntime = "transparent" | "reactClassic"; export type ITrailingCommas2 = "none" | "all"; export type IRuleFixConfiguration = IRulePlainConfiguration | IRuleWithFixNoOptions; export type IRulePlainConfiguration = "warn" | "error" | "info" | "off"; /** * Used to identify the kind of code action emitted by a rule */ export type IFixKind = "none" | "safe" | "unsafe"; export type IAllowDomainConfiguration = IRulePlainConfiguration | IRuleWithAllowDomainOptions; export type INoLabelWithoutControlConfiguration = IRulePlainConfiguration | IRuleWithNoLabelWithoutControlOptions; export type IRuleConfiguration = IRulePlainConfiguration | IRuleWithNoOptions; export type IValidAriaRoleConfiguration = IRulePlainConfiguration | IRuleWithValidAriaRoleOptions; export type IComplexityConfiguration = IRulePlainConfiguration | IRuleWithComplexityOptions; export type IUseExhaustiveDependenciesConfiguration = IRulePlainConfiguration | IRuleWithUseExhaustiveDependenciesOptions; export type IStableHookResult = boolean | number[]; export type IDeprecatedHooksConfiguration = IRulePlainConfiguration | IRuleWithDeprecatedHooksOptions; export type IUseImportExtensionsConfiguration = IRulePlainConfiguration | IRuleWithUseImportExtensionsOptions; export type IRestrictedImportsConfiguration = IRulePlainConfiguration | IRuleWithRestrictedImportsOptions; export type INoRestrictedTypesConfiguration = IRulePlainConfiguration | IRuleWithNoRestrictedTypesOptions; export type ICustomRestrictedType = string | ICustomRestrictedTypeOptions; export type INoSecretsConfiguration = IRulePlainConfiguration | IRuleWithNoSecretsOptions; export type IUseComponentExportOnlyModulesConfiguration = IRulePlainConfiguration | IRuleWithUseComponentExportOnlyModulesOptions; export type IConsistentMemberAccessibilityConfiguration = IRulePlainConfiguration | IRuleWithConsistentMemberAccessibilityOptions; export type IAccessibility = "noPublic" | "explicit" | "none"; export type IUtilityClassSortingConfiguration = IRulePlainConfiguration | IRuleWithUtilityClassSortingOptions; export type IUseValidAutocompleteConfiguration = IRulePlainConfiguration | IRuleWithUseValidAutocompleteOptions; export type IRestrictedGlobalsConfiguration = IRulePlainConfiguration | IRuleWithRestrictedGlobalsOptions; export type IConsistentArrayTypeConfiguration = IRulePlainConfiguration | IRuleWithConsistentArrayTypeOptions; export type IConsistentArrayType = "shorthand" | "generic"; export type IFilenamingConventionConfiguration = IRulePlainConfiguration | IRuleWithFilenamingConventionOptions; /** * Supported cases for file names. */ export type IFilenameCase = "camelCase" | "export" | "kebab-case" | "PascalCase" | "snake_case"; export type IFilenameCases = IFilenameCase[]; export type INamingConventionConfiguration = IRulePlainConfiguration | IRuleWithNamingConventionOptions; /** * Supported cases. */ export type IFormat = "camelCase" | "CONSTANT_CASE" | "PascalCase" | "snake_case"; export type IFormats = IFormat[]; export type IRegex = string; export type IKind = ("class" | "enum" | "interface" | "enumMember" | "importNamespace" | "exportNamespace" | "variable" | "const" | "let" | "using" | "var" | "catchParameter" | "indexParameter" | "exportAlias" | "importAlias" | "classGetter" | "classSetter" | "classMethod" | "objectLiteralProperty" | "objectLiteralGetter" | "objectLiteralSetter" | "objectLiteralMethod" | "typeAlias") | "any" | "typeLike" | "function" | "namespaceLike" | "namespace" | "functionParameter" | "typeParameter" | "classMember" | "classProperty" | "objectLiteralMember" | "typeMember" | "typeGetter" | "typeProperty" | "typeSetter" | "typeMethod"; export type IRestrictedModifier = "abstract" | "private" | "protected" | "readonly" | "static"; export type IModifiers = IRestrictedModifier[]; export type IScope = "any" | "global"; export type INoConsoleConfiguration = IRulePlainConfiguration | IRuleWithNoConsoleOptions; export type INoDoubleEqualsConfiguration = IRulePlainConfiguration | IRuleWithNoDoubleEqualsOptions; export type IOverrides = IOverridePattern[]; export type IVcsClientKind = "git"; /** * The configuration that is contained inside the file `biome.json` */ export interface IConfiguration { /** * A field for the [JSON schema](https://json-schema.org/) specification */ /** * Specific configuration for assists */ assists?: IAssistsConfiguration; /** * Specific configuration for the Css language */ css?: ICssConfiguration; /** * A list of paths to other JSON files, used to extends the current configuration. */ extends?: IStringSet; /** * The configuration of the filesystem */ files?: IFilesConfiguration; /** * The configuration of the formatter */ formatter?: IFormatterConfiguration; /** * Specific configuration for the GraphQL language */ graphql?: IGraphqlConfiguration; /** * Specific configuration for the JavaScript language */ javascript?: IJavascriptConfiguration; /** * Specific configuration for the Json language */ json?: IJsonConfiguration; /** * The configuration for the linter */ linter?: ILinterConfiguration; /** * The configuration of the import sorting */ organizeImports?: IOrganizeImports; /** * A list of granular patterns that should be applied only to a sub set of files */ overrides?: IOverrides; /** * The configuration of the VCS integration */ vcs?: IVcsConfiguration; } export interface IAssistsConfiguration { /** * Whether Biome should fail in CLI if the assists were not applied to the code. */ actions?: IActions; /** * Whether Biome should enable assists via LSP. */ enabled?: boolean; /** * A list of Unix shell style patterns. The formatter will ignore files/folders that will match these patterns. */ ignore?: IStringSet; /** * A list of Unix shell style patterns. The formatter will include files/folders that will match these patterns. */ include?: IStringSet; } export interface IActions { source?: ISource; } /** * A list of rules that belong to this group */ export interface ISource { /** * Enforce props sorting in JSX elements. */ sortJsxProps?: IRuleAssistConfiguration; /** * Sorts the keys of a JSON object in natural order */ useSortedKeys?: IRuleAssistConfiguration; } /** * Options applied to CSS files */ export interface ICssConfiguration { /** * CSS assists options */ assists?: ICssAssists; /** * CSS formatter options */ formatter?: ICssFormatter; /** * CSS linter options */ linter?: ICssLinter; /** * CSS parsing options */ parser?: ICssParser; } /** * Options that changes how the CSS assists behaves */ export interface ICssAssists { /** * Control the assists for CSS files. */ enabled?: boolean; } /** * Options that changes how the CSS formatter behaves */ export interface ICssFormatter { /** * Control the formatter for CSS (and its super languages) files. */ enabled?: boolean; /** * The indent style applied to CSS (and its super languages) files. */ indentStyle?: IIndentStyle; /** * The size of the indentation applied to CSS (and its super languages) files. Default to 2. */ indentWidth?: IIndentWidth; /** * The type of line ending applied to CSS (and its super languages) files. */ lineEnding?: ILineEnding; /** * What's the max width of a line applied to CSS (and its super languages) files. Defaults to 80. */ lineWidth?: ILineWidth; /** * The type of quotes used in CSS code. Defaults to double. */ quoteStyle?: IQuoteStyle; } /** * Options that changes how the CSS linter behaves */ export interface ICssLinter { /** * Control the linter for CSS files. */ enabled?: boolean; } /** * Options that changes how the CSS parser behaves */ export interface ICssParser { /** * Allow comments to appear on incorrect lines in `.css` files */ allowWrongLineComments?: boolean; /** * Enables parsing of CSS Modules specific features. */ cssModules?: boolean; } /** * The configuration of the filesystem */ export interface IFilesConfiguration { /** * A list of Unix shell style patterns. Biome will ignore files/folders that will match these patterns. */ ignore?: IStringSet; /** * Tells Biome to not emit diagnostics when handling files that doesn't know */ ignoreUnknown?: boolean; /** * A list of Unix shell style patterns. Biome will handle only those files/folders that will match these patterns. */ include?: IStringSet; /** * The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons. Defaults to 1 MiB */ maxSize?: number; } /** * Generic options applied to all files */ export interface IFormatterConfiguration { /** * The attribute position style in HTMLish languages. By default auto. */ attributePosition?: IAttributePosition; /** * Whether to insert spaces around brackets in object literals. Defaults to true. */ bracketSpacing?: IBracketSpacing; enabled?: boolean; /** * Stores whether formatting should be allowed to proceed if a given file has syntax errors */ formatWithErrors?: boolean; /** * A list of Unix shell style patterns. The formatter will ignore files/folders that will match these patterns. */ ignore?: IStringSet; /** * A list of Unix shell style patterns. The formatter will include files/folders that will match these patterns. */ include?: IStringSet; /** * The size of the indentation, 2 by default (deprecated, use `indent-width`) */ indentSize?: IIndentWidth; /** * The indent style. */ indentStyle?: IIndentStyle; /** * The size of the indentation, 2 by default */ indentWidth?: IIndentWidth; /** * The type of line ending. */ lineEnding?: ILineEnding; /** * What's the max width of a line. Defaults to 80. */ lineWidth?: ILineWidth; /** * Use any `.editorconfig` files to configure the formatter. Configuration in `biome.json` will override `.editorconfig` configuration. Default: false. */ useEditorconfig?: boolean; } /** * Options applied to GraphQL files */ export interface IGraphqlConfiguration { /** * GraphQL formatter options */ formatter?: IGraphqlFormatter; linter?: IGraphqlLinter; } /** * Options that changes how the GraphQL formatter behaves */ export interface IGraphqlFormatter { /** * Whether to insert spaces around brackets in object literals. Defaults to true. */ bracketSpacing?: IBracketSpacing; /** * Control the formatter for GraphQL files. */ enabled?: boolean; /** * The indent style applied to GraphQL files. */ indentStyle?: IIndentStyle; /** * The size of the indentation applied to GraphQL files. Default to 2. */ indentWidth?: IIndentWidth; /** * The type of line ending applied to GraphQL files. */ lineEnding?: ILineEnding; /** * What's the max width of a line applied to GraphQL files. Defaults to 80. */ lineWidth?: ILineWidth; /** * The type of quotes used in GraphQL code. Defaults to double. */ quoteStyle?: IQuoteStyle; } /** * Options that changes how the GraphQL linter behaves */ export interface IGraphqlLinter { /** * Control the formatter for GraphQL files. */ enabled?: boolean; } /** * A set of options applied to the JavaScript files */ export interface IJavascriptConfiguration { /** * Assists options */ assists?: IJavascriptAssists; /** * Formatting options */ formatter?: IJavascriptFormatter; /** * A list of global bindings that should be ignored by the analyzers * * If defined here, they should not emit diagnostics. */ globals?: IStringSet; /** * Indicates the type of runtime or transformation used for interpreting JSX. */ jsxRuntime?: IJsxRuntime; /** * Linter options */ linter?: IJavascriptLinter; organizeImports?: IJavascriptOrganizeImports; /** * Parsing options */ parser?: IJavascriptParser; } /** * Linter options specific to the JavaScript linter */ export interface IJavascriptAssists { /** * Control the linter for JavaScript (and its super languages) files. */ enabled?: boolean; } /** * Formatting options specific to the JavaScript files */ export interface IJavascriptFormatter { /** * Whether to add non-necessary parentheses to arrow functions. Defaults to "always". */ arrowParentheses?: IArrowParentheses; /** * The attribute position style in jsx elements. Defaults to auto. */ attributePosition?: IAttributePosition; /** * Whether to hug the closing bracket of multiline HTML/JSX tags to the end of the last line, rather than being alone on the following line. Defaults to false. */ bracketSameLine?: boolean; /** * Whether to insert spaces around brackets in object literals. Defaults to true. */ bracketSpacing?: IBracketSpacing; /** * Control the formatter for JavaScript (and its super languages) files. */ enabled?: boolean; /** * The size of the indentation applied to JavaScript (and its super languages) files. Default to 2. */ indentSize?: IIndentWidth; /** * The indent style applied to JavaScript (and its super languages) files. */ indentStyle?: IIndentStyle; /** * The size of the indentation applied to JavaScript (and its super languages) files. Default to 2. */ indentWidth?: IIndentWidth; /** * The type of quotes used in JSX. Defaults to double. */ jsxQuoteStyle?: IQuoteStyle; /** * The type of line ending applied to JavaScript (and its super languages) files. */ lineEnding?: ILineEnding; /** * What's the max width of a line applied to JavaScript (and its super languages) files. Defaults to 80. */ lineWidth?: ILineWidth; /** * When properties in objects are quoted. Defaults to asNeeded. */ quoteProperties?: IQuoteProperties; /** * The type of quotes used in JavaScript code. Defaults to double. */ quoteStyle?: IQuoteStyle; /** * Whether the formatter prints semicolons for all statements or only in for statements where it is necessary because of ASI. */ semicolons?: ISemicolons; /** * Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to "all". */ trailingComma?: ITrailingCommas; /** * Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to "all". */ trailingCommas?: ITrailingCommas; } /** * Linter options specific to the JavaScript linter */ export interface IJavascriptLinter { /** * Control the linter for JavaScript (and its super languages) files. */ enabled?: boolean; } export interface IJavascriptOrganizeImports { } /** * Options that changes how the JavaScript parser behaves */ export interface IJavascriptParser { /** * It enables the experimental and unsafe parsing of parameter decorators * * These decorators belong to an old proposal, and they are subject to change. */ unsafeParameterDecoratorsEnabled?: boolean; } /** * Options applied to JSON files */ export interface IJsonConfiguration { /** * Assists options */ assists?: IJsonAssists; /** * Formatting options */ formatter?: IJsonFormatter; /** * Linting options */ linter?: IJsonLinter; /** * Parsing options */ parser?: IJsonParser; } /** * Linter options specific to the JSON linter */ export interface IJsonAssists { /** * Control the linter for JSON (and its super languages) files. */ enabled?: boolean; } export interface IJsonFormatter { /** * Control the formatter for JSON (and its super languages) files. */ enabled?: boolean; /** * The size of the indentation applied to JSON (and its super languages) files. Default to 2. */ indentSize?: IIndentWidth; /** * The indent style applied to JSON (and its super languages) files. */ indentStyle?: IIndentStyle; /** * The size of the indentation applied to JSON (and its super languages) files. Default to 2. */ indentWidth?: IIndentWidth; /** * The type of line ending applied to JSON (and its super languages) files. */ lineEnding?: ILineEnding; /** * What's the max width of a line applied to JSON (and its super languages) files. Defaults to 80. */ lineWidth?: ILineWidth; /** * Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to "none". */ trailingCommas?: ITrailingCommas2; } /** * Linter options specific to the JSON linter */ export interface IJsonLinter { /** * Control the linter for JSON (and its super languages) files. */ enabled?: boolean; } /** * Options that changes how the JSON parser behaves */ export interface IJsonParser { /** * Allow parsing comments in `.json` files */ allowComments?: boolean; /** * Allow parsing trailing commas in `.json` files */ allowTrailingCommas?: boolean; } export interface ILinterConfiguration { /** * if `false`, it disables the feature and the linter won't be executed. `true` by default */ enabled?: boolean; /** * A list of Unix shell style patterns. The formatter will ignore files/folders that will match these patterns. */ ignore?: IStringSet; /** * A list of Unix shell style patterns. The formatter will include files/folders that will match these patterns. */ include?: IStringSet; /** * List of rules */ rules?: IRules; } export interface IRules { a11y?: IA11y; /** * It enables ALL rules. The rules that belong to `nursery` won't be enabled. */ all?: boolean; complexity?: IComplexity; correctness?: ICorrectness; nursery?: INursery; performance?: IPerformance; /** * It enables the lint rules recommended by Biome. `true` by default. */ recommended?: boolean; security?: ISecurity; style?: IStyle; suspicious?: ISuspicious; } /** * A list of rules that belong to this group */ export interface IA11y { /** * It enables ALL rules for this group. */ all?: boolean; /** * Enforce that the accessKey attribute is not used on any HTML element. */ noAccessKey?: IRuleFixConfiguration; /** * Enforce that aria-hidden="true" is not set on focusable elements. */ noAriaHiddenOnFocusable?: IRuleFixConfiguration; /** * Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes. */ noAriaUnsupportedElements?: IRuleFixConfiguration; /** * Enforce that autoFocus prop is not used on elements. */ noAutofocus?: IRuleFixConfiguration; /** * Disallow target="_blank" attribute without rel="noreferrer" */ noBlankTarget?: IAllowDomainConfiguration; /** * Enforces that no distracting elements are used. */ noDistractingElements?: IRuleFixConfiguration; /** * The scope prop should be used only on \<th> elements. */ noHeaderScope?: IRuleFixConfiguration; /** * Enforce that non-interactive ARIA roles are not assigned to interactive HTML elements. */ noInteractiveElementToNoninteractiveRole?: IRuleFixConfiguration; /** * Enforce that a label element or component has a text label and an associated input. */ noLabelWithoutControl?: INoLabelWithoutControlConfiguration; /** * Enforce that interactive ARIA roles are not assigned to non-interactive HTML elements. */ noNoninteractiveElementToInteractiveRole?: IRuleFixConfiguration; /** * Enforce that tabIndex is not assigned to non-interactive HTML elements. */ noNoninteractiveTabindex?: IRuleFixConfiguration; /** * Prevent the usage of positive integers on tabIndex property */ noPositiveTabindex?: IRuleFixConfiguration; /** * Enforce img alt prop does not contain the word "image", "picture", or "photo". */ noRedundantAlt?: IRuleConfiguration; /** * Enforce explicit role property is not the same as implicit/default role property on an element. */ noRedundantRoles?: IRuleFixConfiguration; /** * Enforces the usage of the title element for the svg element. */ noSvgWithoutTitle?: IRuleConfiguration; /** * It enables the recommended rules for this group */ recommended?: boolean; /** * Enforce that all elements that require alternative text have meaningful information to relay back to the end user. */ useAltText?: IRuleConfiguration; /** * Enforce that anchors have content and that the content is accessible to screen readers. */ useAnchorContent?: IRuleFixConfiguration; /** * Enforce that tabIndex is assigned to non-interactive HTML elements with aria-activedescendant. */ useAriaActivedescendantWithTabindex?: IRuleFixConfiguration; /** * Enforce that elements with ARIA roles must have all required ARIA attributes for that role. */ useAriaPropsForRole?: IRuleConfiguration; /** * Enforces the usage of the attribute type for the element button */ useButtonType?: IRuleConfiguration; /** * Elements with an interactive role and interaction handlers must be focusable. */ useFocusableInteractive?: IRuleConfiguration; /** * Disallow a missing generic family keyword within font families. */ useGenericFontNames?: IRuleConfiguration; /** * 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. */ useHeadingContent?: IRuleConfiguration; /** * Enforce that html element has lang attribute. */ useHtmlLang?: IRuleConfiguration; /** * Enforces the usage of the attribute title for the element iframe. */ useIframeTitle?: IRuleConfiguration; /** * Enforce onClick is accompanied by at least one of the following: onKeyUp, onKeyDown, onKeyPress. */ useKeyWithClickEvents?: IRuleConfiguration; /** * Enforce onMouseOver / onMouseOut are accompanied by onFocus / onBlur. */ useKeyWithMouseEvents?: IRuleConfiguration; /** * Enforces that audio and video elements must have a track for captions. */ useMediaCaption?: IRuleConfiguration; /** * It detects the use of role attributes in JSX elements and suggests using semantic elements instead. */ useSemanticElements?: IRuleConfiguration; /** * Enforce that all anchors are valid, and they are navigable elements. */ useValidAnchor?: IRuleConfiguration; /** * Ensures that ARIA properties aria-* are all valid. */ useValidAriaProps?: IRuleFixConfiguration; /** * Elements with ARIA roles must use a valid, non-abstract ARIA role. */ useValidAriaRole?: IValidAriaRoleConfiguration; /** * Enforce that ARIA state and property values are valid. */ useValidAriaValues?: IRuleConfiguration; /** * Ensure that the attribute passed to the lang attribute is a correct ISO language and/or country. */ useValidLang?: IRuleConfiguration; } export interface IRuleWithFixNoOptions { /** * The kind of the code actions emitted by the rule */ fix?: IFixKind; /** * The severity of the emitted diagnostics by the rule */ level: IRulePlainConfiguration; } export interface IRuleWithAllowDomainOptions { /** * The kind of the code actions emitted by the rule */ fix?: IFixKind; /** * The severity of the emitted diagnostics by the rule */ level: IRulePlainConfiguration; /** * Rule's options */ options?: IAllowDomainOptions; } export interface IAllowDomainOptions { /** * List of domains to allow `target="_blank"` without `rel="noreferrer"` */ allowDomains?: string[]; } export interface IRuleWithNoLabelWithoutControlOptions { /** * The severity of the emitted diagnostics by the rule */ level: IRulePlainConfiguration; /** * Rule's options */ options?: INoLabelWithoutControlOptions; } export interface INoLabelWithoutControlOptions { /** * Array of component names that should be considered the same as an `input` element. */ inputComponents?: string[]; /** * Array of attributes that should be treated as the `label` accessible text content. */ labelAttributes?: string[]; /** * Array of component names that should be considered the same as a `label` element. */ labelComponents?: string[]; } export interface IRuleWithNoOptions { /** * The severity of the emitted diagnostics by the rule */ level: IRulePlainConfiguration; } export interface IRuleWithValidAriaRoleOptions { /** * The kind of the code actions emitted by the rule */ fix?: IFixKind; /** * The severity of the emitted diagnostics by the rule */ level: IRulePlainConfiguration; /** * Rule's options */ options?: IValidAriaRoleOptions; } export interface IValidAriaRoleOptions { allowInvalidRoles?: string[]; ignoreNonDom?: boolean; } /** * A list of rules that belong to this group */ export interface IComplexity { /** * It enables ALL rules for this group. */ all?: boolean; /** * Disallow primitive type aliases and misleading types. */ noBannedTypes?: IRuleFixConfiguration; /** * Disallow empty type parameters in type aliases and interfaces. */ noEmptyTypeParameters?: IRuleConfiguration; /** * Disallow functions that exceed a given Cognitive Complexity score. */ noExcessiveCognitiveComplexity?: IComplexityConfiguration; /** * This rule enforces a maximum depth to nested describe() in test files. */ noExcessiveNestedTestSuites?: IRuleConfiguration; /** * Disallow unnecessary boolean casts */ noExtraBooleanCast?: IRuleFixConfiguration; /** * Prefer for...of statement instead of Array.forEach. */ noForEach?: IRuleConfiguration; /** * Disallow unclear usage of consecutive space characters in regular expression literals */ noMultipleSpacesInRegularExpressionLiterals?: IRuleFixConfiguration; /** * This rule reports when a class has no non-static members, such as for a class used exclusively as a static namespace. */ noStaticOnlyClass?: IRuleConfiguration; /** * Disallow this and super in static contexts. */ noThisInStatic?: IRuleFixConfiguration; /** * Disallow unnecessary catch clauses. */ noUselessCatch?: IRuleFixConfiguration; /** * Disallow unnecessary constructors. */ noUselessConstructor?: IRuleFixConfiguration; /** * Disallow empty exports that don't change anything in a module file. */ noUselessEmptyExport?: IRuleFixConfiguration; /** * Disallow unnecessary fragments */ noUselessFragments?: IRuleFixConfiguration; /** * Disallow unnecessary labels. */ noUselessLabel?: IRuleFixConfiguration; /** * Disallow unnecessary nested block statements. */ noUselessLoneBlockStatements?: IRuleFixConfiguration; /** * Disallow renaming import, export, and destructured assignments to the same name. */ noUselessRename?: IRuleFixConfiguration; /** * Disallow unnecessary concatenation of string or template literals. */ noUselessStringConcat?: IRuleFixConfiguration; /** * Disallow useless case in switch statements. */ noUselessSwitchCase?: IRuleFixConfiguration; /** * Disallow ternary operators when simpler alternatives exist. */ noUselessTernary?: IRuleFixConfiguration; /** * Disallow useless this aliasing. */ noUselessThisAlias?: IRuleFixConfiguration; /** * Disallow using any or unknown as type constraint. */ noUselessTypeConstraint?: IRuleFixConfiguration; /** * Disallow initializing variables to undefined. */ noUselessUndefinedInitialization?: IRuleFixConfiguration; /** * Disallow the use of void operators, which is not a familiar operator. */ noVoid?: IRuleConfiguration; /** * Disallow with statements in non-strict contexts. */ noWith?: IRuleConfiguration; /** * It enables the recommended rules for this group */ recommended?: boolean; /** * Use arrow functions over function expressions. */ useArrowFunction?: IRuleFixConfiguration; /** * Use Date.now() to get the number of milliseconds since the Unix Epoch. */ useDateNow?: IRuleFixConfiguration; /** * Promotes the use of .flatMap() when map().flat() are used together. */ useFlatMap?: IRuleFixConfiguration; /** * Enforce the usage of a literal access to properties over computed property access. */ useLiteralKeys?: IRuleFixConfiguration; /** * Enforce using concise optional chain instead of chained logical expressions. */ useOptionalChain?: IRuleFixConfiguration; /** * Enforce the use of the regular expression literals instead of the RegExp constructor if possible. */ useRegexLiterals?: IRuleFixConfiguration; /** * Disallow number literal object member names which are not base10 or uses underscore as separator */ useSimpleNumberKeys?: IRuleFixConfiguration; /** * Discard redundant terms from logical expressions. */ useSimplifiedLogicExpression?: IRuleFixConfiguration; } export interface IRuleWithComplexityOptions { /** * The severity of the emitted diagnostics by the rule */ level: IRulePlainConfiguration; /** * Rule's options */ options?: IComplexityOptions; } /** * Options for the rule `noExcessiveCognitiveComplexity`. */ export interface IComplexityOptions { /** * The maximum complexity score that we allow. Anything higher is considered excessive. */ maxAllowedComplexity?: number; } /** * A list of rules that belong to this group */ export interface ICorrectness { /** * It enables ALL rules for this group. */ all?: boolean; /** * Prevent passing of children as props. */ noChildrenProp?: IRuleConfiguration; /** * Prevents from having const variables being re-assigned. */ noConstAssign?: IRuleFixConfiguration; /** * Disallow constant expressions in conditions */ noConstantCondition?: IRuleConfiguration; /** * Disallow the use of Math.min and Math.max to clamp a value where the result itself is constant. */ noConstantMathMinMaxClamp?: IRuleFixConfiguration; /** * Disallow returning a value from a constructor. */ noConstructorReturn?: IRuleConfiguration; /** * Disallow empty character classes in regular expression literals. */ noEmptyCharacterClassInRegex?: IRuleConfiguration; /** * Disallows empty destructuring patterns. */ noEmptyPattern?: IRuleConfiguration; /** * Disallow to use unnecessary callback on flatMap. */ noFlatMapIdentity?: IRuleFixConfiguration; /** * Disallow calling global object properties as functions */ noGlobalObjectCalls?: IRuleConfiguration; /** * Disallow function and var declarations that are accessible outside their block. */ noInnerDeclarations?: IRuleConfiguration; /** * Ensure that builtins are correctly instantiated. */ noInvalidBuiltinInstantiation?: IRuleFixConfiguration; /** * Prevents the incorrect use of super() inside classes. It also checks whether a call super() is missing from classes that extends other constructors. */ noInvalidConstructorSuper?: IRuleConfiguration; /** * Disallow non-standard direction values for linear gradient functions. */ noInvalidDirectionInLinearGradient?: IRuleConfiguration; /** * Disallows invalid named grid areas in CSS Grid Layouts. */ noInvalidGridAreas?: IRuleConfiguration; /** * Disallow new operators with global non-constructor functions. */ noInvalidNewBuiltin?: IRuleFixConfiguration; /** * Disallow the use of @import at-rules in invalid positions. */ noInvalidPositionAtImportRule?: IRuleConfiguration; /** * Disallow the use of variables and function parameters before their declaration */ noInvalidUseBeforeDeclaration?: IRuleConfiguration; /** * Disallow new operators with the Symbol object. */ noNewSymbol?: IRuleFixConfiguration; /** * Forbid the use of Node.js builtin modules. */ noNodejsModules?: IRuleConfiguration; /** * Disallow \8 and \9 escape sequences in string literals. */ noNonoctalDecimalEscape?: IRuleFixConfiguration; /** * Disallow literal numbers that lose precision */ noPrecisionLoss?: IRuleConfiguration; /** * Prevent the usage of the return value of React.render. */ noRenderReturnValue?: IRuleConfiguration; /** * Disallow assignments where both sides are exactly the same. */ noSelfAssign?: IRuleConfiguration; /** * Disallow returning a value from a setter */ noSetterReturn?: IRuleConfiguration; /** * Disallow comparison of expressions modifying the string case with non-compliant value. */ noStringCaseMismatch?: IRuleFixConfiguration; /** * Disallow lexical declarations in switch clauses. */ noSwitchDeclarations?: IRuleFixConfiguration; /** * Disallow the use of dependencies that aren't specified in the package.json. */ noUndeclaredDependencies?: IRuleConfiguration; /** * Prevents the usage of variables that haven't been declared inside the document. */ noUndeclaredVariables?: IRuleConfiguration; /** * Disallow unknown CSS value functions. */ noUnknownFunction?: IRuleConfiguration; /** * Disallow unknown media feature names. */ noUnknownMediaFeatureName?: IRuleConfiguration; /** * Disallow unknown properties. */ noUnknownProperty?: IRuleConfiguration; /** * Disallow unknown CSS units. */ noUnknownUnit?: IRuleConfiguration; /** * Disallow unmatchable An+B selectors. */ noUnmatchableAnbSelector?: IRuleConfiguration; /** * Avoid using unnecessary continue. */ noUnnecessaryContinue?: IRuleFixConfiguration; /** * Disallow unreachable code */ noUnreachable?: IRuleConfiguration; /** * 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 */ noUnreachableSuper?: IRuleConfiguration; /** * Disallow control flow statements in finally blocks. */ noUnsafeFinally?: IRuleConfiguration; /** * Disallow the use of optional chaining in contexts where the undefined value is not allowed. */ noUnsafeOptionalChaining?: IRuleConfiguration; /** * Disallow unused function parameters. */ noUnusedFunctionParameters?: IRuleFixConfiguration; /** * Disallow unused imports. */ noUnusedImports?: IRuleFixConfiguration; /** * Disallow unused labels. */ noUnusedLabels?: IRuleFixConfiguration; /** * Disallow unused private class members */ noUnusedPrivateClassMembers?: IRuleFixConfiguration; /** * Disallow unused variables. */ noUnusedVariables?: IRuleFixConfiguration; /** * This rules prevents void elements (AKA self-closing elements) from having children. */ noVoidElementsWithChildren?: IRuleFixConfiguration; /** * Disallow returning a value from a function with the return type 'void' */ noVoidTypeReturn?: IRuleConfiguration; /** * It enables the recommended rules for this group */ recommended?: boolean; /** * Disallow Array constructors. */ useArrayLiterals?: IRuleFixConfiguration; /** * Enforce all dependencies are correctly specified in a React hook. */ useExhaustiveDependencies?: IUseExhaustiveDependenciesConfiguration; /** * Enforce that all React hooks are being called from the Top Level component functions. */ useHookAtTopLevel?: IDeprecatedHooksConfiguration; /** * Enforce file extensions for relative imports. */ useImportExtensions?: IUseImportExtensionsConfiguration; /** * Require calls to isNaN() when checking for NaN. */ useIsNan?: IRuleFixConfiguration; /** * Disallow missing key props in iterators/collection literals. */ useJsxKeyInIterable?: IRuleConfiguration; /** * Enforce "for" loop update clause moving the counter in the right direction. */ useValidForDirection?: IRuleConfiguration; /** * Require generator functions to contain yield. */ useYield?: IRuleConfiguration; } export interface IRuleWithUseExhaustiveDependenciesOptions { /** * The severity of the emitted diagnostics by the rule */ level: IRulePlainConfiguration; /** * Rule's options */ options?: IUseExhaustiveDependenciesOptions; } /** * Options for the rule `useExhaustiveDependencies` */ export interface IUseExhaustiveDependenciesOptions { /** * List of hooks of which the dependencies should be validated. */ hooks?: IHook[]; /** * Whether to report an error when a hook has no dependencies array. */ reportMissingDependenciesArray?: boolean; /** * Whether to report an error when a dependency is listed in the dependencies array but isn't used. Defaults to true. */ reportUnnecessaryDependencies?: boolean; } export interface IHook { /** * The "position" of the closure function, starting from zero. * * For example, for React's `useEffect()` hook, the closure index is 0. */ closureIndex?: number; /** * The "position" of the array of dependencies, starting from zero. * * For example, for React's `useEffect()` hook, the dependencies index is 1. */ dependenciesIndex?: number; /** * The name of the hook. */ name?: string; /** * Whether the result of the hook is stable. * * Set to `true` to mark the identity of the hook's return value as stable, or use a number/an array of numbers to mark the "positions" in the return array as stable. * * For example, for React's `useRef()` hook the value would be `true`, while for `useState()` it would be `[1]`. */ stableResult?: IStableHookResult; } export interface IRuleWithDeprecatedHooksOptions { /** * The severity of the emitted diagnostics by the rule */ level: IRulePlainConfiguration; /** * Rule's options */ options?: IDeprecatedHooksOptions; } /** * Options for the `useHookAtTopLevel` rule have been deprecated, since we now use the React hook naming convention to determine whether a function is a hook. */ export interface IDeprecatedHooksOptions { } export interface IRuleWithUseImportExtensionsOptions { /** * The kind of the code actions emitted by the rule */ fix?: IFixKind; /** * The severity of the emitted diagnostics by the rule */ level: IRulePlainConfiguration; /** * Rule's options */ options?: IUseImportExtensionsOptions; } export interface IUseImportExtensionsOptions { /** * A map of custom import extension mappings, where the key is the inspected file extension, and the value is a pair of `module` extension and `component` import extension */ suggestedExtensions?: { [k: string]: ISuggestedExtensionMapping; }; } export interface ISuggestedExtensionMapping { /** * Extension that should be used for component file imports */ component?: string; /** * Extension that should be used for module imports */ module?: string; } /** * A list of rules that belong to this group */ export interface INursery { /** * It enables ALL rules for this group. */ all?: boolean; /** * Disallow use of CommonJs module system in favor of ESM style imports. */ noCommonJs?: IRuleConfiguration; /** * Disallow a lower specificity selector from coming after a higher specificity selector. */ noDescendingSpecificity?: IRuleConfiguration; /** * Disallow direct assignments to document.cookie. */ noDocumentCookie?: IRuleConfiguration; /** * Prevents importing next/document outside of pages/_document.jsx in Next.js projects. */ noDocumentImportInPage?: IRuleConfiguration; /** * Disallow duplicate custom properties within declaration blocks. */ noDuplicateCustomProperties?: IRuleConfiguration; /** * Disallow duplicate conditions in if-else-if chains */ noDuplicateElseIf?: IRuleConfiguration; /** * Disallow duplicate properties within declaration blocks. */ noDuplicateProperties?: IRuleConfiguration; /** * No duplicated fields in GraphQL operations. */ noDuplicatedFields?: IRuleConfiguration; /** * Disallow accessing namespace imports dynamically. */ noDynamicNamespaceImportAccess?: IRuleConfiguration; /** * Disallow TypeScript enum. */ noEnum?: IRuleConfiguration; /** * Disallow exporting an imported variable. */ noExportedImports?: IRuleConfiguration; /** * Prevent usage of \<head> element in a Next.js project. */ noHeadElement?: IRuleConfiguration; /** * Prevent using the next/head module in pages/_document.js on Next.js projects. */ noHeadImportInDocument?: IRuleConfiguration; /** * Prevent usage of \<img> element in a Next.js project. */ noImgElement?: IRuleConfiguration; /** * Disallows the use of irregular whitespace characters. */ noIrregularWhitespace?: IRuleConfiguration; /** * Disallow missing var function for css variables. */ noMissingVarFunction?: IRuleConfiguration; /** * Disallow nested ternary expressions. */ noNestedTernary?: IRuleConfiguration; /** * Disallow octal escape sequences in string literals */ noOctalEscape?: IRuleConfiguration; /** * Disallow the use of process.env. */ noProcessEnv?: IRuleConfiguration; /** * Disallow specified modules when loaded by import or require. */ noRestrictedImports?: IRestrictedImportsConfiguration; /** * Disallow user defined types. */ noRestrictedTypes?: INoRestrictedTypesConfiguration; /** * Disallow usage of sensitive data such as API keys and tokens. */ noSecrets?: INoSecretsConfiguration; /** * Enforce that static, visible elements (such as \<div>) that have click handlers use the valid role attribute. */ noStaticElementInteractions?: IRuleConfiguration; /** * Enforce the use of String.slice() over String.substr() and String.substring(). */ noSubstr?: IRuleFixConfiguration; /** * Disallow template literal placeholder syntax in regular strings. */ noTemplateCurlyInString?: IRuleConfiguration; /** * Disallow unknown pseudo-class selectors. */ noUnknownPseudoClass?: IRuleConfiguration; /** * Disallow unknown pseudo-element selectors. */ noUnknownPseudoElement?: IRuleConfiguration; /** * Disallow unknown type selectors. */ noUnknownTypeSelector?: IRuleConfiguration; /** * Disallow unnecessary escape sequence in regular expression literals. */ noUselessEscapeInRegex?: IRuleFixConfiguration; /** * Disallow unnecessary String.raw function in template string literals without any escape sequence. */ noUselessStringRaw?: IRuleConfiguration; /** * Disallow use of @value rule in css modules. */ noValueAtRule?: IRuleConfiguration; /** * It enables the recommended rules for this group */ recommended?: boolean; /** * Disallow the use of overload signatures that are not next to each other. */ useAdjacentOverloadSignatures?: IRuleConfiguration; /** * Enforce that ARIA properties are valid for the roles that are supported by the element. */ useAriaPropsSupportedByRole?: IRuleConfiguration; /** * Use at() instead of integer index access. */ useAtIndex?: IRuleFixConfiguration; /** * Enforce using single if instead of nested if clauses. */ useCollapsedIf?: IRuleFixConfiguration; /** * Enforce declaring components only within modules that export React Components exclusively. */ useComponentExportOnlyModules?: IUseComponentExportOnlyModulesConfiguration; /** * This rule enforces consistent use of curly braces inside JSX attributes and JSX children. */ useConsistentCurlyBraces?: IRuleFixConfiguration; /** * Require consistent accessibility modifiers on class properties and methods. */ useConsistentMemberAccessibility?: IConsistentMemberAccessibilityConfiguration; /** * Require specifying the reason argument when using @deprecated directive */ useDeprecatedReason?: IRuleConfiguration; /** * Require explicit return types on functions and class methods. */ useExplicitType?: IRuleConfiguration; /** * Enforces the use of a recommended display strategy with Google Fonts. */ useGoogleFontDisplay?: IRuleConfiguration; /** * Require for-in loops to include an if statement. */ useGuardForIn?: IRuleConfiguration; /** * Disallows package private imports. */ useImportRestrictions?: IRuleConfiguration; /** * Enforce the sorting of CSS utility classes. */ useSortedClasses?: IUtilityClassSortingConfiguration; /** * Enforce the use of the directive "use strict" in script files. */ useStrictMode?: IRuleFixConfiguration; /** * Enforce the use of String.trimStart() and String.trimEnd() over String.trimLeft() and String.trimRight(). */ useTrimStartEnd?: IRuleFixConfiguration; /** * Use valid values for the autocomplete attribute on input elements. */ useValidAutocomplete?: IUseValidAutocompleteConfiguration; } export interface IRuleWithRestrictedImportsOptions { /** * The severity of the emitted diagnostics by the rule */ level: IRulePlainConfiguration; /** * Rule's options */ options?: IRestrictedImportsOptions; } /** * Options for the rule `noRestrictedImports`. */ export interface IRestrictedImportsOptions { /** * A list of names that should trigger the rule */ paths?: { [k: string]: string; }; } export interface IRuleWithNoRestrictedTypesOptions { /** * The kind of the code actions emitted by the rule */ fix?: IFixKind; /** * The severity of the emitted diagnostics by the rule */ level: IRulePlainConfiguration; /** * Rule's options */ options?: INoRestrictedTypesOptions; } export interface INoRestrictedTypesOptions { types?: { [k: string]: ICustomRestrictedType; }; } export interface ICustomRestrictedTypeOptions { message?: string; use?: string; } export interface IRuleWithNoSecretsOpti