Skip to content

Commit a5ad499

Browse files
committed
chore: restore Node versions; fixes gajus#801
Also: 1. Adds `engine-strict` flag to identify problematic dev. projects for testing on older Node. 2. Adds legacy-peer-deps for older combos of overwriting no-saves 3. Sets `eslint-plugin-mocha` to older version (not supporting Node 12) 4. Changes tests slightly to adjust for different `eslint-config-canonical` behavior
1 parent 1b3212f commit a5ad499

File tree

3 files changed

+36
-38
lines changed

3 files changed

+36
-38
lines changed

.travis.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,38 @@ os: linux
22
dist: xenial
33
language: node_js
44
node_js:
5+
- "12.22.0"
6+
- "14.17.0"
57
- "16"
6-
# - "14.14.0"
7-
# - "12.20.0"
88
install:
9-
- echo "Avoid Travis's npm auto-install"
9+
- npm install --legacy-peer-deps
1010
before_script: >
11+
12+
node_version=$(node -v);
13+
1114
if [ ${ESLINT} = "7" ]; then
12-
npm install --no-save "eslint@${ESLINT}" [email protected]
15+
if [ ${node_version:1:2} = "16" ]; then
16+
npm install --legacy-peer-deps --engine-strict --no-save "eslint@${ESLINT}" [email protected] eslint-plugin-mocha@9
17+
else
18+
npm install --legacy-peer-deps --no-save "eslint@${ESLINT}" [email protected] eslint-plugin-mocha@9
19+
fi
1320
else
14-
npm install --no-save "eslint@${ESLINT}"
15-
npm run lint
21+
if [ ${node_version:1:2} = "16" ]; then
22+
npm install --engine-strict --no-save "eslint@${ESLINT}"
23+
npm run lint
24+
else
25+
npm install --legacy-peer-deps --no-save "eslint@${ESLINT}" [email protected] eslint-plugin-mocha@9
26+
fi
1627
fi
1728
1829
notifications:
1930
email: false
2031
script:
2132
- npm run test
22-
- npm run build
2333
env:
2434
jobs:
25-
- ESLINT=8
2635
- ESLINT=7
36+
- ESLINT=8
2737
after_success:
2838
- export NODE_ENV=production
2939
- npm run build

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,33 +1259,33 @@ function quux () {}
12591259
// Message: @example error (semi): Missing semicolon.
12601260

12611261
/**
1262-
* @example const i = 5;
1263-
* quux2()
1262+
* @example const j = 5;
1263+
* quux2();
12641264
*/
12651265
function quux2 () {
12661266

12671267
}
12681268
// "jsdoc/check-examples": ["error"|"warn", {"matchingFileName":"../../jsdocUtils.js"}]
1269-
// Message: @example warning (id-length): Identifier name 'i' is too short (< 2).
1269+
// Message: @example warning (id-length): Identifier name 'j' is too short (< 2).
12701270

12711271
/**
1272-
* @example const i = 5;
1273-
* quux2()
1272+
* @example const k = 5;
1273+
* quux2();
12741274
*/
12751275
function quux2 () {
12761276

12771277
}
12781278
// "jsdoc/check-examples": ["error"|"warn", {"configFile":".eslintrc.json","matchingFileName":"../../jsdocUtils.js"}]
1279-
// Message: @example warning (id-length): Identifier name 'i' is too short (< 2).
1279+
// Message: @example warning (id-length): Identifier name 'k' is too short (< 2).
12801280

12811281
/**
1282-
* @example const i = 5;
1283-
* quux2()
1282+
* @example const m = 5;
1283+
* quux2();
12841284
*/
12851285
function quux2 () {
12861286

12871287
}
1288-
// Message: @example warning (id-length): Identifier name 'i' is too short (< 2).
1288+
// Message: @example warning (id-length): Identifier name 'm' is too short (< 2).
12891289

12901290
/**
12911291
* @example const i = 5;

test/rules/assertions/checkExamples.js

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,8 @@ export default {
364364
{
365365
code: `
366366
/**
367-
* @example const i = 5;
368-
* quux2()
367+
* @example const j = 5;
368+
* quux2();
369369
*/
370370
function quux2 () {
371371
@@ -374,11 +374,7 @@ export default {
374374
errors: [
375375
{
376376
line: 3,
377-
message: '@example warning (id-length): Identifier name \'i\' is too short (< 2).',
378-
},
379-
{
380-
line: 4,
381-
message: '@example error (semi): Missing semicolon.',
377+
message: '@example warning (id-length): Identifier name \'j\' is too short (< 2).',
382378
},
383379
],
384380
options: [
@@ -390,8 +386,8 @@ export default {
390386
{
391387
code: `
392388
/**
393-
* @example const i = 5;
394-
* quux2()
389+
* @example const k = 5;
390+
* quux2();
395391
*/
396392
function quux2 () {
397393
@@ -400,11 +396,7 @@ export default {
400396
errors: [
401397
{
402398
line: 3,
403-
message: '@example warning (id-length): Identifier name \'i\' is too short (< 2).',
404-
},
405-
{
406-
line: 4,
407-
message: '@example error (semi): Missing semicolon.',
399+
message: '@example warning (id-length): Identifier name \'k\' is too short (< 2).',
408400
},
409401
],
410402
options: [
@@ -417,8 +409,8 @@ export default {
417409
{
418410
code: `
419411
/**
420-
* @example const i = 5;
421-
* quux2()
412+
* @example const m = 5;
413+
* quux2();
422414
*/
423415
function quux2 () {
424416
@@ -427,11 +419,7 @@ export default {
427419
errors: [
428420
{
429421
line: 3,
430-
message: '@example warning (id-length): Identifier name \'i\' is too short (< 2).',
431-
},
432-
{
433-
line: 4,
434-
message: '@example error (semi): Missing semicolon.',
422+
message: '@example warning (id-length): Identifier name \'m\' is too short (< 2).',
435423
},
436424
],
437425
filename: 'test/rules/data/jsdocUtils.js',

0 commit comments

Comments
 (0)