2.6.0 • Published 6 months ago

@fasttime/lint v2.6.0

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

@fasttime/lint · npm version

Universal linter with fasttime presets.

Usage

Plain usage:

exports.lint =
async () =>
{
    const { lint } = require('@fasttime/lint');

    await lint({ src, env, fix, globals, parserOptions, rules });
};

Usage with Gulp:

exports.lint =
() =>
{
    const { gulpLint } = require('@fasttime/lint');

    const stream = gulpLint({ src, env, fix, globals, parserOptions, rules });
    return stream;
};

It is also possible to specify a list of configurations, each targeting a different set of files.

await lint({ src: src1, ...config1 }, { src: src2, ...config2 });

or

const stream = gulpLint({ src: src1, ...config1 }, { src: src2, ...config2 });

Settings

src

The setting src is used to specify a glob pattern or a list of glob patterns that match the files to be linted. JavaScript, TypeScript and Gehrkin files are supported. The file type is inferred from the extension according to the following mapping.

ExtensionType
.cjsJavaScript
.ctsTypeScript
.featureGherkin
.jsJavaScript
.mjsJavaScript
.mtsTypeScript
.tsTypeScript

fix

When set to true, linting problems are fixed automatically if possible.

JavaScript and TypeScript options

JavaScript and TypeScript are linted with ESLint. The following ESLint options are supported.

Additionally, the legacy option envs can be used instead of env to specify environments as a string or array of strings rather than with an object.

Gherkin options

Currently, the only specific option for Gherkin files is defaultDialectName, which can be a string specifing the keyword of a supported language. The default is English.

2.5.0

8 months ago

2.6.0

6 months ago

2.5.1

8 months ago

2.3.0

1 year ago

2.2.0

1 year ago

2.4.0

1 year ago

2.1.0

2 years ago

1.7.2

2 years ago

2.0.0-beta.2

2 years ago

2.0.0-beta.1

2 years ago

2.0.0

2 years ago

2.0.0-beta.3

2 years ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.4.2

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.2

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

1.0.0-beta.1

3 years ago