@dovenv/lint
- API documentation โ
Classes โ
CommitLint โ
Extends โ
LintSuper
<CommitlintConfig
>
Constructors โ
new CommitLint() โ
ts
new CommitLint(opts: undefined | CommitlintConfig, utils: CommandSuper): CommitLint
Parameters โ
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): Eslint
Parameters โ
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): Lint
Parameters โ
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): PubLint
Parameters โ
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): StagedLint
Parameters โ
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): StyleLint
Parameters โ
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): Config
Configures 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