From 18fa976b00a0e094a43e7f897557e097a5ac81fa Mon Sep 17 00:00:00 2001 From: Lennart <115736797+lnart@users.noreply.github.com> Date: Tue, 23 Apr 2024 12:42:59 +0200 Subject: [PATCH] eslint config --- commitlint.config.js | 3 +++ commitlintrc.json | 3 +++ eslint.config.mjs | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 commitlint.config.js create mode 100644 commitlintrc.json create mode 100644 eslint.config.mjs diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..69b4242 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ["@commitlint/config-conventional"], +}; diff --git a/commitlintrc.json b/commitlintrc.json new file mode 100644 index 0000000..c30e5a9 --- /dev/null +++ b/commitlintrc.json @@ -0,0 +1,3 @@ +{ + "extends": ["@commitlint/config-conventional"] +} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..a8106f2 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,21 @@ +import globals from "globals"; +import tseslint from "typescript-eslint"; + +import path from "path"; +import { fileURLToPath } from "url"; +import { FlatCompat } from "@eslint/eslintrc"; +import pluginJs from "@eslint/js"; + +// mimic CommonJS variables -- not needed if using CommonJS +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: pluginJs.configs.recommended, +}); + +export default [ + { languageOptions: { globals: globals.browser } }, + ...compat.extends("standard-with-typescript"), + ...tseslint.configs.recommended, +];