@dovenv/lint - API documentation β
Classes β
CommitLint β
Extends β
LintSuper<CommitlintConfig>
Constructors β
new CommitLint() β
ts
new CommitLint(opts: undefined | CommitlintConfig, utils: CommandSuper): CommitLintParameters β
| Parameter | Type |
|---|---|
opts | undefined | CommitlintConfig |
utils | CommandSuper |
Returns β
Inherited from β
LintSuper<CommitlintConfig>.constructor
Methods β
run() β
ts
run(userMsg?: string): Promise<undefined | void>Parameters β
| Parameter | Type |
|---|---|
userMsg? | string |
Returns β
Promise<undefined | void>
Properties β
| Property | Modifier | Type | Inherited from |
|---|---|---|---|
opts | public | undefined | CommitlintConfig | LintSuper.opts |
utils | public | CommandSuper | LintSuper.utils |
Eslint β
Extends β
LintSuper<EslintConfig>
Constructors β
new Eslint() β
ts
new Eslint(opts: undefined | EslintConfig, utils: CommandSuper): EslintParameters β
| Parameter | Type |
|---|---|
opts | undefined | EslintConfig |
utils | CommandSuper |
Returns β
Inherited from β
LintSuper<EslintConfig>.constructor
Methods β
run() β
ts
run(flags?: string[]): Promise<undefined | void>Parameters β
| Parameter | Type |
|---|---|
flags? | string[] |
Returns β
Promise<undefined | void>
Properties β
| Property | Modifier | Type | Inherited from |
|---|---|---|---|
opts | public | undefined | EslintConfig | LintSuper.opts |
utils | public | CommandSuper | LintSuper.utils |
Lint β
Lint class with all lint functions.
Extends β
LintSuper<Config>
Constructors β
new Lint() β
ts
new Lint(opts: undefined | Config, utils: CommandSuper): LintParameters β
| Parameter | Type |
|---|---|
opts | undefined | Config |
utils | CommandSuper |
Returns β
Inherited from β
LintSuper<Config>.constructor
Methods β
commitlint() β
ts
commitlint(userMsg?: string): Promise<void>Parameters β
| Parameter | Type |
|---|---|
userMsg? | string |
Returns β
Promise<void>
custom() β
ts
custom(pattern?: string[]): Promise<void>Parameters β
| Parameter | Type |
|---|---|
pattern? | string[] |
Returns β
Promise<void>
eslint() β
ts
eslint(flags: string[]): Promise<undefined | void>Parameters β
| Parameter | Type |
|---|---|
flags | string[] |
Returns β
Promise<undefined | void>
publint() β
ts
publint(keys?: string[]): Promise<void>Parameters β
| Parameter | Type |
|---|---|
keys? | string[] |
Returns β
Promise<void>
staged() β
ts
staged(): Promise<void>Returns β
Promise<void>
stylelint() β
ts
stylelint(files?: string[], fix?: boolean): Promise<void>Parameters β
| Parameter | Type |
|---|---|
files? | string[] |
fix? | boolean |
Returns β
Promise<void>
Properties β
| Property | Modifier | Type | Inherited from |
|---|---|---|---|
opts | public | undefined | Config | LintSuper.opts |
utils | public | CommandSuper | LintSuper.utils |
PubLint β
Extends β
LintSuper<PubLintConfig>
Constructors β
new PubLint() β
ts
new PubLint(opts: undefined | PubLintConfig, utils: CommandSuper): PubLintParameters β
| Parameter | Type |
|---|---|
opts | undefined | PubLintConfig |
utils | CommandSuper |
Returns β
Inherited from β
LintSuper<PubLintConfig>.constructor
Methods β
run() β
ts
run(keys?: string[]): Promise<void>Parameters β
| Parameter | Type |
|---|---|
keys? | string[] |
Returns β
Promise<void>
runOne() β
ts
runOne(opts?: PubLintOpts): Promise<void>Parameters β
| Parameter | Type |
|---|---|
opts? | PubLintOpts |
Returns β
Promise<void>
Properties β
| Property | Modifier | Type | Inherited from |
|---|---|---|---|
opts | public | undefined | PubLintConfig | LintSuper.opts |
utils | public | CommandSuper | LintSuper.utils |
StagedLint β
Extends β
LintSuper<LintStagedConfig>
Constructors β
new StagedLint() β
ts
new StagedLint(opts: undefined | LintStagedConfig, utils: CommandSuper): StagedLintParameters β
| Parameter | Type |
|---|---|
opts | undefined | LintStagedConfig |
utils | CommandSuper |
Returns β
Inherited from β
LintSuper<LintStagedConfig>.constructor
Methods β
run() β
ts
run(): Promise<undefined | void>Returns β
Promise<undefined | void>
Properties β
| Property | Modifier | Type | Inherited from |
|---|---|---|---|
opts | public | undefined | LintStagedConfig | LintSuper.opts |
utils | public | CommandSuper | LintSuper.utils |
StyleLint β
Extends β
LintSuper<StylelintConfig>
Constructors β
new StyleLint() β
ts
new StyleLint(opts: undefined | LinterOptions, utils: CommandSuper): StyleLintParameters β
| Parameter | Type |
|---|---|
opts | undefined | LinterOptions |
utils | CommandSuper |
Returns β
Inherited from β
LintSuper<StylelintConfig>.constructor
Methods β
run() β
ts
run(files?: string[], fix?: boolean): Promise<undefined | void>Parameters β
| Parameter | Type |
|---|---|
files? | string[] |
fix? | boolean |
Returns β
Promise<undefined | void>
Properties β
| Property | Modifier | Type | Inherited from |
|---|---|---|---|
opts | public | undefined | LinterOptions | LintSuper.opts |
utils | public | CommandSuper | LintSuper.utils |
Functions β
lintPlugin() β
ts
function lintPlugin(conf?: Config): ConfigConfigures and returns a DovenvConfig object for linting tools.
Parameters β
| Parameter | Type | Description |
|---|---|---|
conf? | Config | Optional 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;
publint: PubLintConfig;
staged: LintStagedConfig;
stylelint: StylelintConfig;
};Type declaration β
| Name | Type | Description |
|---|---|---|
commitlint? | CommitlintConfig | Config for lint commit messages |
custom? | { [key in string]: Function } | Custom lint |
eslint? | EslintConfig | Config for lint JS/TS/MD/JSON/YAML.. Files |
publint? | PubLintConfig | Config for publint |
staged? | LintStagedConfig | Config for lint staged GIT files |
stylelint? | StylelintConfig | Config for lint CSS/SCSS/LESS/SASS/PostCSS files |
References β
default β
Renames and re-exports lintPlugin
