• Version 2.8.1
  • Published
  • 82.4 kB
  • 15 dependencies
  • MIT license


npm i eclint
yarn add eclint
pnpm add eclint


Validate or fix code that doesn't adhere to EditorConfig settings or infer settings from existing code.



variable charsets

let charsets: {
'\0\0\u00FE\u00FF': string;
'\u00EF\u00BB\u00BF': string;
þÿ: string;
ÿþ: string;
'\u00FF\u00FE\0\0': string;

    variable ruleNames

    let ruleNames: string[];


      function check

      check: (options?: ICheckCommandOptions) => stream.Transform;

        function configure

        configure: (options: IConfigurationOptions) => void;

          function eclint

          eclint: (options?: IOptions) => stream.Transform;

            function fix

            fix: (options?: ICommandOptions) => stream.Transform;

              function infer

              infer: (options?: InferOptions) => stream.Transform;


                interface ICheckCommandOptions

                interface ICheckCommandOptions extends ICommandOptions {}

                  property reporter

                  reporter?: (file: IEditorConfigLintFile, error: EditorConfigError) => void;

                    interface ICommandOptions

                    interface ICommandOptions {}

                      property settings

                      settings?: ISettings;

                        interface IConfigurationOptions

                        interface IConfigurationOptions {}

                          property newlines

                          newlines?: string[];

                            interface IDocumentRule

                            interface IDocumentRule extends IRule {}

                              method check

                              check: (settings: ISettings, doc: doc.IDocument) => EditorConfigError[];

                                method fix

                                fix: (settings: ISettings, doc: doc.IDocument) => doc.IDocument;

                                  method infer

                                  infer: (doc: doc.IDocument) => string | number | boolean;

                                    interface IEditorConfigLintFile

                                    interface IEditorConfigLintFile extends File {}

                                      property contents

                                      contents: Buffer;

                                        property editorconfig

                                        editorconfig?: IEditorConfigLintResult;

                                          interface IEditorConfigLintResult

                                          interface IEditorConfigLintResult {}

                                            property config

                                            config: ISettings;

                                              property errors

                                              errors: EditorConfigError[];

                                                property fixed

                                                fixed: boolean;

                                                  interface ILineRule

                                                  interface ILineRule extends IRule {}

                                                    method check

                                                    check: (settings: ISettings, line: doc.Line) => EditorConfigError;

                                                      method fix

                                                      fix: (settings: ISettings, line: doc.Line) => doc.Line;

                                                        method infer

                                                        infer: (line: doc.Line) => string | number | boolean;

                                                          interface InferOptions

                                                          interface InferOptions {}

                                                            property ini

                                                            ini?: boolean;
                                                            • Exports file as ini file type.

                                                            property root

                                                            root?: boolean;
                                                            • Adds root = true to the top of your ini file, if any.

                                                            property score

                                                            score?: boolean;
                                                            • Shows the tallied score for each setting.

                                                            interface IOptions

                                                            interface IOptions extends ICheckCommandOptions {}

                                                              property fix

                                                              fix?: boolean;

                                                                interface IRule

                                                                interface IRule {}

                                                                  property type

                                                                  type: string;

                                                                    method resolve

                                                                    resolve: (settings: ISettings) => string | number | boolean;

                                                                      interface IScoredSetting

                                                                      interface IScoredSetting {}

                                                                        index signature

                                                                        [key: string]: {
                                                                        [key: string]: number;

                                                                          interface IScoredSettings

                                                                          interface IScoredSettings {}

                                                                            property charset

                                                                            charset?: IScoredSetting;

                                                                              property end_of_line

                                                                              end_of_line?: IScoredSetting;

                                                                                property indent_size

                                                                                indent_size?: IScoredSetting;

                                                                                  property indent_style

                                                                                  indent_style?: IScoredSetting;

                                                                                    property insert_final_newline

                                                                                    insert_final_newline?: IScoredSetting;

                                                                                      property max_line_length

                                                                                      max_line_length?: number;

                                                                                        property trim_trailing_whitespace

                                                                                        trim_trailing_whitespace?: IScoredSetting;

                                                                                          interface ISettings

                                                                                          interface ISettings {}

                                                                                            property block_comment

                                                                                            block_comment?: string;

                                                                                              property block_comment_end

                                                                                              block_comment_end?: string;

                                                                                                property block_comment_start

                                                                                                block_comment_start?: string;

                                                                                                  property charset

                                                                                                  charset?: string;
                                                                                                  • Set to latin1, utf-8, utf-8-bom, utf-16be or utf-16le to control the character set.

                                                                                                  property end_of_line

                                                                                                  end_of_line?: string;
                                                                                                  • Set to lf, cr, or crlf to control how line breaks are represented.

                                                                                                  property indent_size

                                                                                                  indent_size?: number | string;
                                                                                                  • The number of columns used for each indentation level and the width of soft tabs (when supported). When set to tab, the value of tab_width (if specified) will be used.

                                                                                                  property indent_style

                                                                                                  indent_style?: string;
                                                                                                  • Set to tab or space to use hard tabs or soft tabs respectively.

                                                                                                  property insert_final_newline

                                                                                                  insert_final_newline?: boolean;
                                                                                                  • Ensures files ends with a newline.

                                                                                                  property max_line_length

                                                                                                  max_line_length?: number;
                                                                                                  • Enforces the maximum number of columns you can have in a line.

                                                                                                  property tab_width

                                                                                                  tab_width?: number;
                                                                                                  • Number of columns used to represent a tab character. This defaults to the value of indent_size and doesn't usually need to be specified.

                                                                                                  property trim_trailing_whitespace

                                                                                                  trim_trailing_whitespace?: boolean;
                                                                                                  • Removes any whitespace characters preceding newline characters.

                                                                                                  Type Aliases

                                                                                                  type Command

                                                                                                  type Command = (options?: ICommandOptions) => NodeJS.ReadWriteStream;

                                                                                                    Package Files (1)

                                                                                                    Dependencies (15)

                                                                                                    Dev Dependencies (26)

                                                                                                    Peer Dependencies (0)

                                                                                                    No peer dependencies.


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

                                                                                                    You may also use to create a custom badge linking to

                                                                                                    • Markdown
                                                                                                    • HTML
                                                                                                      <a href=""><img src="" alt=""></a>