1.1.42 • Published 10 months ago

@hint/parser-package-json v1.1.42

Weekly downloads
149
License
Apache-2.0
Repository
github
Last release
10 months ago

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-dev

To 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 type PackageJsonParseStart which contains the following information:

    • resource: the resource we are going to parse.
  • parse::end::package-json, of type PackageJsonParsed which 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 type PackageJsonInvalidJSON which contains the following information:

    • resource: the parsed resource.
    • error: the error emited parsing the package.json.
  • parse::error::package-json::schema, of type PackageJsonInvalidSchema which 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.1.42

10 months ago

1.1.41

11 months ago

1.1.40

1 year ago

1.1.39

2 years ago

1.1.38

2 years ago

1.1.37

2 years ago

1.1.36

2 years ago

1.1.35

2 years ago

1.1.34

2 years ago

1.1.33

2 years ago

1.1.32

2 years ago

1.1.31

2 years ago

1.1.29

2 years ago

1.1.30

2 years ago

1.1.28

3 years ago

1.1.27

3 years ago

1.1.26

3 years ago

1.1.25

3 years ago

1.1.24

3 years ago

1.1.23

3 years ago

1.1.22

4 years ago

1.1.21

4 years ago

1.1.20

4 years ago

1.1.19

4 years ago

1.1.18

4 years ago

1.1.17

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.14

5 years ago

1.1.13

5 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago