• Version 0.24.0
  • Published
  • 42.2 kB
  • 3 dependencies
  • Apache-2.0 license


npm i @fimbul/ymir
yarn add @fimbul/ymir
pnpm add @fimbul/ymir


Core library for the Fimbullinter project







Type Aliases



variable Finding

const Finding: { compare(a: Finding, b: Finding): number };

    variable Replacement

    const Replacement: {
    replace(start: number, end: number, text: string): Replacement;
    append(pos: number, text: string): Replacement;
    delete(start: number, end: number): Replacement;


      function excludeDeclarationFiles

      excludeDeclarationFiles: (target: typeof AbstractRule) => void;

        function predicate

        predicate: (check: RulePredicate) => (target: typeof AbstractRule) => void;

          function requireLibraryFile

          requireLibraryFile: (fileName: string) => (target: typeof TypedRule) => void;

            function requiresCompilerOption

            requiresCompilerOption: (option: any) => (target: typeof TypedRule) => void;

              function typescriptOnly

              typescriptOnly: (target: typeof AbstractRule) => void;


                class AbstractFormatter

                abstract class AbstractFormatter {}

                  property prefix

                  prefix?: string;

                    method flush

                    flush: () => string | undefined;

                      method format

                      abstract format: (filename: string, summary: FileSummary) => string | undefined;

                        class AbstractProcessor

                        abstract class AbstractProcessor {}


                          constructor(context: ProcessorContext);

                            property settings

                            protected settings: Settings;

                              property source

                              protected source: string;

                                property sourceFileName

                                protected sourceFileName: string;

                                  property targetFileName

                                  protected targetFileName: string;

                                    method getSuffixForFile

                                    static getSuffixForFile: (_context: ProcessorSuffixContext) => string;
                                    • Returns a new primary extension that is appended to the file name, e.g. '.ts'. If the file should not get a new extension, just return an empty string.

                                    method postprocess

                                    abstract postprocess: (
                                    findings: ReadonlyArray<Finding>
                                    ) => ReadonlyArray<Finding>;

                                      method preprocess

                                      abstract preprocess: () => string;

                                        method updateSource

                                        abstract updateSource: (
                                        newSource: string,
                                        changeRange: any
                                        ) => ProcessorUpdateResult;

                                          class AbstractRule

                                          abstract class AbstractRule {}


                                            constructor(context: RuleContext);

                                              property context

                                              readonly context: RuleContext;

                                                property deprecated

                                                static deprecated: string | boolean;

                                                  property program

                                                  readonly program: any;

                                                    property requiresTypeInformation

                                                    static readonly requiresTypeInformation: boolean;

                                                      property sourceFile

                                                      readonly sourceFile: any;

                                                        property supports

                                                        static supports?: RulePredicate;

                                                          method addFinding

                                                          addFinding: (
                                                          start: number,
                                                          end: number,
                                                          message: string,
                                                          fix?: Replacement | ReadonlyArray<Replacement>
                                                          ) => void;

                                                            method addFindingAtNode

                                                            addFindingAtNode: (
                                                            node: any,
                                                            message: string,
                                                            fix?: Replacement | ReadonlyArray<Replacement>
                                                            ) => void;

                                                              method apply

                                                              abstract apply: () => void;

                                                                method validateConfig

                                                                static validateConfig: (config: any) => string[] | string | undefined;

                                                                  class BuiltinResolver

                                                                  abstract class BuiltinResolver {}

                                                                    class CacheFactory

                                                                    abstract class CacheFactory {}

                                                                      class ConfigurableRule

                                                                      abstract class ConfigurableRule<T> extends AbstractRule {}


                                                                        constructor(context: RuleContext);

                                                                          property options

                                                                          options: {};

                                                                            method parseOptions

                                                                            protected abstract parseOptions: (options: {} | null | undefined) => T;

                                                                              class ConfigurableTypedRule

                                                                              abstract class ConfigurableTypedRule<T> extends TypedRule {}


                                                                                constructor(context: TypedRuleContext);

                                                                                  property options

                                                                                  options: {};

                                                                                    method parseOptions

                                                                                    protected abstract parseOptions: (options: {} | null | undefined) => T;

                                                                                      class ConfigurationError

                                                                                      class ConfigurationError extends Error {}

                                                                                        class ConfigurationProvider

                                                                                        abstract class ConfigurationProvider {}

                                                                                          class ContentId

                                                                                          abstract class ContentId {}

                                                                                            class DeprecationHandler

                                                                                            abstract class DeprecationHandler {}

                                                                                              class DirectoryService

                                                                                              abstract class DirectoryService {}

                                                                                                class FileFilterFactory

                                                                                                abstract class FileFilterFactory {}

                                                                                                  class FileSystem

                                                                                                  abstract class FileSystem {}

                                                                                                    class FindingFilterFactory

                                                                                                    abstract class FindingFilterFactory {}

                                                                                                      class FormatterLoaderHost

                                                                                                      abstract class FormatterLoaderHost {}

                                                                                                        class GlobalOptions

                                                                                                        abstract class GlobalOptions {}

                                                                                                          class LineSwitchParser

                                                                                                          abstract class LineSwitchParser {}

                                                                                                            class MessageHandler

                                                                                                            abstract class MessageHandler {}

                                                                                                              class Resolver

                                                                                                              abstract class Resolver {}

                                                                                                                class RuleLoaderHost

                                                                                                                abstract class RuleLoaderHost {}

                                                                                                                  class StatePersistence

                                                                                                                  abstract class StatePersistence {}

                                                                                                                    class TypedRule

                                                                                                                    abstract class TypedRule extends AbstractRule {}


                                                                                                                      constructor(context: TypedRuleContext);

                                                                                                                        property checker

                                                                                                                        readonly checker: any;
                                                                                                                        • Lazily evaluated getter for TypeChecker. Use this instead of this.program.getTypeChecker() to avoid wasting CPU cycles.

                                                                                                                        property context

                                                                                                                        readonly context: TypedRuleContext;

                                                                                                                          property program

                                                                                                                          readonly program: any;

                                                                                                                            property requiresTypeInformation

                                                                                                                            static readonly requiresTypeInformation: boolean;


                                                                                                                              interface BuiltinResolver

                                                                                                                              interface BuiltinResolver {}

                                                                                                                                method resolveConfig

                                                                                                                                resolveConfig: (name: string) => string;

                                                                                                                                  method resolveFormatter

                                                                                                                                  resolveFormatter: (name: string) => string;

                                                                                                                                    method resolveRule

                                                                                                                                    resolveRule: (name: string) => string;

                                                                                                                                      interface Cache

                                                                                                                                      interface Cache<K, V> {}

                                                                                                                                        method clear

                                                                                                                                        clear: () => void;

                                                                                                                                          method delete

                                                                                                                                          delete: (key: K) => void;

                                                                                                                                            method get

                                                                                                                                            get: (key: K) => V | undefined;

                                                                                                                                              method has

                                                                                                                                              has: (key: K) => boolean;

                                                                                                                                                method set

                                                                                                                                                set: (key: K, value: V) => void;

                                                                                                                                                  interface CacheFactory

                                                                                                                                                  interface CacheFactory {}

                                                                                                                                                    method create

                                                                                                                                                    create: {
                                                                                                                                                    <K extends object, V = any>(weak: true): Cache<K, V>;
                                                                                                                                                    <K = any, V = any>(weak?: false): Cache<K, V>;
                                                                                                                                                    • Creates a new cache instance.

                                                                                                                                                    interface Configuration

                                                                                                                                                    interface Configuration {}

                                                                                                                                                      property aliases

                                                                                                                                                      readonly aliases?: ReadonlyMap<string, Configuration.Alias>;

                                                                                                                                                        property exclude

                                                                                                                                                        readonly exclude?: ReadonlyArray<string>;

                                                                                                                                                          property extends

                                                                                                                                                          readonly extends: ReadonlyArray<Configuration>;

                                                                                                                                                            property filename

                                                                                                                                                            readonly filename: string;

                                                                                                                                                              property overrides

                                                                                                                                                              readonly overrides?: ReadonlyArray<Configuration.Override>;

                                                                                                                                                                property processor

                                                                                                                                                                readonly processor?: string | null | false;

                                                                                                                                                                  property rules

                                                                                                                                                                  readonly rules?: ReadonlyMap<string, Configuration.RuleConfig>;

                                                                                                                                                                    property rulesDirectories

                                                                                                                                                                    readonly rulesDirectories?: Configuration.RulesDirectoryMap;

                                                                                                                                                                      property settings

                                                                                                                                                                      readonly settings?: Settings;

                                                                                                                                                                        interface ConfigurationProvider

                                                                                                                                                                        interface ConfigurationProvider {}

                                                                                                                                                                          method find

                                                                                                                                                                          find: (fileToLint: string) => string | undefined;

                                                                                                                                                                            method load

                                                                                                                                                                            load: (fileName: string, context: LoadConfigurationContext) => Configuration;

                                                                                                                                                                              method resolve

                                                                                                                                                                              resolve: (name: string, basedir: string) => string;

                                                                                                                                                                                interface ContentId

                                                                                                                                                                                interface ContentId {}

                                                                                                                                                                                  method forFile

                                                                                                                                                                                  forFile: (fileName: string, host: ContentIdHost) => string;

                                                                                                                                                                                    interface DeprecationHandler

                                                                                                                                                                                    interface DeprecationHandler {}

                                                                                                                                                                                      method handle

                                                                                                                                                                                      handle: (target: DeprecationTarget, name: string, text?: string) => void;

                                                                                                                                                                                        interface DirectoryService

                                                                                                                                                                                        interface DirectoryService {}

                                                                                                                                                                                          method getCurrentDirectory

                                                                                                                                                                                          getCurrentDirectory: () => string;

                                                                                                                                                                                            method getHomeDirectory

                                                                                                                                                                                            getHomeDirectory: () => string;

                                                                                                                                                                                              interface Dirent

                                                                                                                                                                                              interface Dirent extends Stats {}

                                                                                                                                                                                                property name

                                                                                                                                                                                                name: string;
                                                                                                                                                                                                  isSymbolicLink: () => boolean;

                                                                                                                                                                                                    interface EffectiveConfiguration

                                                                                                                                                                                                    interface EffectiveConfiguration {}

                                                                                                                                                                                                      property rules

                                                                                                                                                                                                      rules: Map<string, EffectiveConfiguration.RuleConfig>;

                                                                                                                                                                                                        property settings

                                                                                                                                                                                                        settings: Map<string, any>;

                                                                                                                                                                                                          interface FileFilter

                                                                                                                                                                                                          interface FileFilter {}

                                                                                                                                                                                                            method filter

                                                                                                                                                                                                            filter: (file: any) => boolean;
                                                                                                                                                                                                            • Returns

                                                                                                                                                                                                              true if the file should be linted, false if it should be filtered out. Intended for use in Array.prototype.filter.

                                                                                                                                                                                                            interface FileFilterContext

                                                                                                                                                                                                            interface FileFilterContext {}

                                                                                                                                                                                                              property host

                                                                                                                                                                                                              host: Required<Pick<ts.CompilerHost, 'directoryExists'>>;

                                                                                                                                                                                                                property program

                                                                                                                                                                                                                program: ts.Program;

                                                                                                                                                                                                                  interface FileFilterFactory

                                                                                                                                                                                                                  interface FileFilterFactory {}

                                                                                                                                                                                                                    method create

                                                                                                                                                                                                                    create: (context: FileFilterContext) => FileFilter;

                                                                                                                                                                                                                      interface FileSystem

                                                                                                                                                                                                                      interface FileSystem {}
                                                                                                                                                                                                                      • Low level file system access. All methods are supposed to throw an error on failure.

                                                                                                                                                                                                                      method createDirectory

                                                                                                                                                                                                                      createDirectory: (dir: string) => void;
                                                                                                                                                                                                                      • Creates a single directory and fails on error. Is not supposed to create multiple directories.

                                                                                                                                                                                                                      method deleteFile

                                                                                                                                                                                                                      deleteFile: (path: string) => void;
                                                                                                                                                                                                                      • Deletes a given file. Is not supposed to delete or clear a directory.

                                                                                                                                                                                                                      method normalizePath

                                                                                                                                                                                                                      normalizePath: (path: string) => string;
                                                                                                                                                                                                                      • Normalizes the path to enable reliable caching in consuming services.

                                                                                                                                                                                                                      method readDirectory

                                                                                                                                                                                                                      readDirectory: (dir: string) => Array<string | Dirent>;
                                                                                                                                                                                                                      • Reads directory entries. Returns only the basenames optionally with file type information.

                                                                                                                                                                                                                      method readFile

                                                                                                                                                                                                                      readFile: (file: string) => string;
                                                                                                                                                                                                                      • Reads the given file. Tries to infer and convert encoding.

                                                                                                                                                                                                                      method realpath

                                                                                                                                                                                                                      realpath: (path: string) => string;
                                                                                                                                                                                                                      • Gets the realpath of a given file or directory.

                                                                                                                                                                                                                      method stat

                                                                                                                                                                                                                      stat: (path: string) => Stats;
                                                                                                                                                                                                                      • Gets the status of a file or directory.

                                                                                                                                                                                                                      method writeFile

                                                                                                                                                                                                                      writeFile: (file: string, content: string) => void;
                                                                                                                                                                                                                      • Writes content to the file, overwriting the existing content. Creates the file if necessary.

                                                                                                                                                                                                                      interface Finding

                                                                                                                                                                                                                      interface Finding {}

                                                                                                                                                                                                                        property end

                                                                                                                                                                                                                        readonly end: FindingPosition;

                                                                                                                                                                                                                          property fix

                                                                                                                                                                                                                          readonly fix: Fix | undefined;

                                                                                                                                                                                                                            property message

                                                                                                                                                                                                                            readonly message: string;

                                                                                                                                                                                                                              property ruleName

                                                                                                                                                                                                                              readonly ruleName: string;

                                                                                                                                                                                                                                property severity

                                                                                                                                                                                                                                readonly severity: Severity;

                                                                                                                                                                                                                                  property start

                                                                                                                                                                                                                                  readonly start: FindingPosition;

                                                                                                                                                                                                                                    interface FindingFilter

                                                                                                                                                                                                                                    interface FindingFilter {}

                                                                                                                                                                                                                                      method filter

                                                                                                                                                                                                                                      filter: (finding: Finding) => boolean;
                                                                                                                                                                                                                                      • Returns

                                                                                                                                                                                                                                        true if the finding should be used, false if it should be filtered out. Intended for use in Array.prototype.filter.

                                                                                                                                                                                                                                      method reportUseless

                                                                                                                                                                                                                                      reportUseless: (severity: Severity) => ReadonlyArray<Finding>;
                                                                                                                                                                                                                                      • Returns

                                                                                                                                                                                                                                        Findings to report redundant or unused filter directives. This is called after calling filter for all findings in the file.

                                                                                                                                                                                                                                      interface FindingFilterContext

                                                                                                                                                                                                                                      interface FindingFilterContext {}

                                                                                                                                                                                                                                        property ruleNames

                                                                                                                                                                                                                                        ruleNames: ReadonlyArray<string>;

                                                                                                                                                                                                                                          property sourceFile

                                                                                                                                                                                                                                          sourceFile: ts.SourceFile;

                                                                                                                                                                                                                                            method getWrappedAst

                                                                                                                                                                                                                                            getWrappedAst: () => any;

                                                                                                                                                                                                                                              interface FindingFilterFactory

                                                                                                                                                                                                                                              interface FindingFilterFactory {}

                                                                                                                                                                                                                                                method create

                                                                                                                                                                                                                                                create: (context: FindingFilterContext) => FindingFilter;

                                                                                                                                                                                                                                                  interface FindingPosition

                                                                                                                                                                                                                                                  interface FindingPosition {}

                                                                                                                                                                                                                                                    property character

                                                                                                                                                                                                                                                    readonly character: number;

                                                                                                                                                                                                                                                      property line

                                                                                                                                                                                                                                                      readonly line: number;

                                                                                                                                                                                                                                                        property position

                                                                                                                                                                                                                                                        readonly position: number;

                                                                                                                                                                                                                                                          interface Fix

                                                                                                                                                                                                                                                          interface Fix {}

                                                                                                                                                                                                                                                            property replacements

                                                                                                                                                                                                                                                            readonly replacements: ReadonlyArray<Replacement>;

                                                                                                                                                                                                                                                              interface FormatterConstructor

                                                                                                                                                                                                                                                              interface FormatterConstructor {}

                                                                                                                                                                                                                                                                construct signature

                                                                                                                                                                                                                                                                new (): AbstractFormatter;

                                                                                                                                                                                                                                                                  interface FormatterLoaderHost

                                                                                                                                                                                                                                                                  interface FormatterLoaderHost {}

                                                                                                                                                                                                                                                                    method loadCoreFormatter

                                                                                                                                                                                                                                                                    loadCoreFormatter: (name: string) => FormatterConstructor | undefined;

                                                                                                                                                                                                                                                                      method loadCustomFormatter

                                                                                                                                                                                                                                                                      loadCustomFormatter: (
                                                                                                                                                                                                                                                                      name: string,
                                                                                                                                                                                                                                                                      basedir: string
                                                                                                                                                                                                                                                                      ) => FormatterConstructor | undefined;

                                                                                                                                                                                                                                                                        interface LineSwitchParser

                                                                                                                                                                                                                                                                        interface LineSwitchParser {}

                                                                                                                                                                                                                                                                          method parse

                                                                                                                                                                                                                                                                          parse: (context: LineSwitchParserContext) => ReadonlyArray<RawLineSwitch>;

                                                                                                                                                                                                                                                                            interface LineSwitchParserContext

                                                                                                                                                                                                                                                                            interface LineSwitchParserContext {}

                                                                                                                                                                                                                                                                              property sourceFile

                                                                                                                                                                                                                                                                              sourceFile: ts.SourceFile;

                                                                                                                                                                                                                                                                                method getCommentAtPosition

                                                                                                                                                                                                                                                                                getCommentAtPosition: (pos: number) => ts.CommentRange | undefined;

                                                                                                                                                                                                                                                                                  interface LintAndFixFileResult

                                                                                                                                                                                                                                                                                  interface LintAndFixFileResult {}

                                                                                                                                                                                                                                                                                    property content

                                                                                                                                                                                                                                                                                    content: string;

                                                                                                                                                                                                                                                                                      property findings

                                                                                                                                                                                                                                                                                      findings: ReadonlyArray<Finding>;

                                                                                                                                                                                                                                                                                        property fixes

                                                                                                                                                                                                                                                                                        fixes: number;

                                                                                                                                                                                                                                                                                          interface LoadConfigurationContext

                                                                                                                                                                                                                                                                                          interface LoadConfigurationContext {}

                                                                                                                                                                                                                                                                                            property stack

                                                                                                                                                                                                                                                                                            readonly stack: ReadonlyArray<string>;

                                                                                                                                                                                                                                                                                              method load

                                                                                                                                                                                                                                                                                              load: (name: string) => Configuration;
                                                                                                                                                                                                                                                                                              • Resolves the given name relative to the current configuration file and returns the parsed Configuration. This function detects cycles and caches already loaded configurations.

                                                                                                                                                                                                                                                                                              interface MessageHandler

                                                                                                                                                                                                                                                                                              interface MessageHandler {}

                                                                                                                                                                                                                                                                                                method error

                                                                                                                                                                                                                                                                                                error: (e: Error) => void;

                                                                                                                                                                                                                                                                                                  method log

                                                                                                                                                                                                                                                                                                  log: (message: string) => void;

                                                                                                                                                                                                                                                                                                    method warn

                                                                                                                                                                                                                                                                                                    warn: (message: string) => void;

                                                                                                                                                                                                                                                                                                      interface ProcessorConstructor

                                                                                                                                                                                                                                                                                                      interface ProcessorConstructor {}

                                                                                                                                                                                                                                                                                                        method getSuffixForFile

                                                                                                                                                                                                                                                                                                        getSuffixForFile: (context: ProcessorSuffixContext) => string;

                                                                                                                                                                                                                                                                                                          construct signature

                                                                                                                                                                                                                                                                                                          new (context: ProcessorContext): AbstractProcessor;

                                                                                                                                                                                                                                                                                                            interface ProcessorContext

                                                                                                                                                                                                                                                                                                            interface ProcessorContext {}

                                                                                                                                                                                                                                                                                                              property settings

                                                                                                                                                                                                                                                                                                              settings: Settings;

                                                                                                                                                                                                                                                                                                                property source

                                                                                                                                                                                                                                                                                                                source: string;

                                                                                                                                                                                                                                                                                                                  property sourceFileName

                                                                                                                                                                                                                                                                                                                  sourceFileName: string;

                                                                                                                                                                                                                                                                                                                    property targetFileName

                                                                                                                                                                                                                                                                                                                    targetFileName: string;

                                                                                                                                                                                                                                                                                                                      interface ProcessorSuffixContext

                                                                                                                                                                                                                                                                                                                      interface ProcessorSuffixContext {}

                                                                                                                                                                                                                                                                                                                        property fileName

                                                                                                                                                                                                                                                                                                                        fileName: string;

                                                                                                                                                                                                                                                                                                                          method getSettings

                                                                                                                                                                                                                                                                                                                          getSettings: () => Settings;

                                                                                                                                                                                                                                                                                                                            method readFile

                                                                                                                                                                                                                                                                                                                            readFile: () => string;

                                                                                                                                                                                                                                                                                                                              interface ProcessorUpdateResult

                                                                                                                                                                                                                                                                                                                              interface ProcessorUpdateResult {}

                                                                                                                                                                                                                                                                                                                                property changeRange

                                                                                                                                                                                                                                                                                                                                changeRange?: ts.TextChangeRange;

                                                                                                                                                                                                                                                                                                                                  property transformed

                                                                                                                                                                                                                                                                                                                                  transformed: string;

                                                                                                                                                                                                                                                                                                                                    interface RawLineSwitch

                                                                                                                                                                                                                                                                                                                                    interface RawLineSwitch {}

                                                                                                                                                                                                                                                                                                                                      property enable

                                                                                                                                                                                                                                                                                                                                      readonly enable: boolean;

                                                                                                                                                                                                                                                                                                                                        property end

                                                                                                                                                                                                                                                                                                                                        readonly end?: number;

                                                                                                                                                                                                                                                                                                                                          property location

                                                                                                                                                                                                                                                                                                                                          readonly location: Readonly<ts.TextRange>;

                                                                                                                                                                                                                                                                                                                                            property pos

                                                                                                                                                                                                                                                                                                                                            readonly pos: number;

                                                                                                                                                                                                                                                                                                                                              property rules

                                                                                                                                                                                                                                                                                                                                              readonly rules: ReadonlyArray<RawLineSwitchRule>;

                                                                                                                                                                                                                                                                                                                                                interface RawLineSwitchRule

                                                                                                                                                                                                                                                                                                                                                interface RawLineSwitchRule {}

                                                                                                                                                                                                                                                                                                                                                  property fixLocation

                                                                                                                                                                                                                                                                                                                                                  readonly fixLocation?: Readonly<ts.TextRange>;

                                                                                                                                                                                                                                                                                                                                                    property location

                                                                                                                                                                                                                                                                                                                                                    readonly location?: Readonly<ts.TextRange>;

                                                                                                                                                                                                                                                                                                                                                      property predicate

                                                                                                                                                                                                                                                                                                                                                      readonly predicate: string | RegExp | ((ruleName: string) => boolean);

                                                                                                                                                                                                                                                                                                                                                        interface ReducedConfiguration

                                                                                                                                                                                                                                                                                                                                                        interface ReducedConfiguration extends EffectiveConfiguration {}

                                                                                                                                                                                                                                                                                                                                                          property processor

                                                                                                                                                                                                                                                                                                                                                          processor: string | undefined;

                                                                                                                                                                                                                                                                                                                                                            interface Replacement

                                                                                                                                                                                                                                                                                                                                                            interface Replacement {}

                                                                                                                                                                                                                                                                                                                                                              property end

                                                                                                                                                                                                                                                                                                                                                              readonly end: number;

                                                                                                                                                                                                                                                                                                                                                                property start

                                                                                                                                                                                                                                                                                                                                                                readonly start: number;

                                                                                                                                                                                                                                                                                                                                                                  property text

                                                                                                                                                                                                                                                                                                                                                                  readonly text: string;

                                                                                                                                                                                                                                                                                                                                                                    interface Resolver

                                                                                                                                                                                                                                                                                                                                                                    interface Resolver {}

                                                                                                                                                                                                                                                                                                                                                                      method getDefaultExtensions

                                                                                                                                                                                                                                                                                                                                                                      getDefaultExtensions: () => ReadonlyArray<string>;

                                                                                                                                                                                                                                                                                                                                                                        method require

                                                                                                                                                                                                                                                                                                                                                                        require: (id: string, options?: { cache?: boolean }) => any;

                                                                                                                                                                                                                                                                                                                                                                          method resolve

                                                                                                                                                                                                                                                                                                                                                                          resolve: (
                                                                                                                                                                                                                                                                                                                                                                          id: string,
                                                                                                                                                                                                                                                                                                                                                                          basedir?: string,
                                                                                                                                                                                                                                                                                                                                                                          extensions?: ReadonlyArray<string>,
                                                                                                                                                                                                                                                                                                                                                                          paths?: ReadonlyArray<string>
                                                                                                                                                                                                                                                                                                                                                                          ) => string;

                                                                                                                                                                                                                                                                                                                                                                            interface RuleConstructor

                                                                                                                                                                                                                                                                                                                                                                            interface RuleConstructor<T extends RuleContext = RuleContext> {}

                                                                                                                                                                                                                                                                                                                                                                              property deprecated

                                                                                                                                                                                                                                                                                                                                                                              readonly deprecated?: boolean | string;

                                                                                                                                                                                                                                                                                                                                                                                property requiresTypeInformation

                                                                                                                                                                                                                                                                                                                                                                                readonly requiresTypeInformation: boolean;

                                                                                                                                                                                                                                                                                                                                                                                  property supports

                                                                                                                                                                                                                                                                                                                                                                                  supports?: RulePredicate;

                                                                                                                                                                                                                                                                                                                                                                                    construct signature

                                                                                                                                                                                                                                                                                                                                                                                    new (context: T): AbstractRule;

                                                                                                                                                                                                                                                                                                                                                                                      interface RuleContext

                                                                                                                                                                                                                                                                                                                                                                                      interface RuleContext extends RulePredicateContext {}

                                                                                                                                                                                                                                                                                                                                                                                        property sourceFile

                                                                                                                                                                                                                                                                                                                                                                                        readonly sourceFile: ts.SourceFile;

                                                                                                                                                                                                                                                                                                                                                                                          method addFinding

                                                                                                                                                                                                                                                                                                                                                                                          addFinding: (
                                                                                                                                                                                                                                                                                                                                                                                          start: number,
                                                                                                                                                                                                                                                                                                                                                                                          end: number,
                                                                                                                                                                                                                                                                                                                                                                                          message: string,
                                                                                                                                                                                                                                                                                                                                                                                          fix?: Replacement | ReadonlyArray<Replacement>
                                                                                                                                                                                                                                                                                                                                                                                          ) => void;

                                                                                                                                                                                                                                                                                                                                                                                            method getFlatAst

                                                                                                                                                                                                                                                                                                                                                                                            getFlatAst: () => ReadonlyArray<ts.Node>;

                                                                                                                                                                                                                                                                                                                                                                                              method getWrappedAst

                                                                                                                                                                                                                                                                                                                                                                                              getWrappedAst: () => any;

                                                                                                                                                                                                                                                                                                                                                                                                interface RuleLoaderHost

                                                                                                                                                                                                                                                                                                                                                                                                interface RuleLoaderHost {}

                                                                                                                                                                                                                                                                                                                                                                                                  method loadCoreRule

                                                                                                                                                                                                                                                                                                                                                                                                  loadCoreRule: (name: string) => RuleConstructor | undefined;

                                                                                                                                                                                                                                                                                                                                                                                                    method loadCustomRule

                                                                                                                                                                                                                                                                                                                                                                                                    loadCustomRule: (name: string, directory: string) => RuleConstructor | undefined;

                                                                                                                                                                                                                                                                                                                                                                                                      interface RulePredicateContext

                                                                                                                                                                                                                                                                                                                                                                                                      interface RulePredicateContext {}

                                                                                                                                                                                                                                                                                                                                                                                                        property compilerOptions

                                                                                                                                                                                                                                                                                                                                                                                                        readonly compilerOptions?: ts.CompilerOptions;

                                                                                                                                                                                                                                                                                                                                                                                                          property options

                                                                                                                                                                                                                                                                                                                                                                                                          readonly options: {} | null | undefined;

                                                                                                                                                                                                                                                                                                                                                                                                            property program

                                                                                                                                                                                                                                                                                                                                                                                                            readonly program?: ts.Program;

                                                                                                                                                                                                                                                                                                                                                                                                              property settings

                                                                                                                                                                                                                                                                                                                                                                                                              readonly settings: Settings;

                                                                                                                                                                                                                                                                                                                                                                                                                interface StatePersistence

                                                                                                                                                                                                                                                                                                                                                                                                                interface StatePersistence {}

                                                                                                                                                                                                                                                                                                                                                                                                                  method loadState

                                                                                                                                                                                                                                                                                                                                                                                                                  loadState: (project: string) => StaticProgramState | undefined;

                                                                                                                                                                                                                                                                                                                                                                                                                    method saveState

                                                                                                                                                                                                                                                                                                                                                                                                                    saveState: (project: string, state: StaticProgramState) => void;

                                                                                                                                                                                                                                                                                                                                                                                                                      interface StaticProgramState

                                                                                                                                                                                                                                                                                                                                                                                                                      interface StaticProgramState {}

                                                                                                                                                                                                                                                                                                                                                                                                                        property cs

                                                                                                                                                                                                                                                                                                                                                                                                                        readonly cs: boolean;
                                                                                                                                                                                                                                                                                                                                                                                                                        • Whether the state was created using case-sensitive file names

                                                                                                                                                                                                                                                                                                                                                                                                                        property files

                                                                                                                                                                                                                                                                                                                                                                                                                        readonly files: readonly StaticProgramState.FileState[];
                                                                                                                                                                                                                                                                                                                                                                                                                        • Information about all files in the program

                                                                                                                                                                                                                                                                                                                                                                                                                        property global

                                                                                                                                                                                                                                                                                                                                                                                                                        readonly global: readonly number[];
                                                                                                                                                                                                                                                                                                                                                                                                                        • Index of files that affect global scope

                                                                                                                                                                                                                                                                                                                                                                                                                        property lookup

                                                                                                                                                                                                                                                                                                                                                                                                                        readonly lookup: Readonly<Record<string, number>>;
                                                                                                                                                                                                                                                                                                                                                                                                                        • Maps filename to index in 'files' array

                                                                                                                                                                                                                                                                                                                                                                                                                        property options

                                                                                                                                                                                                                                                                                                                                                                                                                        readonly options: string;
                                                                                                                                                                                                                                                                                                                                                                                                                        • Hash of compilerOptions

                                                                                                                                                                                                                                                                                                                                                                                                                        property ts

                                                                                                                                                                                                                                                                                                                                                                                                                        readonly ts: string;
                                                                                                                                                                                                                                                                                                                                                                                                                        • TypeScript version

                                                                                                                                                                                                                                                                                                                                                                                                                        property v

                                                                                                                                                                                                                                                                                                                                                                                                                        readonly v: number;
                                                                                                                                                                                                                                                                                                                                                                                                                        • Version of the cache format

                                                                                                                                                                                                                                                                                                                                                                                                                        interface Stats

                                                                                                                                                                                                                                                                                                                                                                                                                        interface Stats {}

                                                                                                                                                                                                                                                                                                                                                                                                                          method isDirectory

                                                                                                                                                                                                                                                                                                                                                                                                                          isDirectory: () => boolean;

                                                                                                                                                                                                                                                                                                                                                                                                                            method isFile

                                                                                                                                                                                                                                                                                                                                                                                                                            isFile: () => boolean;

                                                                                                                                                                                                                                                                                                                                                                                                                              interface TypedRuleContext

                                                                                                                                                                                                                                                                                                                                                                                                                              interface TypedRuleContext extends RuleContext {}

                                                                                                                                                                                                                                                                                                                                                                                                                                property compilerOptions

                                                                                                                                                                                                                                                                                                                                                                                                                                readonly compilerOptions: ts.CompilerOptions;

                                                                                                                                                                                                                                                                                                                                                                                                                                  property program

                                                                                                                                                                                                                                                                                                                                                                                                                                  readonly program: ts.Program;


                                                                                                                                                                                                                                                                                                                                                                                                                                    enum DeprecationTarget

                                                                                                                                                                                                                                                                                                                                                                                                                                    enum DeprecationTarget {
                                                                                                                                                                                                                                                                                                                                                                                                                                    Rule = 'rule',
                                                                                                                                                                                                                                                                                                                                                                                                                                    Processor = 'processor',
                                                                                                                                                                                                                                                                                                                                                                                                                                    Formatter = 'formatter',

                                                                                                                                                                                                                                                                                                                                                                                                                                      member Formatter

                                                                                                                                                                                                                                                                                                                                                                                                                                      Formatter = 'formatter'

                                                                                                                                                                                                                                                                                                                                                                                                                                        member Processor

                                                                                                                                                                                                                                                                                                                                                                                                                                        Processor = 'processor'

                                                                                                                                                                                                                                                                                                                                                                                                                                          member Rule

                                                                                                                                                                                                                                                                                                                                                                                                                                          Rule = 'rule'

                                                                                                                                                                                                                                                                                                                                                                                                                                            enum Format

                                                                                                                                                                                                                                                                                                                                                                                                                                            enum Format {
                                                                                                                                                                                                                                                                                                                                                                                                                                            Yaml = 'yaml',
                                                                                                                                                                                                                                                                                                                                                                                                                                            Json = 'json',
                                                                                                                                                                                                                                                                                                                                                                                                                                            Json5 = 'json5',

                                                                                                                                                                                                                                                                                                                                                                                                                                              member Json

                                                                                                                                                                                                                                                                                                                                                                                                                                              Json = 'json'

                                                                                                                                                                                                                                                                                                                                                                                                                                                member Json5

                                                                                                                                                                                                                                                                                                                                                                                                                                                Json5 = 'json5'

                                                                                                                                                                                                                                                                                                                                                                                                                                                  member Yaml

                                                                                                                                                                                                                                                                                                                                                                                                                                                  Yaml = 'yaml'

                                                                                                                                                                                                                                                                                                                                                                                                                                                    Type Aliases

                                                                                                                                                                                                                                                                                                                                                                                                                                                    type ContentIdHost

                                                                                                                                                                                                                                                                                                                                                                                                                                                    type ContentIdHost = Pick<ts.CompilerHost, 'readFile'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                      type FileSummary

                                                                                                                                                                                                                                                                                                                                                                                                                                                      type FileSummary = LintAndFixFileResult;

                                                                                                                                                                                                                                                                                                                                                                                                                                                        type LintResult

                                                                                                                                                                                                                                                                                                                                                                                                                                                        type LintResult = Iterable<[string, FileSummary]>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                          type RulePredicate

                                                                                                                                                                                                                                                                                                                                                                                                                                                          type RulePredicate = (
                                                                                                                                                                                                                                                                                                                                                                                                                                                          sourceFile: ts.SourceFile,
                                                                                                                                                                                                                                                                                                                                                                                                                                                          context: RulePredicateContext
                                                                                                                                                                                                                                                                                                                                                                                                                                                          ) => boolean | string;
                                                                                                                                                                                                                                                                                                                                                                                                                                                          • Returns

                                                                                                                                                                                                                                                                                                                                                                                                                                                            true, false or a reason

                                                                                                                                                                                                                                                                                                                                                                                                                                                          type Settings

                                                                                                                                                                                                                                                                                                                                                                                                                                                          type Settings = ReadonlyMap<string, {} | null | undefined>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                            type Severity

                                                                                                                                                                                                                                                                                                                                                                                                                                                            type Severity = 'error' | 'warning' | 'suggestion';


                                                                                                                                                                                                                                                                                                                                                                                                                                                              namespace Configuration

                                                                                                                                                                                                                                                                                                                                                                                                                                                              namespace Configuration {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                interface Alias

                                                                                                                                                                                                                                                                                                                                                                                                                                                                interface Alias {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  property options

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  readonly options?: any;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    property rule

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    readonly rule: string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      property rulesDirectories

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      readonly rulesDirectories: ReadonlyArray<string> | undefined;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        interface Override

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        interface Override {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          property files

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          readonly files: ReadonlyArray<string>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            property processor

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            readonly processor?: string | null | false;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              property rules

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              readonly rules?: ReadonlyMap<string, RuleConfig>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                property settings

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                readonly settings?: ReadonlyMap<string, any>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  interface RuleConfig

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  interface RuleConfig {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    property options

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    readonly options?: any;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      property rule

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      readonly rule: string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        property rulesDirectories

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        readonly rulesDirectories: ReadonlyArray<string> | undefined;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          property severity

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          readonly severity?: RuleSeverity;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type RulesDirectoryMap

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            type RulesDirectoryMap = ReadonlyMap<string, ReadonlyArray<string>>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type RuleSeverity

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              type RuleSeverity = 'off' | 'warning' | 'error' | 'suggestion';

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                namespace EffectiveConfiguration

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                namespace EffectiveConfiguration {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  interface RuleConfig

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  interface RuleConfig {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    property options

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    options: any;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      property rule

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      rule: string;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        property rulesDirectories

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        rulesDirectories: ReadonlyArray<string> | undefined;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          property severity

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          severity: Configuration.RuleSeverity;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            namespace StaticProgramState

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            namespace StaticProgramState {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              interface FileState

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              interface FileState {}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                property config

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                readonly config?: string;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Hash of the configuration used to produce result for this file

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                property dependencies

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                readonly dependencies?: Readonly<Record<string, null | readonly number[]>>;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Key: module specifier as referenced in the file, order may be random Value: - null if dependency could not be resolved - List of files (or rather their index) that the module specifier resolves to. That is the actual file at that path and/or files containing declare module "..." for that module specifier. May contain the current file. This list is ordered by the ID of the files ascending,

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                property id

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                readonly id: string;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • ID of file contents (typically a hash)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                property result

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                readonly result?: readonly Finding[];
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • The list of findings if this file has up-to-date results

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Package Files (1)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Dependencies (3)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Dev Dependencies (1)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Peer Dependencies (2)


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@fimbul/ymir.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Markdown
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  <a href="https://www.jsdocs.io/package/@fimbul/ymir"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>