Skip to content

Commit

Permalink
jsx-fragments: improve message text
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzherdev committed Oct 31, 2018
1 parent 3008e85 commit d6f7e1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/rules/jsx-fragments.js
Expand Up @@ -47,7 +47,8 @@ module.exports = {
if (!versionUtil.testReactVersion(context, '16.2.0')) {
context.report({
node,
message: 'Fragments are only supported starting from React v16.2'
message: 'Fragments are only supported starting from React v16.2. '
+ 'Please disable the `react/jsx-fragments` rule in ESLint settings or upgrade your version of React.'
});
return true;
}
Expand Down
6 changes: 4 additions & 2 deletions tests/lib/rules/jsx-fragments.js
Expand Up @@ -88,13 +88,15 @@ ruleTester.run('jsx-fragments', rule, {
parser: 'babel-eslint',
settings: settingsOld,
errors: [{
message: 'Fragments are only supported starting from React v16.2'
message: 'Fragments are only supported starting from React v16.2. '
+ 'Please disable the `react/jsx-fragments` rule in ESLint settings or upgrade your version of React.'
}]
}, {
code: '<Act.Frag><Foo /></Act.Frag>',
settings: settingsOld,
errors: [{
message: 'Fragments are only supported starting from React v16.2'
message: 'Fragments are only supported starting from React v16.2. '
+ 'Please disable the `react/jsx-fragments` rule in ESLint settings or upgrade your version of React.'
}]
}, {
code: '<><Foo /></>',
Expand Down

0 comments on commit d6f7e1e

Please sign in to comment.