Skip to content

Commit

Permalink
fix broken eslint config
Browse files Browse the repository at this point in the history
also fixed linting errors
  • Loading branch information
jsebrech committed Sep 18, 2024
1 parent b3d3a96 commit 2b5ab33
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
24 changes: 24 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* eslint-disable no-undef */
const globals = require("globals");
const js = require("@eslint/js");

module.exports = [
js.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.jest
},
ecmaVersion: 2022,
sourceType: "module",
}
},
{
ignores: [
"public/blog/articles/",
"**/lib/",
"**/react/",
]
}
];
2 changes: 1 addition & 1 deletion public/blog/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ customElements.define('blog-generator', class BlogGenerator extends HTMLElement
}

addClickListener() {
this.addEventListener('click', (e) => {
this.addEventListener('click', () => {
if (this.#blogFolder) return;
if (!window.showDirectoryPicker) {
this.showError('Opening folders with a picker is not supported in your browser.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class RouteComponent extends HTMLElement {
}

// for overriding in subclasses to detect parameters
// eslint-disable-next-line no-unused-vars
routeChangedCallback(...matches) {}

#matchesRoute(path, exact) {
Expand All @@ -65,7 +66,7 @@ export class RouteComponent extends HTMLElement {
if (!activeRoutes.length) matches = ['*'];
// normal routes
} else {
const regex = new RegExp(`^#${path.replaceAll('/', '\/')}${exact ? '$' : ''}`, 'gi');
const regex = new RegExp(`^#${path.replaceAll('/', '\\/')}${exact ? '$' : ''}`, 'gi');
const currentPath = window.location.hash || '#/';
matches = regex.exec(currentPath);
}
Expand Down
2 changes: 1 addition & 1 deletion public/styles/reset.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
text-size-adjust: none;
}

*, *:before, *:after {
*, *::before, *::after {
box-sizing: inherit;
}

Expand Down
1 change: 1 addition & 0 deletions public/tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { registerTabPanelComponent } from "../components/tab-panel/tab-panel.js"

const app = () => {
registerTabPanelComponent();
// eslint-disable-next-line no-undef
mocha.run();
}

Expand Down

0 comments on commit 2b5ab33

Please sign in to comment.