Skip to content

Commit

Permalink
chore: prepare 2.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed May 10, 2018
1 parent 0e73e2d commit 19b8f86
Show file tree
Hide file tree
Showing 7 changed files with 1,586 additions and 1,942 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ cache:
matrix:
fast_finish: true
include:
- node_js: '9'
- node_js: '10'
script: npm run $JOB_PART
env: JOB_PART=pretest
- node_js: '9'
- node_js: '10'
script: npm run $JOB_PART
env: JOB_PART=test-only
- node_js: '8'
Expand All @@ -34,7 +34,7 @@ matrix:
sudo: required

before_install:
- 'if [[ `npm -v` != 5* ]]; then npm i -g npm@^5.0.0; fi'
- npm i -g npm@latest
- nvm --version
- node --version
- npm --version
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org).

## 2.0.0 - 2018-05-10

* Chore: minimum require `npm-package-json-lint-config-default` is now `^2.0.0`.

## 1.0.0 - 2018-03-31

* Chore: initial public release.
18 changes: 4 additions & 14 deletions __tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
const NpmPackageJsonLint = require("npm-package-json-lint");
const { NpmPackageJsonLint } = require("npm-package-json-lint");
const test = require("ava");
const isPlainObj = require("is-plain-obj");
const config = require("./..");

function lint(packageJsonData, packageConfig) {
const options = {
ignoreWarnings: true
};
const npmPackageJsonLint = new NpmPackageJsonLint(
packageJsonData,
packageConfig,
options
);

return npmPackageJsonLint.lint();
return new NpmPackageJsonLint().lint(packageJsonData, packageConfig);
}

test("npm-package-json-lint config should be an object", t => {
Expand All @@ -28,8 +19,7 @@ test("npm-package-json-lint should run without failing", t => {
const packageJsonData = {
author: "Caitlin Snow"
};
const results = lint(packageJsonData, config);
const results = lint(packageJsonData, config.rules);

t.true(results.errors.length === 11);
t.true(typeof results.warnings === "undefined");
t.true(results.issues.length === 9);
});
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const defaultConfig = {
"valid-values-author": "off",
"valid-values-private": "off",
"valid-values-license": "off",
"valid-values-publishConfig": "off",

"no-restricted-dependencies": "off",
"no-restricted-pre-release-dependencies": "off",
Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ module.exports = {
"remark -f -q",
"git add"
],
"package.json": ["pjl-cli -q", "git add"]
"package.json": ["npmPkgJsonLint -q", "git add"]
};
Loading

0 comments on commit 19b8f86

Please sign in to comment.