Jelajahi Sumber

Closes #20572: Update all development frontend dependencies (#20909)

Jeremy Stretch 3 bulan lalu
induk
melakukan
20c260b126

+ 0 - 3
netbox/project-static/.eslintignore

@@ -1,3 +0,0 @@
-dist
-node_modules
-.cache

+ 0 - 53
netbox/project-static/.eslintrc

@@ -1,53 +0,0 @@
-{
-  "root": true,
-  "extends": [
-    "eslint:recommended",
-    "plugin:import/typescript",
-    "plugin:@typescript-eslint/eslint-recommended",
-    "plugin:@typescript-eslint/recommended",
-    "plugin:prettier/recommended",
-    "prettier"
-  ],
-  "parser": "@typescript-eslint/parser",
-  "env": {
-    "browser": true,
-    "es6": true,
-    "node": true
-  },
-  "parserOptions": {
-    "ecmaVersion": 2020,
-    "sourceType": "module",
-    "ecmaFeatures": {
-      "arrowFunctions": true
-    }
-  },
-  "plugins": ["@typescript-eslint", "prettier"],
-  "settings": {
-    "import/parsers": {
-      "@typescript-eslint/parser": [".ts", ".tsx"]
-    },
-    "import/resolver": {
-      "typescript": {}
-    }
-  },
-  "rules": {
-    "@typescript-eslint/no-unused-vars": "error",
-    "no-unused-vars": "off",
-    "no-inner-declarations": "off",
-    "comma-dangle": ["error", "always-multiline"],
-    "global-require": "off",
-    "import/no-dynamic-require": "off",
-    "import/prefer-default-export": "off",
-    "@typescript-eslint/no-inferrable-types": "off",
-    "@typescript-eslint/explicit-function-return-type": "off",
-    "@typescript-eslint/no-var-requires": "off",
-    "@typescript-eslint/no-non-null-assertion": "off",
-    "@typescript-eslint/no-namespace": "off",
-    "@typescript-eslint/no-empty-interface": [
-      "error",
-      {
-        "allowSingleExtends": true
-      }
-    ]
-  }
-}

+ 0 - 0
netbox/project-static/bundle.js → netbox/project-static/bundle.cjs


File diff ditekan karena terlalu besar
+ 0 - 0
netbox/project-static/dist/netbox.js


File diff ditekan karena terlalu besar
+ 0 - 0
netbox/project-static/dist/netbox.js.map


+ 86 - 0
netbox/project-static/eslint.config.js

@@ -0,0 +1,86 @@
+import { defineConfig, globalIgnores } from "eslint/config";
+import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
+import typescriptEslint from "@typescript-eslint/eslint-plugin";
+import prettier from "eslint-plugin-prettier";
+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 defineConfig([
+  globalIgnores(['**/dist', '**/node_modules', '**/.cache']),
+  {
+    extends: fixupConfigRules(
+      compat.extends(
+        'eslint:recommended',
+        'plugin:import/typescript',
+        'plugin:@typescript-eslint/eslint-recommended',
+        'plugin:@typescript-eslint/recommended',
+        'plugin:prettier/recommended',
+        'prettier',
+      ),
+    ),
+
+    plugins: {
+      '@typescript-eslint': fixupPluginRules(typescriptEslint),
+      prettier: fixupPluginRules(prettier),
+    },
+
+    languageOptions: {
+      globals: {
+        ...globals.browser,
+        ...globals.node,
+      },
+
+      parser: tsParser,
+      ecmaVersion: 2020,
+      sourceType: 'module',
+
+      parserOptions: {
+        ecmaFeatures: {
+          arrowFunctions: true,
+        },
+      },
+    },
+
+    settings: {
+      'import/parsers': {
+        '@typescript-eslint/parser': ['.ts', '.tsx'],
+      },
+      'import/resolver': {
+        typescript: {},
+      },
+    },
+
+    rules: {
+      '@typescript-eslint/no-unused-vars': 'error',
+      'no-unused-vars': 'off',
+      'no-inner-declarations': 'off',
+      'comma-dangle': ['error', 'always-multiline'],
+      'global-require': 'off',
+      'import/no-dynamic-require': 'off',
+      'import/prefer-default-export': 'off',
+      '@typescript-eslint/no-inferrable-types': 'off',
+      '@typescript-eslint/explicit-function-return-type': 'off',
+      '@typescript-eslint/no-var-requires': 'off',
+      '@typescript-eslint/no-non-null-assertion': 'off',
+      '@typescript-eslint/no-namespace': 'off',
+      '@typescript-eslint/no-empty-interface': [
+        'error',
+        {
+          allowSingleExtends: true,
+        },
+      ],
+    },
+  },
+]);

