Skip to content

Commit

Permalink
build: added eslint for better checks
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobruni committed Oct 27, 2023
1 parent 912da1d commit ecbd3e0
Show file tree
Hide file tree
Showing 16 changed files with 3,263 additions and 26 deletions.
35 changes: 35 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
globals: {
tsParticles: "readonly",
$: "readonly",
loadFirePreset: "readonly",
loadFireworksPreset: "readonly",
loadPolygonPath: "readonly",
dataLayer: "readonly",
},
extends: ["standard", "eslint:recommended", "plugin:prettier/recommended"],
overrides: [
{
env: {
node: true,
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
},
],
parserOptions: {
ecmaVersion: "latest",
},
plugins: ["html", "prettier", "import", "n", "promise"],
settings: {
"html/html-extensions": [".html", ".we"], // consider .html and .we files as HTML
"html/report-bad-indent": "error",
},
rules: {},
};
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run prettier:ci
- run: npm run build:ci
Empty file added .prettierignore
Empty file.
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 1 addition & 1 deletion dots/js/animate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// JavaScript Document
//tsParticles library - https://github.com/matteobruni/tsparticles
// tsParticles library - https://github.com/matteobruni/tsparticles

tsParticles.load("tsparticles", {
backgroundMask: {
Expand Down
2 changes: 1 addition & 1 deletion imposter/js/404.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//https://codepen.io/matteobruni/pen/rNmMVEx
// https://codepen.io/matteobruni/pen/rNmMVEx
tsParticles.load("tsparticles", {
fullScreen: {
enable: true,
Expand Down
2 changes: 1 addition & 1 deletion jitter/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ goBack.onmouseover = (event) => {
};

function shiftLetters(element, duration = 50, interval = null) {
let letters = "!@#$%|&*?+/";
const letters = "!@#$%|&*?+/";
let iteration = 0;
clearInterval(interval);

Expand Down
18 changes: 9 additions & 9 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
$(document).ready(function () {
var pages = $("#pages");
const pages = $("#pages");

$.get("data/pages.json", function (data) {
$.each(data, function (idx, item) {
var page = $("<div>");
const page = $("<div>");

page.addClass("col-md-4");

var card = $("<div>");
const card = $("<div>");

card.addClass("card mb-4 shadow-sm");

var image = $("<img>");
const image = $("<img>");

image.addClass("bd-placeholder-img card-img-top");
image.attr({
Expand All @@ -25,26 +25,26 @@ $(document).ready(function () {

card.append(image);

var cardBody = $("<div>");
const cardBody = $("<div>");

cardBody.addClass("card-body");

var cardText = $("<div>");
const cardText = $("<div>");

cardText.addClass("card-text");
cardText.text(item.description);

cardBody.append(cardText);

var cardContent = $("<div>");
const cardContent = $("<div>");

cardContent.addClass("d-flex justify-content-between align-items-center");

var btnGroup = $("<div>");
const btnGroup = $("<div>");

btnGroup.addClass("btn-group");

var btn = $("<a>");
const btn = $("<a>");

btn.addClass("btn btn-sm btn-outline-secondary");
btn.text("View");
Expand Down
2 changes: 1 addition & 1 deletion links/js/404.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var particles = {
const particles = {
background: {
color: {
value: "#0d47a1",
Expand Down
Loading

0 comments on commit ecbd3e0

Please sign in to comment.