@isentinel/eslint-config 5.1.2 → 5.2.0

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.
package/dist/index.d.mts CHANGED
@@ -17863,6 +17863,14 @@ type Rules = Record<string, Linter.RuleEntry<any> | undefined> & RuleOptions;
17863
17863
  * many plugins still lack proper type definitions.
17864
17864
  */
17865
17865
  type TypedFlatConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
17866
+ /**
17867
+ * The base directory that `files` and `ignores` patterns in this config
17868
+ * object are resolved against. Defaults to the location ESLint derives the
17869
+ * config from. Added in ESLint 9.30.
17870
+ *
17871
+ * @see [basePath](https://eslint.org/docs/latest/use/configure/configuration-files#specifying-basepath)
17872
+ */
17873
+ basePath?: string;
17866
17874
  /**
17867
17875
  * An object containing a name-value mapping of plugin names to plugin
17868
17876
  * objects. When `files` is specified, these plugins are only available to
package/dist/index.mjs CHANGED
@@ -1578,7 +1578,17 @@ async function jsx() {
1578
1578
  //#region src/configs/package-json.ts
1579
1579
  async function packageJson(options = {}) {
1580
1580
  const { roblox = true, stylistic = true, type = "game" } = options;
1581
- const [jsoncEslintParser, pluginPackageJson] = await Promise.all([interopDefault(import("jsonc-eslint-parser")), interopDefault(import("eslint-plugin-package-json"))]);
1581
+ const [jsoncEslintParser, pluginPackageJson, rootDirectory] = await Promise.all([
1582
+ interopDefault(import("jsonc-eslint-parser")),
1583
+ interopDefault(import("eslint-plugin-package-json")),
1584
+ findWorkspaceRoot()
1585
+ ]);
1586
+ const rootOverride = {
1587
+ name: "isentinel/package-json/root",
1588
+ files: ["package.json"],
1589
+ languageOptions: { parser: jsoncEslintParser },
1590
+ rules: { "package-json/require-packageManager": ["error", { ignorePrivate: false }] }
1591
+ };
1582
1592
  return [
1583
1593
  {
1584
1594
  name: "isentinel/package-json/setup",
@@ -1718,13 +1728,26 @@ async function packageJson(options = {}) {
1718
1728
  }
1719
1729
  },
1720
1730
  {
1721
- name: "isentinel/package-json/root",
1722
- files: ["package.json"],
1723
- languageOptions: { parser: jsoncEslintParser },
1724
- rules: { "package-json/require-packageManager": ["error", { ignorePrivate: false }] }
1731
+ ...rootOverride,
1732
+ basePath: rootDirectory
1725
1733
  }
1726
1734
  ];
1727
1735
  }
1736
+ /**
1737
+ * Resolves the workspace root directory.
1738
+ *
1739
+ * The root is the directory containing `pnpm-workspace.yaml`. When no workspace
1740
+ * file exists anywhere up the tree the project is standalone, so the cwd is its
1741
+ * own root.
1742
+ *
1743
+ * @param cwd - The directory to resolve from, defaulting to the current
1744
+ * working directory.
1745
+ * @returns The absolute path of the workspace root directory.
1746
+ */
1747
+ async function findWorkspaceRoot(cwd = process.cwd()) {
1748
+ const workspaceFile = await findUp("pnpm-workspace.yaml", { cwd });
1749
+ return workspaceFile === void 0 ? cwd : path.dirname(workspaceFile);
1750
+ }
1728
1751
 
1729
1752
  //#endregion
1730
1753
  //#region src/configs/spelling.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isentinel/eslint-config",
3
- "version": "5.1.2",
3
+ "version": "5.2.0",
4
4
  "description": "iSentinel's ESLint config",
5
5
  "keywords": [
6
6
  "eslint-config",
@@ -122,11 +122,11 @@
122
122
  "type-fest": "5.4.4",
123
123
  "typescript": "5.9.3",
124
124
  "unplugin-unused": "0.5.7",
125
- "@isentinel/eslint-config": "5.1.2"
125
+ "@isentinel/eslint-config": "5.2.0"
126
126
  },
127
127
  "peerDependencies": {
128
128
  "@vitest/eslint-plugin": "^1.6.4",
129
- "eslint": "^9.10.0",
129
+ "eslint": "^9.30.0",
130
130
  "eslint-plugin-eslint-plugin": "^7.0.0",
131
131
  "eslint-plugin-jest": "^29.15.0",
132
132
  "eslint-plugin-jest-extended": "^3.0.0",