+ 20 - 15
netbox/project-static/package.json

@@ -1,6 +1,7 @@
 {
   "name": "netbox",
-  "version": "4.4.0",
+  "type": "module",
+  "version": "4.5.0",
   "main": "dist/netbox.js",
   "license": "Apache-2.0",
   "private": true,
@@ -8,14 +9,14 @@
     "netbox-graphiql"
   ],
   "scripts": {
-    "bundle": "node bundle.js",
-    "bundle:styles": "node bundle.js --styles",
-    "bundle:scripts": "node bundle.js --scripts",
+    "bundle": "node bundle.cjs",
+    "bundle:styles": "node bundle.cjs --styles",
+    "bundle:scripts": "node bundle.cjs --scripts",
     "format": "yarn format:scripts && yarn format:styles",
     "format:scripts": "prettier -w src/**/*.ts",
     "format:styles": "prettier -w styles/**/*.scss",
     "validate": "yarn validate:types && yarn validate:lint",
-    "validate:lint": "eslint -c .eslintrc ./src/**/*.ts",
+    "validate:lint": "eslint ./src/**/*.ts",
     "validate:types": "tsc --noEmit",
     "validate:formatting": "yarn validate:formatting:scripts && yarn validate:formatting:styles",
     "validate:formatting:styles": "prettier -c styles/**/*.scss",
@@ -36,20 +37,24 @@
     "typeface-roboto-mono": "1.1.13"
   },
   "devDependencies": {
+    "@eslint/compat": "^2.0.0",
+    "@eslint/eslintrc": "^3.3.3",
+    "@eslint/js": "^9.39.1",
     "@types/bootstrap": "5.2.10",
-    "@types/cookie": "^0.6.0",
-    "@types/node": "^22.3.0",
-    "@typescript-eslint/eslint-plugin": "^8.37.0",
-    "@typescript-eslint/parser": "^8.37.0",
-    "esbuild": "^0.25.11",
+    "@types/cookie": "^1.0.0",
+    "@types/node": "^24.10.1",
+    "@typescript-eslint/eslint-plugin": "^8.48.1",
+    "@typescript-eslint/parser": "^8.48.1",
+    "esbuild": "^0.27.0",
     "esbuild-sass-plugin": "^3.3.1",
-    "eslint": "<9.0",
-    "eslint-config-prettier": "^9.1.0",
-    "eslint-import-resolver-typescript": "^3.6.3",
+    "eslint": "^9.39.1",
+    "eslint-config-prettier": "^10.1.8",
+    "eslint-import-resolver-typescript": "^4.4.4",
     "eslint-plugin-import": "^2.32.0",
     "eslint-plugin-prettier": "^5.5.1",
-    "prettier": "^3.3.3",
-    "typescript": "<5.5"
+    "globals": "^16.5.0",
+    "prettier": "^3.7.3",
+    "typescript": "^5.9.3"
   },
   "resolutions": {
     "@types/bootstrap/**/@popperjs/core": "^2.11.6"

File diff ditekan karena terlalu besar
+ 507 - 343
netbox/project-static/yarn.lock


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini