Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
chore: remove unwanted react fragments and added lint rule (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
harish-sethuraman authored Jun 25, 2022
1 parent 1794e7c commit f137d95
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 23 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports = {
}
},
rules: {
"react/jsx-no-useless-fragment": "error",
"react/jsx-no-target-blank": "error",

// Disable rules that the codebase doesn't currently follow.
Expand Down
38 changes: 18 additions & 20 deletions src/playground/components/CodeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,23 @@ import "../scss/editor.scss";

export default function CodeEditor({ codeValue, onUpdate, eslintOptions }) {
return (
<>
<CodeMirror
value={codeValue}
minWidth="100%"
height="100%"
extensions={
[
history(),
bracketMatching(),
linter(esLint(new ESLint(), eslintOptions), { delay: 0 }),
javascript(),
ESLintPlaygroundTheme,
ESLintPlaygroundHighlightStyle
]
}
onChange={value => {
onUpdate(value);
}}
/>
</>
<CodeMirror
value={codeValue}
minWidth="100%"
height="100%"
extensions={
[
history(),
bracketMatching(),
linter(esLint(new ESLint(), eslintOptions), { delay: 0 }),
javascript(),
ESLintPlaygroundTheme,
ESLintPlaygroundHighlightStyle
]
}
onChange={value => {
onUpdate(value);
}}
/>
);
}
4 changes: 1 addition & 3 deletions src/playground/components/CrashAlert.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export default function CrashAlert({ error }) {
);

return (
<React.Fragment>
<Alert type="error" text={AlertMessage} />
</React.Fragment>
<Alert type="error" text={AlertMessage} />
);
}

0 comments on commit f137d95

Please sign in to comment.