Skip to content

Commit 8bd3837

Browse files
committed
Fix Node 4 compatibility
1 parent 005dad3 commit 8bd3837

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1100
-1090
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ node_js:
55
- '11'
66
- '10'
77
- '8'
8+
- '6'
9+
- '4'
810
before_install:
911
- 'nvm install-latest-npm'
1012
before_script:
@@ -26,6 +28,13 @@ matrix:
2628
include:
2729
- node_js: 'lts/*'
2830
env: PRETEST=true
31+
exclude:
32+
- node_js: '4'
33+
env: ESLINT=5
34+
- node_js: '4'
35+
env: ESLINT=next
36+
- node_js: '6'
37+
env: ESLINT=next
2938
allow_failures:
3039
- node_js: '11'
3140
- env: ESLINT=next

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
"resolve": "^1.10.0"
3434
},
3535
"devDependencies": {
36-
"@typescript-eslint/parser": "^1.7.0",
37-
"babel-eslint": "^10.0.1",
36+
"babel-eslint": "^8.2.6",
3837
"coveralls": "^3.0.2",
3938
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0",
4039
"istanbul": "^0.4.5",
41-
"mocha": "^6.1.4",
40+
"mocha": "^5.2.0",
4241
"sinon": "^7.2.2",
43-
"typescript": "^3.2.2"
42+
"typescript": "^3.2.2",
43+
"typescript-eslint-parser": "^20.1.1"
4444
},
4545
"peerDependencies": {
4646
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0"

tests/helpers/parsers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ const NODE_MODULES = '../../node_modules';
66

77
module.exports = {
88
BABEL_ESLINT: path.join(__dirname, NODE_MODULES, 'babel-eslint'),
9-
TYPESCRIPT_ESLINT: path.join(__dirname, NODE_MODULES, '@typescript-eslint/parser')
9+
TYPESCRIPT_ESLINT: path.join(__dirname, NODE_MODULES, 'typescript-eslint-parser')
1010
};

tests/lib/rules/boolean-prop-naming.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
const rule = require('../../../lib/rules/boolean-prop-naming');
1212
const RuleTester = require('eslint').RuleTester;
1313

14-
const {BABEL_ESLINT} = require('../../helpers/parsers');
14+
const parsers = require('../../helpers/parsers');
1515

1616
const parserOptions = {
1717
ecmaVersion: 2018,
@@ -144,7 +144,7 @@ ruleTester.run('boolean-prop-naming', rule, {
144144
options: [{
145145
rule: '^is[A-Z]([A-Za-z0-9]?)+'
146146
}],
147-
parser: BABEL_ESLINT
147+
parser: parsers.BABEL_ESLINT
148148
}, {
149149
// ES6 components with static class properties and Object.spread syntax in PropTypes
150150
code: `
@@ -157,7 +157,7 @@ ruleTester.run('boolean-prop-naming', rule, {
157157
options: [{
158158
rule: '^is[A-Z]([A-Za-z0-9]?)+'
159159
}],
160-
parser: BABEL_ESLINT
160+
parser: parsers.BABEL_ESLINT
161161
}, {
162162
// ES6 components as Component with boolean PropTypes and Object.spread syntax in PropTypes
163163
code: `
@@ -181,7 +181,7 @@ ruleTester.run('boolean-prop-naming', rule, {
181181
options: [{
182182
rule: '^is[A-Z]([A-Za-z0-9]?)+'
183183
}],
184-
parser: BABEL_ESLINT
184+
parser: parsers.BABEL_ESLINT
185185
}, {
186186
// ES6 components with static class properties an non-booleans
187187
code: `
@@ -193,7 +193,7 @@ ruleTester.run('boolean-prop-naming', rule, {
193193
options: [{
194194
rule: '^is[A-Z]([A-Za-z0-9]?)+'
195195
}],
196-
parser: BABEL_ESLINT
196+
parser: parsers.BABEL_ESLINT
197197
}, {
198198
// ES6 components and Flowtype booleans
199199
code: `
@@ -205,7 +205,7 @@ ruleTester.run('boolean-prop-naming', rule, {
205205
options: [{
206206
rule: '^is[A-Z]([A-Za-z0-9]?)+'
207207
}],
208-
parser: BABEL_ESLINT
208+
parser: parsers.BABEL_ESLINT
209209
}, {
210210
// ES6 components and Flowtype non-booleans
211211
code: `
@@ -217,7 +217,7 @@ ruleTester.run('boolean-prop-naming', rule, {
217217
options: [{
218218
rule: '^is[A-Z]([A-Za-z0-9]?)+'
219219
}],
220-
parser: BABEL_ESLINT
220+
parser: parsers.BABEL_ESLINT
221221
}, {
222222
// Stateless components
223223
code: `
@@ -227,7 +227,7 @@ ruleTester.run('boolean-prop-naming', rule, {
227227
options: [{
228228
rule: '^is[A-Z]([A-Za-z0-9]?)+'
229229
}],
230-
parser: BABEL_ESLINT
230+
parser: parsers.BABEL_ESLINT
231231
}, {
232232
// Functional components and Flowtype booleans
233233
code: `
@@ -239,7 +239,7 @@ ruleTester.run('boolean-prop-naming', rule, {
239239
options: [{
240240
rule: '^is[A-Z]([A-Za-z0-9]?)+'
241241
}],
242-
parser: BABEL_ESLINT
242+
parser: parsers.BABEL_ESLINT
243243
}, {
244244
// Custom `propTypeNames` option
245245
code: `
@@ -255,7 +255,7 @@ ruleTester.run('boolean-prop-naming', rule, {
255255
propTypeNames: ['mutuallyExclusiveTrueProps'],
256256
rule: '^is[A-Z]([A-Za-z0-9]?)+'
257257
}],
258-
parser: BABEL_ESLINT
258+
parser: parsers.BABEL_ESLINT
259259
}, {
260260
// Custom PropTypes that are specified as variables
261261
code: `
@@ -271,7 +271,7 @@ ruleTester.run('boolean-prop-naming', rule, {
271271
propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'],
272272
rule: '^is[A-Z]([A-Za-z0-9]?)+'
273273
}],
274-
parser: BABEL_ESLINT
274+
parser: parsers.BABEL_ESLINT
275275
}, {
276276
// Ensure rule doesn't crash on destructured objects [Issue #1369]
277277
code: `
@@ -281,7 +281,7 @@ ruleTester.run('boolean-prop-naming', rule, {
281281
options: [{
282282
rule: '^is[A-Z]([A-Za-z0-9]?)+'
283283
}],
284-
parser: BABEL_ESLINT
284+
parser: parsers.BABEL_ESLINT
285285
}, {
286286
// Ensure rule doesn't crash on on components reference old-style Flow props
287287
code: `
@@ -293,7 +293,7 @@ ruleTester.run('boolean-prop-naming', rule, {
293293
options: [{
294294
rule: '^is[A-Z]([A-Za-z0-9]?)+'
295295
}],
296-
parser: BABEL_ESLINT
296+
parser: parsers.BABEL_ESLINT
297297
}, {
298298
// No propWrapperFunctions setting
299299
code: `
@@ -330,7 +330,7 @@ ruleTester.run('boolean-prop-naming', rule, {
330330
}
331331
}
332332
`,
333-
parser: BABEL_ESLINT
333+
parser: parsers.BABEL_ESLINT
334334
}, {
335335
// Ensure the rule does not throw when a prop isRequired when ES6 without static properties.
336336
code: `
@@ -374,7 +374,7 @@ ruleTester.run('boolean-prop-naming', rule, {
374374
options: [{
375375
rule: '^is[A-Z]([A-Za-z0-9]?)+'
376376
}],
377-
parser: BABEL_ESLINT
377+
parser: parsers.BABEL_ESLINT
378378
}, {
379379
code: `
380380
class Hello extends React.Component {
@@ -503,7 +503,7 @@ ruleTester.run('boolean-prop-naming', rule, {
503503
options: [{
504504
rule: '^is[A-Z]([A-Za-z0-9]?)+'
505505
}],
506-
parser: BABEL_ESLINT,
506+
parser: parsers.BABEL_ESLINT,
507507
errors: [{
508508
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
509509
}]
@@ -534,7 +534,7 @@ ruleTester.run('boolean-prop-naming', rule, {
534534
options: [{
535535
rule: '^is[A-Z]([A-Za-z0-9]?)+'
536536
}],
537-
parser: BABEL_ESLINT,
537+
parser: parsers.BABEL_ESLINT,
538538
errors: [{
539539
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
540540
}]
@@ -549,7 +549,7 @@ ruleTester.run('boolean-prop-naming', rule, {
549549
options: [{
550550
rule: '^is[A-Z]([A-Za-z0-9]?)+'
551551
}],
552-
parser: BABEL_ESLINT,
552+
parser: parsers.BABEL_ESLINT,
553553
errors: [{
554554
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
555555
}]
@@ -561,7 +561,7 @@ ruleTester.run('boolean-prop-naming', rule, {
561561
options: [{
562562
rule: '^is[A-Z]([A-Za-z0-9]?)+'
563563
}],
564-
parser: BABEL_ESLINT,
564+
parser: parsers.BABEL_ESLINT,
565565
errors: [{
566566
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
567567
}]
@@ -575,7 +575,7 @@ ruleTester.run('boolean-prop-naming', rule, {
575575
options: [{
576576
rule: '^is[A-Z]([A-Za-z0-9]?)+'
577577
}],
578-
parser: BABEL_ESLINT,
578+
parser: parsers.BABEL_ESLINT,
579579
errors: [{
580580
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
581581
}]
@@ -591,7 +591,7 @@ ruleTester.run('boolean-prop-naming', rule, {
591591
propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'],
592592
rule: '^is[A-Z]([A-Za-z0-9]?)+'
593593
}],
594-
parser: BABEL_ESLINT,
594+
parser: parsers.BABEL_ESLINT,
595595
errors: [{
596596
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
597597
}]
@@ -609,7 +609,7 @@ ruleTester.run('boolean-prop-naming', rule, {
609609
propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'],
610610
rule: '^is[A-Z]([A-Za-z0-9]?)+'
611611
}],
612-
parser: BABEL_ESLINT,
612+
parser: parsers.BABEL_ESLINT,
613613
errors: [{
614614
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
615615
}, {
@@ -629,7 +629,7 @@ ruleTester.run('boolean-prop-naming', rule, {
629629
propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'],
630630
rule: '^is[A-Z]([A-Za-z0-9]?)+'
631631
}],
632-
parser: BABEL_ESLINT,
632+
parser: parsers.BABEL_ESLINT,
633633
errors: [{
634634
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
635635
}, {
@@ -732,7 +732,7 @@ ruleTester.run('boolean-prop-naming', rule, {
732732
return <div>{props.showScore ? 'yeh' : 'no'}</div>;
733733
}
734734
}`,
735-
parser: BABEL_ESLINT,
735+
parser: parsers.BABEL_ESLINT,
736736
settings: {
737737
propWrapperFunctions: ['forbidExtraProps']
738738
},
@@ -804,7 +804,7 @@ ruleTester.run('boolean-prop-naming', rule, {
804804
options: [{
805805
rule: '^is[A-Z]([A-Za-z0-9]?)+'
806806
}],
807-
parser: BABEL_ESLINT,
807+
parser: parsers.BABEL_ESLINT,
808808
errors: [{
809809
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
810810
}]
@@ -845,7 +845,7 @@ ruleTester.run('boolean-prop-naming', rule, {
845845
options: [{
846846
rule: '^is[A-Z]([A-Za-z0-9]?)+'
847847
}],
848-
parser: BABEL_ESLINT,
848+
parser: parsers.BABEL_ESLINT,
849849
errors: [{
850850
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
851851
}]

0 commit comments

Comments
 (0)