Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsx-fragments: improve message text #2032

Merged
merged 2 commits into from Dec 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -39,7 +39,7 @@
"istanbul": "^0.4.5",
"mocha": "^5.2.0",
"typescript": "^3.1.3",
"typescript-eslint-parser": "^20.0.0"
"typescript-eslint-parser": "^20.1.1"
},
"peerDependencies": {
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0"
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