@isentinel/eslint-config 5.1.3 → 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 +8 -0
- package/dist/index.mjs +19 -22
- package/package.json +3 -3
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,11 +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,
|
|
1581
|
+
const [jsoncEslintParser, pluginPackageJson, rootDirectory] = await Promise.all([
|
|
1582
1582
|
interopDefault(import("jsonc-eslint-parser")),
|
|
1583
1583
|
interopDefault(import("eslint-plugin-package-json")),
|
|
1584
|
-
|
|
1584
|
+
findWorkspaceRoot()
|
|
1585
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
|
+
};
|
|
1586
1592
|
return [
|
|
1587
1593
|
{
|
|
1588
1594
|
name: "isentinel/package-json/setup",
|
|
@@ -1721,35 +1727,26 @@ async function packageJson(options = {}) {
|
|
|
1721
1727
|
} : {}
|
|
1722
1728
|
}
|
|
1723
1729
|
},
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
rules: { "package-json/require-packageManager": ["error", { ignorePrivate: false }] }
|
|
1729
|
-
}] : []
|
|
1730
|
+
{
|
|
1731
|
+
...rootOverride,
|
|
1732
|
+
basePath: rootDirectory
|
|
1733
|
+
}
|
|
1730
1734
|
];
|
|
1731
1735
|
}
|
|
1732
1736
|
/**
|
|
1733
|
-
*
|
|
1734
|
-
*
|
|
1735
|
-
* ESLint `files` globs are resolved relative to the cwd, so `["package.json"]`
|
|
1736
|
-
* matches the cwd's own `package.json` regardless of where it sits in a
|
|
1737
|
-
* monorepo. When packages are linted in parallel (each with its own cwd),
|
|
1738
|
-
* every package would otherwise look like the root. Detect the real root via
|
|
1739
|
-
* `pnpm-workspace.yaml`:
|
|
1737
|
+
* Resolves the workspace root directory.
|
|
1740
1738
|
*
|
|
1741
|
-
*
|
|
1742
|
-
*
|
|
1743
|
-
*
|
|
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.
|
|
1744
1742
|
*
|
|
1745
1743
|
* @param cwd - The directory to resolve from, defaulting to the current
|
|
1746
1744
|
* working directory.
|
|
1747
|
-
* @returns
|
|
1745
|
+
* @returns The absolute path of the workspace root directory.
|
|
1748
1746
|
*/
|
|
1749
|
-
async function
|
|
1747
|
+
async function findWorkspaceRoot(cwd = process.cwd()) {
|
|
1750
1748
|
const workspaceFile = await findUp("pnpm-workspace.yaml", { cwd });
|
|
1751
|
-
|
|
1752
|
-
return path.relative(path.dirname(workspaceFile), cwd) === "";
|
|
1749
|
+
return workspaceFile === void 0 ? cwd : path.dirname(workspaceFile);
|
|
1753
1750
|
}
|
|
1754
1751
|
|
|
1755
1752
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isentinel/eslint-config",
|
|
3
|
-
"version": "5.
|
|
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.
|
|
125
|
+
"@isentinel/eslint-config": "5.2.0"
|
|
126
126
|
},
|
|
127
127
|
"peerDependencies": {
|
|
128
128
|
"@vitest/eslint-plugin": "^1.6.4",
|
|
129
|
-
"eslint": "^9.
|
|
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",
|