From f043dd455d3f50c7dc08201701eb909a04cc1652 Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 13 Nov 2024 16:44:55 -0600 Subject: [PATCH] change eslint config to use new flat config format --- .eslintignore | 7 ------- .eslintrc | 14 -------------- eslint.config.mjs | 45 +++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | Bin 402195 -> 402982 bytes package.json | 3 +++ 5 files changed, 48 insertions(+), 21 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc create mode 100644 eslint.config.mjs diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 15a75b0e..00000000 --- a/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -node_modules -dist -README.md -COPYING -src/webrtc -scripts/ -assets \ No newline at end of file diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 40eac134..00000000 --- a/.eslintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint"], - "root": true, - "rules": { - "no-mixed-spaces-and-tabs": "off", - "@typescript-eslint/no-inferrable-types": "off", // Required by typeorm - "@typescript-eslint/no-var-requires": "off" // Sometimes requred by typeorm to resolve circular deps - }, - "env": { - "node": true - } -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..a4209123 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,45 @@ +import typescriptEslint from "@typescript-eslint/eslint-plugin"; +import globals from "globals"; +import tsParser from "@typescript-eslint/parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [{ + ignores: [ + "**/node_modules", + "**/dist", + "**/README.md", + "**/COPYING", + "src/webrtc", + "**/scripts/", + "**/assets", + ], +}, ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"), { + plugins: { + "@typescript-eslint": typescriptEslint, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: tsParser, + }, + + rules: { + "no-mixed-spaces-and-tabs": "off", + "@typescript-eslint/no-inferrable-types": "off", // Required by typeorm + "@typescript-eslint/no-var-requires": "off", // Sometimes requred by typeorm to resolve circular deps + }, +}]; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9d91c0e6b59f6093c6391fb14a88a9b548b01929..7ea21c4e7637f8ca33573b5c25bd6732e77081ec 100644 GIT binary patch delta 418 zcmbPyOk&v?i4AvHr(aNFVw>(E&8*28XQ^jsqGzC_v-v8k1+#E^PJU8iPO*}ef>NBJ zsh**cp222TPTPf(=iL{Zp6A2FvAJ|rCF^w4Nz7lT&s)nRJvres$Mo;MeICT#rnGXS;e{_<0lISD~1-h<-3-+g*yjSy7=d4JDYi?m1vhcn+N4v zSmu{xWu`l)nU*D&h8KpX7y1PUCIuB0WCfR{q`I2rr}On>tyuiMHo`O>C$ zD9Xfu>X}8h>!~m+=P?8QIhk>m;q;bC%)*SO(+iauRYDE5(|ufva>;ovb zA1wnH0h4g99BIZ8v`+uaGwW~wG5YACIgX|@Y(||lfJ7ZlYprngZZ_G z`LzMJ`LzQ5Z