@nekoyasuii/config 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,37 +1,27 @@
1
1
  // tools/oxlint/config/js-plugins/index.ts
2
2
  import { existsSync } from "node:fs";
3
- import { fileURLToPath } from "node:url";
3
+ import path from "node:path";
4
4
  import { defineConfig } from "oxlint";
5
- var lazueePluginCandidates = [
6
- new URL("../rules/index.js", import.meta.url),
7
- new URL("tools/oxlint/rules/index.js", import.meta.url)
8
- ];
9
- var lazueePluginSpecifier = fileURLToPath(lazueePluginCandidates.find((candidate) => existsSync(candidate)) ?? lazueePluginCandidates[0]);
10
- var antiSlopPluginCandidates = [
11
- new URL("../config/vendors/anti-slop.js", import.meta.url),
12
- new URL("tools/oxlint/config/vendors/anti-slop.js", import.meta.url)
13
- ];
14
- var antiSlopPluginSpecifier = fileURLToPath(antiSlopPluginCandidates.find((candidate) => existsSync(candidate)) ?? antiSlopPluginCandidates[0]);
15
- var noCommentSlopPluginCandidates = [
16
- new URL("../config/vendors/no-comment-slop.js", import.meta.url),
17
- new URL("tools/oxlint/config/vendors/no-comment-slop.js", import.meta.url)
18
- ];
19
- var noCommentSlopPluginSpecifier = fileURLToPath(noCommentSlopPluginCandidates.find((candidate) => existsSync(candidate)) ?? noCommentSlopPluginCandidates[0]);
20
- var shadcnLintPluginCandidates = [
21
- new URL("../config/vendors/shadcn.js", import.meta.url),
22
- new URL("tools/oxlint/config/vendors/shadcn.js", import.meta.url)
23
- ];
24
- var shadcnLintPluginSpecifier = fileURLToPath(shadcnLintPluginCandidates.find((candidate) => existsSync(candidate)) ?? shadcnLintPluginCandidates[0]);
5
+ var packageRoot = (() => {
6
+ let dir = import.meta.dirname;
7
+ while (!existsSync(path.join(dir, "tools", "oxlint")) && dir !== path.dirname(dir))
8
+ dir = path.dirname(dir);
9
+ return dir;
10
+ })();
11
+ var localPlugin = (relative) => path.join(packageRoot, relative);
25
12
  var reactDoctorRules = await import("oxlint-plugin-react-doctor").then(({ ALL_REACT_DOCTOR_RULES }) => ALL_REACT_DOCTOR_RULES).catch(() => null);
26
13
  var jsPluginEntries = [
27
14
  { name: "github", specifier: "eslint-plugin-github" },
28
15
  { name: "sonarjs", specifier: "eslint-plugin-sonarjs" },
29
16
  { name: "react-doctor", specifier: "oxlint-plugin-react-doctor" },
30
17
  { name: "tailwindcss", specifier: "oxlint-tailwindcss" },
31
- { name: "anti-slop", specifier: antiSlopPluginSpecifier },
32
- { name: "no-comment-slop", specifier: noCommentSlopPluginSpecifier },
33
- { name: "shadcn", specifier: shadcnLintPluginSpecifier },
34
- { name: "lazuee", specifier: lazueePluginSpecifier }
18
+ { name: "anti-slop", specifier: localPlugin("tools/oxlint/config/vendors/anti-slop.js") },
19
+ {
20
+ name: "no-comment-slop",
21
+ specifier: localPlugin("tools/oxlint/config/vendors/no-comment-slop.js")
22
+ },
23
+ { name: "shadcn", specifier: localPlugin("tools/oxlint/config/vendors/shadcn.js") },
24
+ { name: "lazuee", specifier: localPlugin("tools/oxlint/rules/index.js") }
35
25
  ];
36
26
  var jsPluginSettings2 = {
37
27
  "react-doctor": {
@@ -4,7 +4,7 @@ import {
4
4
  } from "../../../chunk-k5zpegn9.js";
5
5
  import {
6
6
  selectJsPlugins2
7
- } from "../../../chunk-5vqtdgjy.js";
7
+ } from "../../../chunk-5cy3qjw4.js";
8
8
  import {
9
9
  reactConfig2
10
10
  } from "../../../chunk-cpyyjvfv.js";
@@ -2,7 +2,7 @@ import {
2
2
  jsPluginSettings2,
3
3
  selectJsPlugins2,
4
4
  js_plugins_default
5
- } from "../../../../chunk-5vqtdgjy.js";
5
+ } from "../../../../chunk-5cy3qjw4.js";
6
6
  export {
7
7
  js_plugins_default as default,
8
8
  jsPluginSettings2 as jsPluginSettings,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nekoyasuii/config",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Shared TypeScript, Oxlint, and Oxfmt configs for my projects.",
5
5
  "files": [
6
6
  "dist",