@isentinel/eslint-config 6.0.0-beta.16 → 6.0.0-beta.18

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/cli.mjs CHANGED
@@ -9,7 +9,7 @@ import path from "node:path";
9
9
  import { existsSync, readFileSync } from "fs";
10
10
  import { execSync } from "node:child_process";
11
11
  //#region package.json
12
- var version = "6.0.0-beta.16";
12
+ var version = "6.0.0-beta.18";
13
13
  var package_default = {
14
14
  name: "@isentinel/eslint-config",
15
15
  version,
@@ -137,6 +137,7 @@ var package_default = {
137
137
  "@isentinel/eslint-config": "workspace:*",
138
138
  "@isentinel/tsconfig": "catalog:dev",
139
139
  "@stylistic/eslint-plugin-migrate": "catalog:dev",
140
+ "@total-typescript/shoehorn": "catalog:dev",
140
141
  "@types/node": "catalog:dev",
141
142
  "@types/picomatch": "catalog:dev",
142
143
  "@types/semver": "catalog:dev",
@@ -160,7 +161,6 @@ var package_default = {
160
161
  "picomatch": "catalog:dev",
161
162
  "pnpm-workspace-yaml": "catalog:dev",
162
163
  "publint": "catalog:dev",
163
- "rimraf": "catalog:dev",
164
164
  "tsdown": "catalog:dev",
165
165
  "type-fest": "catalog:dev",
166
166
  "typescript": "catalog:dev",
@@ -170,7 +170,7 @@ var package_default = {
170
170
  peerDependencies: {
171
171
  "@vitest/eslint-plugin": "^1.6.4",
172
172
  "eslint": "^10.4.0",
173
- "eslint-plugin-eslint-plugin": "^7.0.0",
173
+ "eslint-plugin-eslint-plugin": "^7.5.0",
174
174
  "eslint-plugin-jest": "^29.15.0",
175
175
  "eslint-plugin-jest-extended": "^3.0.0",
176
176
  "eslint-plugin-n": "^17.0.0 || ^18.0.0",
@@ -253,6 +253,17 @@ const dependenciesMap = {
253
253
  test: ["eslint-plugin-jest"]
254
254
  };
255
255
  //#endregion
256
+ //#region src/guards.ts
257
+ /**
258
+ * Whether a value is an array whose every element is a string.
259
+ *
260
+ * @param value - The value to test.
261
+ * @returns Whether the value is a `string` array.
262
+ */
263
+ function isStringArray(value) {
264
+ return Array.isArray(value) && value.every((item) => typeof item === "string");
265
+ }
266
+ //#endregion
256
267
  //#region node_modules/.pnpm/parse-gitignore-ts@1.0.0/node_modules/parse-gitignore-ts/dist/index.mjs
257
268
  var isObject = (v) => v !== null && typeof v === "object" && !Array.isArray(v);
258
269
  var INVALID_PATH_CHARS_REGEX = /[<>:"|?*\n\r\t\f\x00-\x1F]/;
@@ -471,7 +482,7 @@ import isentinel from '@isentinel/eslint-config'
471
482
 
472
483
  export default isentinel({
473
484
  ${mainConfig}
474
- }${additionalConfigs?.map((config) => `,{\n${config}\n}`)})
485
+ }${additionalConfigs?.map((config) => `,{\n${config}\n}`).join(",") ?? ""})
475
486
  `.trimStart();
476
487
  }
477
488
  function isGitClean() {
@@ -577,7 +588,7 @@ async function updatePackageJson(result, skipPrompt = false) {
577
588
  }
578
589
  if (addedPackages.length) note(ansis.dim(addedPackages.join(", ")), "Added packages");
579
590
  parsedPackage.scripts ??= {};
580
- const scripts = parsedPackage.scripts;
591
+ const { scripts = {} } = parsedPackage;
581
592
  const { added, overwritten } = await mergeLintScripts(scripts, {
582
593
  confirmOverwrite: async (name, existing, desired) => {
583
594
  return await confirm({
@@ -618,7 +629,7 @@ async function updateVscodeSettings(result) {
618
629
  async function run(options = {}) {
619
630
  const argumentSkipPrompt = !!(process.env["SKIP_PROMPT"] ?? "") || options.yes;
620
631
  const argumentTemplate = options.frameworks?.map((framework) => framework.trim()).filter((framework) => {
621
- return frameworks.includes(framework);
632
+ return frameworks.some((valid) => valid === framework);
622
633
  });
623
634
  const eslintConfigFiles = fs.readdirSync(process.cwd()).filter((file) => file.startsWith("eslint.config."));
624
635
  if (eslintConfigFiles.length > 0) {
@@ -631,7 +642,7 @@ async function run(options = {}) {
631
642
  updateVscodeSettings: true
632
643
  };
633
644
  if (argumentSkipPrompt !== true) {
634
- result = await group({
645
+ const { frameworks: groupedFrameworks, uncommittedConfirmed, updateVscodeSettings: shouldUpdateVscode } = await group({
635
646
  uncommittedConfirmed: async () => {
636
647
  if (isGitClean()) return true;
637
648
  return confirm({
@@ -659,6 +670,13 @@ async function run(options = {}) {
659
670
  cancel("Operation cancelled.");
660
671
  process.exit(0);
661
672
  } });
673
+ result = {
674
+ frameworks: isStringArray(groupedFrameworks) ? groupedFrameworks.filter((value) => {
675
+ return frameworks.some((option) => option === value);
676
+ }) : [],
677
+ uncommittedConfirmed: uncommittedConfirmed === true,
678
+ updateVscodeSettings: shouldUpdateVscode !== false
679
+ };
662
680
  if (!result.uncommittedConfirmed) return process.exit(1);
663
681
  }
664
682
  await updatePackageJson(result, argumentSkipPrompt === true);
package/dist/index.d.mts CHANGED
@@ -2040,6 +2040,9 @@ interface MainRuleDefaults {
2040
2040
  "react/jsx-wrap-multilines": {
2041
2041
  "*": "off";
2042
2042
  };
2043
+ "require-await": {
2044
+ "*": "off";
2045
+ };
2043
2046
  "rest-spread-spacing": {
2044
2047
  "*": "off";
2045
2048
  };
@@ -2170,6 +2173,10 @@ interface MainRuleDefaults {
2170
2173
  game_roblox: "error";
2171
2174
  package_roblox: "error";
2172
2175
  };
2176
+ "small-rules/array-type-generic": {
2177
+ game_roblox: "error";
2178
+ package_roblox: "error";
2179
+ };
2173
2180
  "small-rules/no-array-constructor-elements": {
2174
2181
  game_roblox: "error";
2175
2182
  package_roblox: "error";
@@ -2184,6 +2191,10 @@ interface MainRuleDefaults {
2184
2191
  "small-rules/no-commented-code": {
2185
2192
  "*": "error";
2186
2193
  };
2194
+ "small-rules/no-recursive": {
2195
+ game_roblox: "error";
2196
+ package_roblox: "error";
2197
+ };
2187
2198
  "small-rules/prefer-class-properties": {
2188
2199
  "*": "error";
2189
2200
  };
@@ -2198,6 +2209,9 @@ interface MainRuleDefaults {
2198
2209
  "small-rules/prefer-singular-enums": {
2199
2210
  "*": "error";
2200
2211
  };
2212
+ "small-rules/require-async-suffix": {
2213
+ "*": "error";
2214
+ };
2201
2215
  "small-rules/strict-component-boundaries": {
2202
2216
  "*": "error";
2203
2217
  };
@@ -3195,6 +3209,9 @@ interface MainRuleDefaults {
3195
3209
  "ts/consistent-type-definitions": {
3196
3210
  "*": ["error", "interface"];
3197
3211
  };
3212
+ "ts/consistent-type-exports": {
3213
+ "*": "error";
3214
+ };
3198
3215
  "ts/consistent-type-imports": {
3199
3216
  "*": ["error", {
3200
3217
  "disallowTypeAnnotations": false;
@@ -3249,6 +3266,12 @@ interface MainRuleDefaults {
3249
3266
  "ts/no-array-constructor": {
3250
3267
  "*": "off";
3251
3268
  };
3269
+ "ts/no-array-delete": {
3270
+ "*": "error";
3271
+ };
3272
+ "ts/no-base-to-string": {
3273
+ "*": "error";
3274
+ };
3252
3275
  "ts/no-confusing-non-null-assertion": {
3253
3276
  "*": "error";
3254
3277
  };
@@ -3337,6 +3360,9 @@ interface MainRuleDefaults {
3337
3360
  "ts/no-misused-promises": {
3338
3361
  "*": "error";
3339
3362
  };
3363
+ "ts/no-misused-spread": {
3364
+ "*": "error";
3365
+ };
3340
3366
  "ts/no-mixed-enums": {
3341
3367
  "*": "error";
3342
3368
  };
@@ -3393,6 +3419,9 @@ interface MainRuleDefaults {
3393
3419
  "ts/no-unnecessary-type-constraint": {
3394
3420
  "*": "error";
3395
3421
  };
3422
+ "ts/no-unnecessary-type-conversion": {
3423
+ "*": "error";
3424
+ };
3396
3425
  "ts/no-unnecessary-type-parameters": {
3397
3426
  "*": "error";
3398
3427
  };
@@ -3420,6 +3449,9 @@ interface MainRuleDefaults {
3420
3449
  "ts/no-unsafe-return": {
3421
3450
  "*": "error";
3422
3451
  };
3452
+ "ts/no-unsafe-type-assertion": {
3453
+ "*": "error";
3454
+ };
3423
3455
  "ts/no-unsafe-unary-minus": {
3424
3456
  "*": "error";
3425
3457
  };
@@ -3516,11 +3548,25 @@ interface MainRuleDefaults {
3516
3548
  "ts/quotes": {
3517
3549
  "*": "off";
3518
3550
  };
3551
+ "ts/related-getter-setter-pairs": {
3552
+ game_std: "error";
3553
+ package_std: "error";
3554
+ };
3555
+ "ts/require-array-sort-compare": {
3556
+ game_std: "error";
3557
+ package_std: "error";
3558
+ };
3559
+ "ts/require-await": {
3560
+ "*": "error";
3561
+ };
3519
3562
  "ts/restrict-plus-operands": {
3520
3563
  "*": "error";
3521
3564
  };
3522
3565
  "ts/restrict-template-expressions": {
3523
- "*": "off";
3566
+ "*": ["error", {
3567
+ "allowBoolean": true;
3568
+ "allowNumber": true;
3569
+ }];
3524
3570
  };
3525
3571
  "ts/return-await": {
3526
3572
  "*": "error";
@@ -5305,6 +5351,10 @@ interface TestRuleDefaults {
5305
5351
  "sonar/no-trivial-assertions": {
5306
5352
  "*": "error";
5307
5353
  };
5354
+ "sonar/super-linear-regex": {
5355
+ game_std: "off";
5356
+ package_std: "off";
5357
+ };
5308
5358
  "sonar/synchronous-suite-callback": {
5309
5359
  "*": "error";
5310
5360
  };
@@ -5331,6 +5381,9 @@ interface TestRuleDefaults {
5331
5381
  "allowTernary": false;
5332
5382
  }];
5333
5383
  };
5384
+ "ts/require-await": {
5385
+ "*": "off";
5386
+ };
5334
5387
  "ts/unbound-method": {
5335
5388
  "*": "off";
5336
5389
  };
@@ -26410,6 +26463,19 @@ declare function isInGitHooksOrLintStaged(environment?: NodeJS.ProcessEnv): bool
26410
26463
  * @returns Whether an agent session was detected.
26411
26464
  */
26412
26465
  declare function isInAgentSession(environment?: NodeJS.ProcessEnv): boolean;
26466
+ /**
26467
+ * Whether autofixes that rewrite code an agent just wrote should be withheld.
26468
+ *
26469
+ * Opt-in, and deliberately not tied to {@link isInAgentSession}: merely being
26470
+ * an agent is no reason to lint differently — an agent that runs the linter
26471
+ * wants the same fixes a human would get. The case this exists for is the
26472
+ * wrapper that fixes without anyone reading the diff (an edit hook, a
26473
+ * fix-on-save daemon), which knows it is that and can say so.
26474
+ *
26475
+ * @param environment - The environment variables to inspect.
26476
+ * @returns Whether fix suppression was requested.
26477
+ */
26478
+ declare function isAgentAutofixDisabled(environment?: NodeJS.ProcessEnv): boolean;
26413
26479
  declare function isInEditorEnvironment(environment?: NodeJS.ProcessEnv): boolean;
26414
26480
  /**
26415
26481
  * Oxfmt's generated types widen `jsdoc.commentLineStrategy` and
@@ -27126,7 +27192,7 @@ interface OptionsConfig extends OptionsComponentExtensions, OptionsProjectType {
27126
27192
  * This will become the default in a future major version.
27127
27193
  * @see {@link OptionsConfig.namedConfigs}
27128
27194
  */
27129
- type NamedOptionsConfig = OptionsConfig & TypedFlatConfigItem & {
27195
+ type NamedOptionsConfig = Omit<TypedFlatConfigItem, "ignores"> & OptionsConfig & {
27130
27196
  name: string;
27131
27197
  namedConfigs: true;
27132
27198
  };
@@ -27290,7 +27356,7 @@ declare const GLOB_GRAPHQL = "**/*.{g,graph}ql";
27290
27356
  * Type tests (`expectTypeOf` / `assertType`), run by Vitest's `typecheck`
27291
27357
  * mode. They are test files, but assert nothing at runtime.
27292
27358
  */
27293
- declare const GLOB_TYPE_TESTS = "**/*.test-d.{,c,m}[jt]s{,x}";
27359
+ declare const GLOB_TYPE_TESTS = "**/*.{test,spec}-d.{,c,m}[jt]s{,x}";
27294
27360
  declare const GLOB_TESTS: Array<string>;
27295
27361
  declare const GLOB_BUILD_TOOLS: Array<string>;
27296
27362
  declare const GLOB_ALL_SRC: string[];
@@ -27302,7 +27368,7 @@ declare function comments({ prettierOptions, stylistic }?: OptionsFormatters & O
27302
27368
  //#region src/eslint/configs/disables.d.ts
27303
27369
  declare function disables({ root }: {
27304
27370
  root: Array<string>;
27305
- }): Promise<Array<TypedFlatConfigItem>>;
27371
+ }): Array<TypedFlatConfigItem>;
27306
27372
  //#endregion
27307
27373
  //#region src/eslint/configs/e18e.d.ts
27308
27374
  declare function e18e({ files, ignores, isInEditor, modernization, type, moduleReplacements, nodeMajor, overrides, performanceImprovements }?: OptionsE18e & OptionsFiles & OptionsIsInEditor & OptionsProjectType & {
@@ -27333,7 +27399,7 @@ interface GitignoreOptions {
27333
27399
  declare function gitignore({ config, explicit }?: GitignoreOptions): Promise<Array<TypedFlatConfigItem>>;
27334
27400
  //#endregion
27335
27401
  //#region src/eslint/configs/ignores.d.ts
27336
- declare function ignores$1(userIgnores?: ((originals: Array<string>) => Array<string>) | Array<string>): Promise<Array<TypedFlatConfigItem>>;
27402
+ declare function ignores$1(userIgnores?: ((originals: Array<string>) => Array<string>) | Array<string>): Array<TypedFlatConfigItem>;
27337
27403
  //#endregion
27338
27404
  //#region src/eslint/configs/imports.d.ts
27339
27405
  declare function imports({ stylistic, type }?: OptionsProjectType & OptionsStylistic): Promise<Array<TypedFlatConfigItem>>;
@@ -27486,4 +27552,4 @@ declare function unicorn({ complementIgnores, nameReplacements, roblox, root: cu
27486
27552
  //#region src/eslint/configs/yaml.d.ts
27487
27553
  declare function yaml({ files, overrides, stylistic }?: OptionsFiles & OptionsOverrides & OptionsStylistic): Promise<Array<TypedFlatConfigItem>>;
27488
27554
  //#endregion
27489
- export { Awaitable, type ConfigNames, type FlatConfigComposer, GLOB_ALL_JSON, GLOB_ALL_SRC, GLOB_BIN, GLOB_BUILD_TOOLS, GLOB_CSS, GLOB_DTS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LINTABLE_EXTENSIONS, GLOB_LUA, GLOB_MARKDOWN, GLOB_MARKDOWN_BLOCKS, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_MISE, GLOB_PACKAGE_JSON, GLOB_PACKAGE_JSON_ROOT, GLOB_POSTCSS, GLOB_ROOT, GLOB_ROOT_SRC, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_SRC_EXTENSIONS, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_TYPE_TESTS, GLOB_XML, GLOB_YAML, GitignoreOptions, JsdocOptions, NamedFlatConfigItem, NamedOptionsConfig, NamingConfig, NamingSelector, OptionsComponentExtensions, OptionsConfig, OptionsE18e, OptionsFiles, OptionsFilesTypeAware, OptionsFormatters, OptionsHasRoblox, OptionsHasTypeScript, OptionsIsInEditor, OptionsJest, OptionsOverrides, OptionsOverridesTypeAware, OptionsPnpm, OptionsProjectType, OptionsStylistic, OptionsTestFramework, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsVitest, type OxfmtOptions, PerfectionistConfig, type PrettierOptions, ReactConfig, Rules, SpellCheckConfig, StylisticConfig, StylisticConfigDefaults, TypedFlatConfigItem, comments, isentinel as default, isentinel, defaultPluginRenaming, disables, e18e, eslintPlugin, flawless, gitignore, ignores$1 as ignores, imports, isInAgentSession, isInEditorEnvironment, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, loadSmallRulesPlugin, markdown, naming, node, oxfmt, packageJson, perfectionist, pnpm, promise, react, roblox$1 as roblox, smallRules, sonarjs, sortCspell, sortGithubAction, sortMiseToml, sortPnpmWorkspace, sortRojoProject, sortTsconfig, spelling, stylistic$1 as stylistic, test, toml, typescript, unicorn, yaml };
27555
+ export { type Awaitable, type ConfigNames, type FlatConfigComposer, GLOB_ALL_JSON, GLOB_ALL_SRC, GLOB_BIN, GLOB_BUILD_TOOLS, GLOB_CSS, GLOB_DTS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LINTABLE_EXTENSIONS, GLOB_LUA, GLOB_MARKDOWN, GLOB_MARKDOWN_BLOCKS, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_MISE, GLOB_PACKAGE_JSON, GLOB_PACKAGE_JSON_ROOT, GLOB_POSTCSS, GLOB_ROOT, GLOB_ROOT_SRC, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_SRC_EXTENSIONS, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_TYPE_TESTS, GLOB_XML, GLOB_YAML, GitignoreOptions, type JsdocOptions, type NamedFlatConfigItem, type NamedOptionsConfig, type NamingConfig, type NamingSelector, type OptionsComponentExtensions, type OptionsConfig, type OptionsE18e, type OptionsFiles, type OptionsFilesTypeAware, type OptionsFormatters, type OptionsHasRoblox, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsJest, type OptionsOverrides, type OptionsOverridesTypeAware, type OptionsPnpm, type OptionsProjectType, type OptionsStylistic, type OptionsTestFramework, type OptionsTypeScriptErasableOnly, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnicorn, type OptionsVitest, type OxfmtOptions, type PerfectionistConfig, type PrettierOptions, type ReactConfig, type Rules, type SpellCheckConfig, type StylisticConfig, StylisticConfigDefaults, type TypedFlatConfigItem, comments, isentinel as default, isentinel, defaultPluginRenaming, disables, e18e, eslintPlugin, flawless, gitignore, ignores$1 as ignores, imports, isAgentAutofixDisabled, isInAgentSession, isInEditorEnvironment, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, loadSmallRulesPlugin, markdown, naming, node, oxfmt, packageJson, perfectionist, pnpm, promise, react, roblox$1 as roblox, smallRules, sonarjs, sortCspell, sortGithubAction, sortMiseToml, sortPnpmWorkspace, sortRojoProject, sortTsconfig, spelling, stylistic$1 as stylistic, test, toml, typescript, unicorn, yaml };