Skip to content

Commit

Permalink
Fix Node 4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed May 1, 2019
1 parent 005dad3 commit 8bd3837
Show file tree
Hide file tree
Showing 53 changed files with 1,100 additions and 1,090 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ node_js:
- '11'
- '10'
- '8'
- '6'
- '4'
before_install:
- 'nvm install-latest-npm'
before_script:
Expand All @@ -26,6 +28,13 @@ matrix:
include:
- node_js: 'lts/*'
env: PRETEST=true
exclude:
- node_js: '4'
env: ESLINT=5
- node_js: '4'
env: ESLINT=next
- node_js: '6'
env: ESLINT=next
allow_failures:
- node_js: '11'
- env: ESLINT=next
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
"resolve": "^1.10.0"
},
"devDependencies": {
"@typescript-eslint/parser": "^1.7.0",
"babel-eslint": "^10.0.1",
"babel-eslint": "^8.2.6",
"coveralls": "^3.0.2",
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0",
"istanbul": "^0.4.5",
"mocha": "^6.1.4",
"mocha": "^5.2.0",
"sinon": "^7.2.2",
"typescript": "^3.2.2"
"typescript": "^3.2.2",
"typescript-eslint-parser": "^20.1.1"
},
"peerDependencies": {
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ const NODE_MODULES = '../../node_modules';

module.exports = {
BABEL_ESLINT: path.join(__dirname, NODE_MODULES, 'babel-eslint'),
TYPESCRIPT_ESLINT: path.join(__dirname, NODE_MODULES, '@typescript-eslint/parser')
TYPESCRIPT_ESLINT: path.join(__dirname, NODE_MODULES, 'typescript-eslint-parser')
};
52 changes: 26 additions & 26 deletions tests/lib/rules/boolean-prop-naming.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const rule = require('../../../lib/rules/boolean-prop-naming');
const RuleTester = require('eslint').RuleTester;

const {BABEL_ESLINT} = require('../../helpers/parsers');
const parsers = require('../../helpers/parsers');

const parserOptions = {
ecmaVersion: 2018,
Expand Down Expand Up @@ -144,7 +144,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
// ES6 components with static class properties and Object.spread syntax in PropTypes
code: `
Expand All @@ -157,7 +157,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
// ES6 components as Component with boolean PropTypes and Object.spread syntax in PropTypes
code: `
Expand All @@ -181,7 +181,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
// ES6 components with static class properties an non-booleans
code: `
Expand All @@ -193,7 +193,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
// ES6 components and Flowtype booleans
code: `
Expand All @@ -205,7 +205,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
// ES6 components and Flowtype non-booleans
code: `
Expand All @@ -217,7 +217,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
// Stateless components
code: `
Expand All @@ -227,7 +227,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
// Functional components and Flowtype booleans
code: `
Expand All @@ -239,7 +239,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
// Custom `propTypeNames` option
code: `
Expand All @@ -255,7 +255,7 @@ ruleTester.run('boolean-prop-naming', rule, {
propTypeNames: ['mutuallyExclusiveTrueProps'],
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
// Custom PropTypes that are specified as variables
code: `
Expand All @@ -271,7 +271,7 @@ ruleTester.run('boolean-prop-naming', rule, {
propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'],
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
// Ensure rule doesn't crash on destructured objects [Issue #1369]
code: `
Expand All @@ -281,7 +281,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
// Ensure rule doesn't crash on on components reference old-style Flow props
code: `
Expand All @@ -293,7 +293,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
// No propWrapperFunctions setting
code: `
Expand Down Expand Up @@ -330,7 +330,7 @@ ruleTester.run('boolean-prop-naming', rule, {
}
}
`,
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
// Ensure the rule does not throw when a prop isRequired when ES6 without static properties.
code: `
Expand Down Expand Up @@ -374,7 +374,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT
parser: parsers.BABEL_ESLINT
}, {
code: `
class Hello extends React.Component {
Expand Down Expand Up @@ -503,7 +503,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT,
parser: parsers.BABEL_ESLINT,
errors: [{
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
}]
Expand Down Expand Up @@ -534,7 +534,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT,
parser: parsers.BABEL_ESLINT,
errors: [{
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
}]
Expand All @@ -549,7 +549,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT,
parser: parsers.BABEL_ESLINT,
errors: [{
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
}]
Expand All @@ -561,7 +561,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT,
parser: parsers.BABEL_ESLINT,
errors: [{
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
}]
Expand All @@ -575,7 +575,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT,
parser: parsers.BABEL_ESLINT,
errors: [{
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
}]
Expand All @@ -591,7 +591,7 @@ ruleTester.run('boolean-prop-naming', rule, {
propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'],
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT,
parser: parsers.BABEL_ESLINT,
errors: [{
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
}]
Expand All @@ -609,7 +609,7 @@ ruleTester.run('boolean-prop-naming', rule, {
propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'],
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT,
parser: parsers.BABEL_ESLINT,
errors: [{
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
}, {
Expand All @@ -629,7 +629,7 @@ ruleTester.run('boolean-prop-naming', rule, {
propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'],
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT,
parser: parsers.BABEL_ESLINT,
errors: [{
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
}, {
Expand Down Expand Up @@ -732,7 +732,7 @@ ruleTester.run('boolean-prop-naming', rule, {
return <div>{props.showScore ? 'yeh' : 'no'}</div>;
}
}`,
parser: BABEL_ESLINT,
parser: parsers.BABEL_ESLINT,
settings: {
propWrapperFunctions: ['forbidExtraProps']
},
Expand Down Expand Up @@ -804,7 +804,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT,
parser: parsers.BABEL_ESLINT,
errors: [{
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
}]
Expand Down Expand Up @@ -845,7 +845,7 @@ ruleTester.run('boolean-prop-naming', rule, {
options: [{
rule: '^is[A-Z]([A-Za-z0-9]?)+'
}],
parser: BABEL_ESLINT,
parser: parsers.BABEL_ESLINT,
errors: [{
message: 'Prop name (something) doesn\'t match rule (^is[A-Z]([A-Za-z0-9]?)+)'
}]
Expand Down
Loading

0 comments on commit 8bd3837

Please sign in to comment.