Skip to content
Snippets Groups Projects
Commit 136d7974 authored by Subliminal Guy's avatar Subliminal Guy
Browse files

Add Gitignore

Add JS Module
Add ESLint config
Add data.js
parent be48a7a2
No related branches found
No related tags found
No related merge requests found
/node_modules
package-lock.json
\ No newline at end of file
import globals from "globals";
import pluginJs from "@eslint/js";
/** @type {import('eslint').Linter.Config[]} */
export default [
{
languageOptions: { globals: globals.browser },
"rules": {
"max-len": ["error", { "code": 80 }],
"indent": ["error", 2]
}
},
pluginJs.configs.recommended,
];
\ No newline at end of file
const data = [
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Q7Z2H@example.com",
}
]
export default data
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>rbb Schulung</title>
</head>
<body>
<button class="main-button" type="button">Click</button>
<script type="text/javascript" src="index.js"></script>
</body>
</html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>rbb Schulung</title>
</head>
<body>
<button class="main-button" type="button">Click</button>
<script type="module" src="index.js"></script>
</body>
</html>
\ No newline at end of file
import data from "./helper/data.js";
const button = document.getElementsByClassName("main-button")[0];
button.addEventListener("click", () => {
console.log("clicked");
console.log(data);
});
......@@ -4,8 +4,16 @@
"description": "A basic vanilla repo for education",
"main": "index.html",
"scripts": {
"test": "npm run dev"
"test": "npm run dev",
"lint": "eslint",
"lint:fix": "npm run lint -- --fix"
},
"author": "subliminalguy",
"license": "ISC"
"license": "ISC",
"devDependencies": {
"@eslint/js": "^9.19.0",
"eslint": "^8.57.1",
"eslint-config-airbnb": "^19.0.4",
"globals": "^15.14.0"
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment