Skip to content

Commit 3ea4070

Browse files
authored
Drop support for node 4 and 5. Require npm-package-json-lint 3.x.x (#5)
* Drop support for node 4 and 5. Require npm-package-json-lint 3.x.x * Bump to 3.0.0 * Update cli command * Update tests to use new v3 api * Pass only rules * typo 👎 * check error count * issues.length
1 parent 277a751 commit 3ea4070

File tree

7 files changed

+28
-27
lines changed

7 files changed

+28
-27
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ sudo: false
1010
language: node_js
1111

1212
node_js:
13-
- "4"
14-
- "5"
1513
- "6"
1614
- "7"
1715
- "8"
1816
- "9"
17+
- "10"
1918

2019
cache:
2120
directories:

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1212
### Removed
1313

1414

15+
## [2.0.0] - 2018-05-09
16+
### Changed
17+
- Bump dependencies and require npm-package-json-lint 3.x.x
18+
19+
### Removed
20+
- Dropped support for Node 4 and 5.
21+
1522
## [1.1.0] - 2017-08-02
1623
### Changed
1724
- Bump dependencies

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
### Node
66

7-
* [Node.js](https://nodejs.org/) - v4.2.0+
8-
* [npm](https://www.npmjs.com/) - v2.14.7+
7+
* [Node.js](https://nodejs.org/) - v6.0.0+
8+
* [npm](https://www.npmjs.com/) - v3.0.0+
99

1010
## Install project dependencies
1111

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ First thing first, let's make sure you have the necessary pre-requisites.
2222

2323
#### Node
2424

25-
* [Node.js](https://nodejs.org/) - v4.2.0+
26-
* [npm](http://npmjs.com) - v2.14.7+
25+
* [Node.js](https://nodejs.org/) - v6.0.0+
26+
* [npm](http://npmjs.com) - v3.0.0+
2727

2828
### Command
2929

package.json

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "npm-package-json-lint-config-tc",
3-
"version": "1.1.0",
3+
"version": "2.0.0",
44
"description": "npm-package-json-lint shareable config for TC's projects",
55
"keywords": [
66
"lint",
@@ -24,28 +24,26 @@
2424
"main": "index.js",
2525
"scripts": {
2626
"eslint": "eslint *.js --format=node_modules/eslint-formatter-pretty",
27-
"jsonlint": "jsonlint *.json",
28-
"lint": "npm run npmpackagejsonlint && npm run eslint && npm run jsonlint",
29-
"npmpackagejsonlint": "pjl-cli -c .npmpackagejsonlintrc.json",
27+
"lint": "npm run npmpackagejsonlint && npm run eslint",
28+
"npmpackagejsonlint": "npmPkgJsonLint .",
3029
"test": "mocha"
3130
},
3231
"devDependencies": {
3332
"chai": "^4.1.2",
34-
"eslint": "^4.10.0",
35-
"eslint-config-tc": "^2.2.0",
33+
"eslint": "^4.19.1",
34+
"eslint-config-tc": "^2.4.0",
3635
"eslint-formatter-pretty": "^1.3.0",
3736
"is-plain-obj": "^1.1.0",
38-
"jsonlint": "^1.6.2",
39-
"mocha": "^4.0.1",
40-
"npm-package-json-lint": "^2.11.0",
41-
"temp-write": "^3.3.0"
37+
"mocha": "^5.1.1",
38+
"npm-package-json-lint": "^3.0.0",
39+
"temp-write": "^3.4.0"
4240
},
4341
"peerDependencies": {
44-
"npm-package-json-lint": ">= 2"
42+
"npm-package-json-lint": ">= 3"
4543
},
4644
"engines": {
47-
"node": ">=4.2.0",
48-
"npm": ">=2.14.7"
45+
"node": ">=6.0.0",
46+
"npm": ">=3.0.0"
4947
},
5048
"license": "MIT"
5149
}

test/helper/testHelper.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
'use strict';
22

3-
const NpmPackageJsonLint = require('npm-package-json-lint');
3+
const NpmPackageJsonLint = require('npm-package-json-lint').NpmPackageJsonLint;
44

55
module.exports = function lint(packageJsonData, config) {
6-
const options = {
7-
ignoreWarnings: true
8-
};
9-
const npmPackageJsonLint = new NpmPackageJsonLint(packageJsonData, config, options);
6+
const npmPackageJsonLint = new NpmPackageJsonLint();
107

11-
return npmPackageJsonLint.lint();
8+
return npmPackageJsonLint.lint(packageJsonData, config);
129
};

test/tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ describe('npm-package-json-lint config tests', () => {
2525
const packageJsonData = {
2626
author: 'Caitlin Snow'
2727
};
28-
const results = lint(packageJsonData, config);
28+
const results = lint(packageJsonData, config.rules);
2929
const expectedErrorCount = 14;
3030

31-
results.errors.length.should.equal(expectedErrorCount);
31+
results.issues.length.should.equal(expectedErrorCount);
3232
results.hasOwnProperty('warnings').should.be.false;
3333
});
3434
});

0 commit comments

Comments
 (0)