@hint/parser-package-json v1.1.43
package.json config (@hint/parser-package-json)
This parser detects if a package.json file is present in the project and
validates its configuration against the package.json schema.
This package is installed automatically by webhint:
npm install hint --save-devTo use it, activate it via the .hintrc configuration file:
{
"connector": {...},
"formatters": [...],
"hints": {
...
},
"parsers": ["package-json"],
...
}Note: The recommended way of running webhint is as a devDependency of
your project.
Events emitted
This parser emits the following events:
parse::start::package-json, of typePackageJsonParseStartwhich contains the following information:resource: the resource we are going to parse.
parse::end::package-json, of typePackageJsonParsedwhich contains the following information:resource: the parsed resource.config: an object with a valid configuration.getLocation: method yeilding the resource's problem location.
parse::error::package-json::json, of typePackageJsonInvalidJSONwhich contains the following information:resource: the parsed resource.error: the error emited parsing the package.json.
parse::error::package-json::schema, of typePackageJsonInvalidSchemawhich contains the following information:resource: the parsed resource.error: the error message.errors: all the errors that the schama validator returns.prettifiedErrors: the errors formatted in a way that is easy to understand.
Types
If you need to import any type or enum defined in this parser, you need to import them as follows:
import { TypeOrEnumYouWantToUse } from '@hint/parser-package-json';1 year ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago