Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump deps * Add prefer-no-dependencies rule Closes #134 * Add prefer-no-optionalDependencies rule Closes #135 * Add prefer-no-peerDependencies rule Closes #136 * Generate v4.1.0 docs * Remove exceptions from docs since they aren't valid for these rules Switch rules to standard rules
- Loading branch information
Showing
19 changed files
with
683 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
id: prefer-no-dependencies | ||
title: prefer-no-dependencies | ||
--- | ||
|
||
Enabling this rule will result in an error being generated if `dependencies` is present. | ||
|
||
## Example .npmpackagejsonlintrc configuration | ||
|
||
```json | ||
{ | ||
"rules": { | ||
"prefer-no-dependencies": "error" | ||
} | ||
} | ||
``` | ||
|
||
## Rule Details | ||
|
||
### *Incorrect* example(s) | ||
|
||
```json | ||
{ | ||
"dependencies": { | ||
"npm-package-json-lint-config-default": "^0.3.0" | ||
} | ||
} | ||
``` | ||
|
||
### *Correct* example(s) | ||
|
||
```json | ||
{ | ||
|
||
} | ||
``` | ||
|
||
## History | ||
|
||
* Introduced in version 4.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
docs/rules/disallowed-nodes/prefer-no-optionalDependencies.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
id: prefer-no-optionalDependencies | ||
title: prefer-no-optionalDependencies | ||
--- | ||
|
||
Enabling this rule will result in an error being generated if `optionalDependencies` is present. | ||
|
||
## Example .npmpackagejsonlintrc configuration | ||
|
||
```json | ||
{ | ||
"rules": { | ||
"prefer-no-optionalDependencies": "error" | ||
} | ||
} | ||
``` | ||
|
||
## Rule Details | ||
|
||
### *Incorrect* example(s) | ||
|
||
```json | ||
{ | ||
"optionalDependencies": { | ||
"npm-package-json-lint-config-default": "^0.3.0" | ||
} | ||
} | ||
``` | ||
|
||
### *Correct* example(s) | ||
|
||
```json | ||
{ | ||
|
||
} | ||
``` | ||
|
||
## History | ||
|
||
* Introduced in version 4.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
id: prefer-no-peerDependencies | ||
title: prefer-no-peerDependencies | ||
--- | ||
|
||
Enabling this rule will result in an error being generated if `peerDependencies` is present. | ||
|
||
## Example .npmpackagejsonlintrc configuration | ||
|
||
```json | ||
{ | ||
"rules": { | ||
"prefer-no-peerDependencies": "error" | ||
} | ||
} | ||
``` | ||
|
||
|
||
## Rule Details | ||
|
||
### *Incorrect* example(s) | ||
|
||
```json | ||
{ | ||
"peerDependencies": { | ||
"npm-package-json-lint-config-default": "^0.3.0" | ||
} | ||
} | ||
``` | ||
|
||
### *Correct* example(s) | ||
|
||
```json | ||
{ | ||
|
||
} | ||
``` | ||
|
||
## History | ||
|
||
* Introduced in version 4.1.0 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const {exists} = require('../validators/property'); | ||
const LintIssue = require('../LintIssue'); | ||
|
||
const lintId = 'prefer-no-dependencies'; | ||
const nodeName = 'dependencies'; | ||
const message = 'dependencies should not be defined'; | ||
const ruleType = 'standard'; | ||
|
||
const lint = (packageJsonData, severity) => { | ||
if (exists(packageJsonData, nodeName)) { | ||
return new LintIssue(lintId, severity, nodeName, message); | ||
} | ||
|
||
return true; | ||
}; | ||
|
||
module.exports = { | ||
lint, | ||
ruleType | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const {exists} = require('../validators/property'); | ||
const LintIssue = require('../LintIssue'); | ||
|
||
const lintId = 'prefer-no-optionalDependencies'; | ||
const nodeName = 'optionalDependencies'; | ||
const message = 'optionalDependencies should not be defined'; | ||
const ruleType = 'standard'; | ||
|
||
const lint = (packageJsonData, severity) => { | ||
if (exists(packageJsonData, nodeName)) { | ||
return new LintIssue(lintId, severity, nodeName, message); | ||
} | ||
|
||
return true; | ||
}; | ||
|
||
module.exports = { | ||
lint, | ||
ruleType | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const {exists} = require('../validators/property'); | ||
const LintIssue = require('../LintIssue'); | ||
|
||
const lintId = 'prefer-no-peerDependencies'; | ||
const nodeName = 'peerDependencies'; | ||
const message = 'peerDependencies should not be defined'; | ||
const ruleType = 'standard'; | ||
|
||
const lint = (packageJsonData, severity) => { | ||
if (exists(packageJsonData, nodeName)) { | ||
return new LintIssue(lintId, severity, nodeName, message); | ||
} | ||
|
||
return true; | ||
}; | ||
|
||
module.exports = { | ||
lint, | ||
ruleType | ||
}; |
Oops, something went wrong.