Skip to content

Commit

Permalink
ESLint (#17)
Browse files Browse the repository at this point in the history
* Add ESLINT

* Fix ESLINT issues

* Fix Missing "key" prop for element in iterator

* Disable checking react-hooks/rules-of-hooks

* Hopefully solve lockfile problems

* Revert "Hopefully solve lockfile problems"

This reverts commit dbb59a1.

* Hopefully fix the lockfile (again)
  • Loading branch information
filiptronicek authored Jun 28, 2021
1 parent 41b6658 commit d4cef2d
Show file tree
Hide file tree
Showing 5 changed files with 1,004 additions and 28 deletions.
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "next",
"rules": {
"react-hooks/rules-of-hooks": 0
}
}
12 changes: 6 additions & 6 deletions components/form-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function downloadObjectAsJson(exportObj, exportName) {
const downloadAnchorNode = document.createElement("a");
downloadAnchorNode.setAttribute("href", dataStr);
downloadAnchorNode.setAttribute("download", exportName + ".json");
document.body.appendChild(downloadAnchorNode); // required for Firefox
document.body.appendChild(downloadAnchorNode); // required htmlFor Firefox
downloadAnchorNode.click();
downloadAnchorNode.remove();
}
Expand All @@ -74,18 +74,18 @@ const generateSlug = (name, artist) => {
}
};

export default function FormLayout() {
export default function htmlFormLayout() {
const [songName, setSongName] = useState("");
const [artistName, setArtistName] = useState("");

return (
<div>
<Header />
<h2 className="text-3xl mb-3 leading-snug">Základní informace</h2>
<h2 className="text-3xl mb-3 leading-snug">Základní inhtmlFormace</h2>
<div className="mb-4">
<label>Název písně</label>
<input
for="grid-first-name"
htmlFor="grid-first-name"
type="text"
id="fname"
value={songName}
Expand All @@ -96,7 +96,7 @@ export default function FormLayout() {
<div className="mb-4">
<label>Autor, skladatel, skupina</label>
<input
for="grid-first-name"
htmlFor="grid-first-name"
type="text"
id="fauthor"
value={artistName}
Expand All @@ -116,7 +116,7 @@ export default function FormLayout() {
<div className="mb-4">
<label>Poznámka</label>
<input
for="grid-first-name"
htmlFor="grid-first-name"
type="text"
id="fnote"
className="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
Expand Down
11 changes: 6 additions & 5 deletions components/more-stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function MoreStories({ posts, author = null }) {

)}
<div className="flex flex-col justify-center items-center">
<ul className="">
<div>
{posts.map((post) => {
let doCapital = true;
if (posts.indexOf(post) > 0) {
Expand All @@ -58,11 +58,12 @@ export default function MoreStories({ posts, author = null }) {
}

return (
<div className={doCapital ? "mt-4" : ""}>
{doCapital && <span className="text-4xl">{post.name[0]}</span>}
<div className={doCapital && "mt-4"} key={post.slug}>
{doCapital && (
<span className="text-4xl">{post.name[0]}</span>
)}

<PostPreview
key={post.slug}
name={post.name}
author={post.author}
slug={post.slug}
Expand All @@ -71,7 +72,7 @@ export default function MoreStories({ posts, author = null }) {
</div>
);
})}
</ul>
</div>
</div>
</section>
);
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
},
"devDependencies": {
"autoprefixer": "^10.2.1",
"eslint": "^7.29.0",
"eslint-config-next": "^11.0.1",
"postcss": "^8.2.4",
"tailwindcss": "^2.0.2"
},
Expand Down
Loading

0 comments on commit d4cef2d

Please sign in to comment.