Skip to content

@dovenv/lint - API documentation

Classes

CommitLint

Extends

  • LintSuper<CommitlintConfig>

Constructors

new CommitLint()
ts
new CommitLint(opts?: CommitlintConfig, config?: Config): CommitLint
Parameters
ParameterType
opts?CommitlintConfig
config?Config
Returns

CommitLint

Inherited from

LintSuper<CommitlintConfig>.constructor

Methods

run()
ts
run(userMsg?: string): Promise<unknown>
Parameters
ParameterType
userMsg?string
Returns

Promise<unknown>

Properties

PropertyTypeDefault valueDescriptionOverridesInherited from
configundefined | ConfigundefinedThe dovenv configuration.-LintSuper.config
helpURLstringhomepageHelp url for your application-LintSuper.helpURL
optsundefined | CommitlintConfigundefinedConfiguration options.-LintSuper.opts
title"commitlint"CMDS.commitlint-LintSuper.title-

Eslint

Extends

  • LintSuper<EslintConfig>

Constructors

new Eslint()
ts
new Eslint(opts?: EslintConfig, config?: Config): Eslint
Parameters
ParameterType
opts?EslintConfig
config?Config
Returns

Eslint

Inherited from

LintSuper<EslintConfig>.constructor

Methods

run()
ts
run(flags?: string[]): Promise<unknown>
Parameters
ParameterType
flags?string[]
Returns

Promise<unknown>

Properties

PropertyTypeDefault valueDescriptionOverridesInherited from
configundefined | ConfigundefinedThe dovenv configuration.-LintSuper.config
helpURLstringhomepageHelp url for your application-LintSuper.helpURL
optsundefined | EslintConfigundefinedConfiguration options.-LintSuper.opts
title"eslint"CMDS.eslint-LintSuper.title-

Lint

Lint class with all lint functions

Extends

Constructors

new Lint()
ts
new Lint(opts?: Config, config?: Config): Lint
Parameters
ParameterType
opts?Config
config?Config
Returns

Lint

Inherited from

LintSuper<Config>.constructor

Methods

commitlint()
ts
commitlint(userMsg?: string): Promise<void>
Parameters
ParameterType
userMsg?string
Returns

Promise<void>

custom()
ts
custom(pattern?: string[]): Promise<unknown>
Parameters
ParameterType
pattern?string[]
Returns

Promise<unknown>

eslint()
ts
eslint(flags: string[]): Promise<unknown>
Parameters
ParameterType
flagsstring[]
Returns

Promise<unknown>

staged()
ts
staged(): Promise<void>
Returns

Promise<void>

stylelint()
ts
stylelint(files?: string[], fix?: boolean): Promise<void>
Parameters
ParameterType
files?string[]
fix?boolean
Returns

Promise<void>

Properties

PropertyTypeDefault valueDescriptionInherited from
configundefined | ConfigundefinedThe dovenv configuration.LintSuper.config
helpURLstringhomepageHelp url for your applicationLintSuper.helpURL
optsundefined | ConfigundefinedConfiguration options.LintSuper.opts
titlestring'lint'-LintSuper.title

StagedLint

Extends

  • LintSuper<LintStagedConfig>

Constructors

new StagedLint()
ts
new StagedLint(opts?: LintStagedConfig, config?: Config): StagedLint
Parameters
ParameterType
opts?LintStagedConfig
config?Config
Returns

StagedLint

Inherited from

LintSuper<LintStagedConfig>.constructor

Methods

run()
ts
run(): Promise<unknown>
Returns

Promise<unknown>

Properties

PropertyTypeDefault valueDescriptionOverridesInherited from
configundefined | ConfigundefinedThe dovenv configuration.-LintSuper.config
helpURLstringhomepageHelp url for your application-LintSuper.helpURL
optsundefined | LintStagedConfigundefinedConfiguration options.-LintSuper.opts
title"staged"CMDS.staged-LintSuper.title-

StyleLint

Extends

  • LintSuper<StylelintConfig>

Constructors

new StyleLint()
ts
new StyleLint(opts?: LinterOptions, config?: Config): StyleLint
Parameters
ParameterType
opts?LinterOptions
config?Config
Returns

StyleLint

Inherited from

LintSuper<StylelintConfig>.constructor

Methods

run()
ts
run(files?: string[], fix?: boolean): Promise<unknown>
Parameters
ParameterType
files?string[]
fix?boolean
Returns

Promise<unknown>

Properties

PropertyTypeDefault valueDescriptionOverridesInherited from
configundefined | ConfigundefinedThe dovenv configuration.-LintSuper.config
helpURLstringhomepageHelp url for your application-LintSuper.helpURL
optsundefined | LinterOptionsundefinedConfiguration options.-LintSuper.opts
title"stylelint"CMDS.stylelint-LintSuper.title-

Functions

lintPlugin()

ts
function lintPlugin(conf?: Config): Config

Configures and returns a DovenvConfig object for linting tools.

Parameters

ParameterTypeDescription
conf?ConfigOptional configuration object for linting.

Returns

Config

A configuration object with custom lint commands and descriptions.

Provides linting commands for different file types and commit messages:

  • staged: Lints staged git files.
  • stylelint: Lints CSS/SCSS/LESS/SASS/PostCSS files with options to fix errors and specify files.
  • eslint: Lints JS/TS/MD/JSON/YAML files.
  • commitlint: Lints commit messages, either the last commit message or a specified message.

Examples include linting CSS files, JS files, commit messages, and staged files.

Type Aliases

Config

ts
type Config: {
  commitlint: CommitlintConfig;
  custom: { [key in string]: Function };
  eslint: EslintConfig;
  staged: LintStagedConfig;
  stylelint: StylelintConfig;
};

Type declaration

NameTypeDescription
commitlint?CommitlintConfigConfig for lint commit messages
custom?{ [key in string]: Function }-
eslint?EslintConfigConfig for lint JS/TS/MD/JSON/YAML.. files
staged?LintStagedConfigConfig for lint staged GIT files
stylelint?StylelintConfigConfig for lint CSS/SCSS/LESS/SASS/PostCSS files

References

default

Renames and re-exports lintPlugin

Namespaces