8
8
![ ci] ( https://github.com/tclindner/npm-package-json-lint/workflows/ci/badge.svg?branch=master )
9
9
[ ![ Netlify Status] ( https://api.netlify.com/api/v1/badges/e76a30d9-13f0-4691-a49b-454570589de2/deploy-status )] ( https://app.netlify.com/sites/npmpackagejsonlint/deploys )
10
10
11
+ - [ npm-package-json-lint] ( #npm-package-json-lint )
12
+ * [ What is npm-package-json-lint?] ( #what-is-npm-package-json-lint- )
13
+ * [ Install and Use] ( #install-and-use )
14
+ + [ System Dependencies] ( #system-dependencies )
15
+ - [ Node] ( #node )
16
+ + [ Use the cli] ( #use-the-cli )
17
+ - [ Use cli globally] ( #use-cli-globally )
18
+ - [ Use cli in project] ( #use-cli-in-project )
19
+ - [ Using the linter] ( #using-the-linter )
20
+ * [ From the command line] ( #from-the-command-line )
21
+ * [ In the program] ( #in-the-program )
22
+ * [ Custom Configuration] ( #custom-configuration )
23
+ * [ Local Development] ( #local-development )
24
+ * [ Documentation] ( #documentation )
25
+ * [ Migrating from v5.x.x to 6.x.x] ( #migrating-from-v5xx-to-6xx )
26
+ * [ Migrating from v4.x.x to 5.x.x] ( #migrating-from-v4xx-to-5xx )
27
+ * [ Migrating from v3.x.x to 4.x.x] ( #migrating-from-v3xx-to-4xx )
28
+ * [ Migrating from v2.x.x to 3.x.x] ( #migrating-from-v2xx-to-3xx )
29
+ * [ Migrating from v1.x.x to 2.x.x] ( #migrating-from-v1xx-to-2xx )
30
+ * [ Migrating from v0.x.x to 1.x.x] ( #migrating-from-v0xx-to-1xx )
31
+ * [ Contributing] ( #contributing )
32
+ * [ Release History] ( #release-history )
33
+ * [ Related] ( #related )
34
+ * [ License] ( #license )
11
35
12
36
## What is npm-package-json-lint?
13
37
14
38
npm-package-json-lint helps enforce standards for your package.json file.
39
+ This helps to ensure that your files are of the highest standard and quality.
40
+ It is also customisable to match your specific project guidline requirements/desires.
41
+ It has support for both command line and programmatic usage.
15
42
Currently it can check for:
16
43
17
44
* validity of data types in nodes. Ex: ` name ` should always be a string.
18
45
* whether a string is a lowercase
19
46
* whether a version number is a valid
20
47
* the presence of a given module
21
48
* the presence of a pre-release version of a module
49
+ * the presence of an author
50
+ * the presence of any bugs
51
+ * valid dependencies
52
+ * valid licenses
22
53
* and much more!
23
54
24
55
Please see the [ website] ( https://npmpackagejsonlint.org/docs/rules ) for a list of rules.
25
56
26
- ## How do I install it?
57
+ ## Install and Use
27
58
28
59
First thing first, let's make sure you have the necessary pre-requisites.
29
60
@@ -44,6 +75,40 @@ First thing first, let's make sure you have the necessary pre-requisites.
44
75
45
76
* ` npm install npm-package-json-lint `
46
77
78
+ #### Using the linter
79
+
80
+ ##### From the command line
81
+
82
+ * Once npm-package-json-lint is installed either in the project or globally it can be run with the
83
+ following command, ` npx npm-package-json-lint ` . This will go through the process of linting/validating
84
+ your code to meet your desired specifications.
85
+
86
+ ##### In the program
87
+
88
+ * The linter can also be used as a module in the program and the output be displayed via a log message.
89
+ Adding the following code to your file can accomplish this.
90
+
91
+ ```
92
+ const npmPackageJsonLint = require("npm-package-json-lint");
93
+ const result = npmPackageJsonLint.lintFiles(["package.json"]);
94
+ console.log(result);
95
+ ```
96
+
97
+ ## Custom Configuration
98
+
99
+ npm-package-json-lint has the ability to be constomly configured to match your desires.
100
+ To configure the linter navigate to the .npmpackagejsonlintrc file in the repository and add
101
+ in or remove your desired rules.
102
+
103
+ ## Local Development
104
+ Follow these steps to get your local environement set up to allow you to contribute to the repository
105
+
106
+ 1 . In the terminal, navigate to the directory in which you want the repository to be cloned.
107
+ 2 . Run this command from the terminal, ` git clone https://github.com/tclindner/npm-package-json-lint.git `
108
+ 3 . After cloning the repository navigate into the project's root directory from the terminal.
109
+ 4 . Run "npm install" to install the necessary dependencies.
110
+ 5 . Your local environment is now set up to create PR's and work on different issues
111
+
47
112
## Documentation
48
113
49
114
[ Website] ( https://npmpackagejsonlint.org )
0 commit comments