Skip to content

Commit

Permalink
added eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Apr 1, 2024
1 parent 222dfc2 commit b51aca5
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
package.json
*.json
out
123 changes: 123 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"root": true,
"extends": [
"eslint:recommended"
],
"parserOptions": {
"ecmaVersion": 13,
"sourceType": "module",
"ecmaFeatures": {
"jsx": false
}
},
"env": {
"node": true,
"browser": true
},
"rules": {
"eqeqeq": [
"error",
"smart"
],
"no-extra-boolean-cast": 0,
"quotes": [
"error",
"single"
],
"curly": [
"error",
"all"
],
"no-console": [
"error",
{
"allow": [
"error"
]
}
],
"no-debugger": 1,
"semi": [
"error",
"always",
{
"omitLastInOneLineBlock": true
}
],
"no-trailing-spaces": 1,
"no-else-return": 2,
"no-extra-bind": 0,
"no-implicit-coercion": 0,
"no-useless-call": 0,
"no-return-assign": 0,
"eol-last": 1,
"no-unused-vars": 0,
"no-extra-semi": 0,
"comma-dangle": 2,
"no-underscore-dangle": 0,
"no-lone-blocks": 0,
"array-bracket-spacing": 2,
"object-curly-spacing": 2,
"brace-style": [
2,
"1tbs",
{
"allowSingleLine": true
}
],
"comma-spacing": 2,
"comma-style": 2,
"key-spacing": 2,
"one-var": [
"error",
"never"
],
"semi-style": [
"error",
"last"
],
"space-in-parens": [
"error",
"never"
],
"keyword-spacing": [
2,
{
"before": true,
"after": true
}
],
"space-infix-ops": 1,
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": "*",
"next": "return"
}
],
"indent": [
"error",
2,
{
"SwitchCase": 1
}
],
"prefer-const": [
"warn"
]
},
"globals": {
"Promise": true,
"Proxy": true,
"Set": true,
"Reflect": true,
"$": true,
"gsap": true,
"Power2": true,
"TweenLite": true,
"globalThis": true,
"fuzzysort": true,
"appSettings": "readonly"
}
}
2 changes: 1 addition & 1 deletion src/js/app-esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Stream from '@halo-lab/stream';
import { navigateTo, onRender, onLeave} from 'postdoc/page';
import {navigateTo, onRender, onLeave} from 'postdoc/page';

// File State
const appSidebarState = Object.freeze({
Expand Down
6 changes: 3 additions & 3 deletions src/js/dropdown.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { onRender } from 'postdoc/page';
import {onRender} from 'postdoc/page';

class MenuButtonActions {
constructor(domNode, performMenuAction) {
Expand Down Expand Up @@ -331,10 +331,10 @@ function activateDropdown() {
function performMenuAction(node) {
window.location.href = node.children[0].href;
}

for (var i = 0; i < menuButtons.length; i++) {
new MenuButtonActions(menuButtons[i], performMenuAction);
}
}
}

onRender(() => {
Expand Down
10 changes: 5 additions & 5 deletions src/js/landing.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ function docReady(fn) {
}

function addScript(src, id, module, callback) {
let tag = document.createElement('script');
const tag = document.createElement('script');
if (typeof id !== 'undefined' && id !== null) {
tag.id = id;
}
tag.src = src;
if (module) {
tag.type = "module";
tag.type = 'module';
}
tag.defer = true;

let firstScriptTag = document.getElementsByTagName('script')[0];
const firstScriptTag = document.getElementsByTagName('script')[0];
let parent = document.head;
if (parent && firstScriptTag && parent.contains(firstScriptTag)) {
parent.insertBefore(tag, firstScriptTag);
Expand All @@ -37,9 +37,9 @@ function addScript(src, id, module, callback) {


function addStylesheet(src) {
let link = document.createElement('link');
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = src
link.href = src;
document.head.appendChild(link);
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/generate-api-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,4 +437,4 @@ module.exports.generateApiPages = (apiData, config) => {

globalThis.generated = true;
}
};
};

0 comments on commit b51aca5

Please sign in to comment.