diff --git a/assets/js/tracking.js b/assets/js/tracking.js index 43d8b93..b27e242 100644 --- a/assets/js/tracking.js +++ b/assets/js/tracking.js @@ -3,6 +3,7 @@ * A JavaScript file for analytic tracking. */ + import * as params from '@params'; const cookiebanner = params.cookieConsent; @@ -12,6 +13,8 @@ const matomoTrackingApiUrl = 'https://' + params.piwikTrackerUrl + '/matomo.php' const googleAnalytics = params.GoogleAnalytics; if (idSite) { + // biome-ignore lint/style/useConst: Google code. + // biome-ignore lint/suspicious/noAssignInExpressions: Google code. let _paq = window._paq = window._paq || []; if (cookiebanner) { diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..384118e --- /dev/null +++ b/biome.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true, + "defaultBranch": "main" + }, + "files": { + "ignoreUnknown": true, + "include": ["assets/**/*.js"], + "ignore": ["**/*.min.js", "assets/libs/**/*.js"] + + }, + "formatter": { + "enabled": true, + "indentStyle": "space" + }, + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "complexity": { + "noForEach": "off", + "useArrowFunction": "off" + }, + "style": { + "useTemplate": "off" + } + } + }, + "javascript": { + "formatter": { + "quoteStyle": "single" + }, + "globals": ["define", "htmx", "jQuery", "Alpine"] + } +} diff --git a/package.json b/package.json index c3d122b..d24005b 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "description": "The node.js requirements to lint this project.", "scripts": { "lint-theme:css": "stylelint \"assets/sass/**/*.scss\"", - "lint-theme:js": "", + "lint-theme:js": "biome check", "lint-project:css": "stylelint \"../../assets/sass/**/*.scss\"", - "lint-project:js": "", + "lint-project:js": "biome check \"../../assets/js/**/*.js\"", "lint-theme": "npm run lint-theme:css && npm run lint-theme:js", "lint-project": "npm run lint-project:css && npm run lint-project:js", "lint:css": "npm run lint-theme:css && npm run lint-project:css",