@isentinel/eslint-config 3.0.0-beta.7 → 3.0.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/cli.js CHANGED
@@ -11,7 +11,7 @@ import { execSync } from "node:child_process";
11
11
 
12
12
  //#region package.json
13
13
  var name = "@isentinel/eslint-config";
14
- var version = "3.0.0-beta.7";
14
+ var version = "3.0.0";
15
15
  var description = "iSentinel's ESLint config";
16
16
  var keywords = [
17
17
  "eslint-config",
package/dist/index.d.ts CHANGED
@@ -15116,6 +15116,139 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
15116
15116
  // Names of all the configs
15117
15117
  type ConfigNames = 'isentinel/eslint/comments' | 'isentinel/eslint/comments/src' | 'isentinel/eslint-plugin/setup' | 'isentinel/eslint-plugin/rules' | 'isentinel/gitignore' | 'isentinel/ignores' | 'isentinel/imports/rules' | 'isentinel/imports/game' | 'isentinel/javascript/setup' | 'isentinel/javascript/rules' | 'isentinel/jsdoc/setup' | 'isentinel/jsdoc' | 'isentinel/jsonc/setup' | 'isentinel/jsonc/rules' | 'isentinel/markdown/setup' | 'isentinel/markdown/processor' | 'isentinel/markdown/parser' | 'isentinel/markdown/disables' | 'isentinel/node/rules' | 'isentinel/package-json/setup' | 'isentinel/package-json' | 'isentinel/perfectionist/setup' | 'isentinel/perfectionist' | 'isentinel/pnpm/setup' | 'isentinel/pnpm/package-json' | 'isentinel/pnpm/pnpm-workspace-yaml' | 'isentinel/prettier/setup' | 'isentinel/prettier/javascript' | 'isentinel/prettier' | 'isentinel/prettier/css' | 'isentinel/prettier/scss' | 'isentinel/prettier/less' | 'isentinel/prettier/html' | 'isentinel/prettier/markdown' | 'isentinel/prettier/graphql' | 'isentinel/prettier/json' | 'isentinel/prettier/yaml' | 'isentinel/promise' | 'isentinel/react/setup' | 'isentinel/react/rules' | 'isentinel/react/type-aware-rules' | 'isentinel/roblox/setup' | 'isentinel/roblox/parser' | 'isentinel/roblox/type-aware-parser' | 'isentinel/roblox' | 'isentinel/roblox/rules-type-aware' | 'isentinel/roblox/format-lua/setup' | 'isentinel/roblox/format-lua' | 'isentinel/shopify' | 'isentinel/sonarjs' | 'isentinel/sort-tsconfig' | 'isentinel/spelling/setup' | 'isentinel/spelling' | 'isentinel/stylistic/setup' | 'isentinel/stylistic' | 'isentinel/stylistic/ts' | 'isentinel/stylistic/js' | 'isentinel/stylistic/markdown-code' | 'isentinel/test/jest/setup' | 'isentinel/test/jest/rules' | 'isentinel/toml/setup' | 'isentinel/toml/rules' | 'isentinel/typescript/setup' | 'isentinel/typescript/parser' | 'isentinel/typescript/type-aware-parser' | 'isentinel/typescript/rules' | 'isentinel/typescript/rules-type-aware' | 'isentinel/unicorn' | 'isentinel/unicorn/root' | 'isentinel/yaml/setup' | 'isentinel/yaml/rules';
15118
15118
  //#endregion
15119
+ //#region src/utils.d.ts
15120
+ type ExtractRuleOptions<T> = T extends Linter.RuleEntry<infer U> ? U : never;
15121
+ type ModuleImport<T> = Promise<T | {
15122
+ default: T;
15123
+ }>;
15124
+ type Parser = NonNullable<FlatConfig["languageOptions"]>["parser"];
15125
+ declare const require: NodeJS.Require;
15126
+ declare const parserPlain: {
15127
+ meta: {
15128
+ name: string;
15129
+ };
15130
+ parseForESLint: (code: string) => {
15131
+ ast: {
15132
+ body: never[];
15133
+ comments: never[];
15134
+ loc: {
15135
+ end: number;
15136
+ start: number;
15137
+ };
15138
+ range: number[];
15139
+ tokens: never[];
15140
+ type: string;
15141
+ };
15142
+ scopeManager: null;
15143
+ services: {
15144
+ isPlain: boolean;
15145
+ };
15146
+ visitorKeys: {
15147
+ Program: never[];
15148
+ };
15149
+ };
15150
+ };
15151
+ type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
15152
+ /**
15153
+ * Combine array and non-array configs into a single array.
15154
+ *
15155
+ * @param configs - The configs to combine.
15156
+ * @returns The combined array.
15157
+ */
15158
+ declare function combine(...configs: Array<Awaitable<Array<TypedFlatConfigItem> | TypedFlatConfigItem>>): Promise<Array<TypedFlatConfigItem>>;
15159
+ declare function createTsParser(options: {
15160
+ componentExtensions?: Array<string>;
15161
+ configName: string;
15162
+ files: Array<string>;
15163
+ ignores?: Array<string>;
15164
+ parser: Parser;
15165
+ parserOptions?: ParserOptions;
15166
+ tsconfigPath?: string;
15167
+ typeAware: boolean;
15168
+ }): TypedFlatConfigItem;
15169
+ declare function ensurePackages(packages: Array<string | undefined>): Promise<void>;
15170
+ declare function getOverrides(options: OptionsConfig, key: keyof OptionsConfig): TypedFlatConfigItem["rules"];
15171
+ declare function getTsConfig(tsconfigPath?: string): string | undefined;
15172
+ declare function interopDefault<T>(dynamicImport: ModuleImport<T>): Promise<T>;
15173
+ declare function isInEditorEnvironment(): boolean;
15174
+ declare function isInGitHooksOrLintStaged(): boolean;
15175
+ declare function mergePrettierOptions(options: PrettierOptions, overrides?: PrettierRuleOptions): Record<string, any>;
15176
+ /**
15177
+ * Rename plugin names a flat configs array.
15178
+ *
15179
+ * @example
15180
+ *
15181
+ * ```ts
15182
+ * import { renamePluginInConfigs } from "@antfu/eslint-config";
15183
+ * import someConfigs from "./some-configs";
15184
+ *
15185
+ * export default renamePluginInConfigs(someConfigs, {
15186
+ * "@typescript-eslint": "ts",
15187
+ * "import-x": "import",
15188
+ * });
15189
+ * ```
15190
+ *
15191
+ * @param configs - The configs array to rename.
15192
+ * @param map - A map of prefixes to rename.
15193
+ * @returns The renamed configs array.
15194
+ */
15195
+ declare function renamePluginInConfigs(configs: Array<TypedFlatConfigItem>, map: Record<string, string>): Array<TypedFlatConfigItem>;
15196
+ /**
15197
+ * Rename plugin prefixes in a rule object. Accepts a map of prefixes to rename.
15198
+ *
15199
+ * @example
15200
+ *
15201
+ * ```ts
15202
+ * import { renameRules } from "@antfu/eslint-config";
15203
+ *
15204
+ * export default [
15205
+ * {
15206
+ * rules: renameRules(
15207
+ * {
15208
+ * "@typescript-eslint/indent": "error",
15209
+ * },
15210
+ * { "@typescript-eslint": "ts" },
15211
+ * ),
15212
+ * },
15213
+ * ];
15214
+ * ```
15215
+ *
15216
+ * @param rules - The rules object to rename.
15217
+ * @param map - A map of prefixes to rename.
15218
+ * @returns The renamed rules object.
15219
+ */
15220
+ declare function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any>;
15221
+ /**
15222
+ * Resolve Prettier configuration options for the project.
15223
+ *
15224
+ * @returns The Prettier configuration options, or an empty object if none
15225
+ * found.
15226
+ */
15227
+ declare function resolvePrettierConfigOptions(): Promise<PrettierOptions>;
15228
+ declare function resolveSubOptions<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): ResolvedOptions<OptionsConfig[K]>;
15229
+ /**
15230
+ * Resolve options with default values. Handles the pattern where `true` means
15231
+ * "use defaults", `false` disables the feature, and objects are used as-is.
15232
+ *
15233
+ * @template T - The type of the defaults object.
15234
+ * @param value - The option value (true | false | undefined | object).
15235
+ * @param defaults - Default values to use when value is true or undefined.
15236
+ * @returns The resolved options.
15237
+ */
15238
+ declare function resolveWithDefaults<T>(value: boolean | T | undefined, defaults: T): false | T;
15239
+ /**
15240
+ * Check if a feature should be enabled based on options. Handles the pattern
15241
+ * where features can be disabled globally or individually.
15242
+ *
15243
+ * @template T - The type of the options object.
15244
+ * @template K - The key type within the options object.
15245
+ * @param options - The options object (true | false | undefined | object).
15246
+ * @param key - The key to check within the options object.
15247
+ * @param defaultValue - Default value when key is not specified.
15248
+ * @returns Whether the feature should be enabled.
15249
+ */
15250
+ declare function shouldEnableFeature<T extends Record<string, any>>(options: boolean | T | undefined, key: keyof T, defaultValue?: boolean): boolean;
15251
+ //#endregion
15119
15252
  //#region src/types.d.ts
15120
15253
  type Awaitable<T> = Promise<T> | T;
15121
15254
  interface JsDocOptions {
@@ -15408,6 +15541,11 @@ interface OptionsTypeScriptWithTypes {
15408
15541
  }
15409
15542
  interface PerfectionistConfig {
15410
15543
  customClassGroups?: Array<string>;
15544
+ /**
15545
+ * Custom configuration for perfectionist/sort-objects rule.
15546
+ * Merges with default config.
15547
+ */
15548
+ sortObjects?: Partial<ExtractRuleOptions<NonNullable<RuleOptions["perfectionist/sort-objects"]>>[0]>;
15411
15549
  }
15412
15550
  type ReactConfig = ESLintReactSettings & OptionsOverrides & {
15413
15551
  filenameCase?: "kebabCase" | "pascalCase";
@@ -15619,136 +15757,4 @@ declare const GLOB_BUILD_TOOLS: string[];
15619
15757
  declare const GLOB_ALL_SRC: string[];
15620
15758
  declare const GLOB_EXCLUDE: string[];
15621
15759
  //#endregion
15622
- //#region src/utils.d.ts
15623
- type ModuleImport<T> = Promise<T | {
15624
- default: T;
15625
- }>;
15626
- type Parser = NonNullable<FlatConfig["languageOptions"]>["parser"];
15627
- declare const require: NodeJS.Require;
15628
- declare const parserPlain: {
15629
- meta: {
15630
- name: string;
15631
- };
15632
- parseForESLint: (code: string) => {
15633
- ast: {
15634
- body: never[];
15635
- comments: never[];
15636
- loc: {
15637
- end: number;
15638
- start: number;
15639
- };
15640
- range: number[];
15641
- tokens: never[];
15642
- type: string;
15643
- };
15644
- scopeManager: null;
15645
- services: {
15646
- isPlain: boolean;
15647
- };
15648
- visitorKeys: {
15649
- Program: never[];
15650
- };
15651
- };
15652
- };
15653
- type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
15654
- /**
15655
- * Combine array and non-array configs into a single array.
15656
- *
15657
- * @param configs - The configs to combine.
15658
- * @returns The combined array.
15659
- */
15660
- declare function combine(...configs: Array<Awaitable<Array<TypedFlatConfigItem> | TypedFlatConfigItem>>): Promise<Array<TypedFlatConfigItem>>;
15661
- declare function createTsParser(options: {
15662
- componentExtensions?: Array<string>;
15663
- configName: string;
15664
- files: Array<string>;
15665
- ignores?: Array<string>;
15666
- parser: Parser;
15667
- parserOptions?: ParserOptions;
15668
- tsconfigPath?: string;
15669
- typeAware: boolean;
15670
- }): TypedFlatConfigItem;
15671
- declare function ensurePackages(packages: Array<string | undefined>): Promise<void>;
15672
- declare function getOverrides(options: OptionsConfig, key: keyof OptionsConfig): TypedFlatConfigItem["rules"];
15673
- declare function getTsConfig(tsconfigPath?: string): string | undefined;
15674
- declare function interopDefault<T>(dynamicImport: ModuleImport<T>): Promise<T>;
15675
- declare function isInEditorEnvironment(): boolean;
15676
- declare function isInGitHooksOrLintStaged(): boolean;
15677
- declare function mergePrettierOptions(options: PrettierOptions, overrides?: PrettierRuleOptions): Record<string, any>;
15678
- /**
15679
- * Rename plugin names a flat configs array.
15680
- *
15681
- * @example
15682
- *
15683
- * ```ts
15684
- * import { renamePluginInConfigs } from "@antfu/eslint-config";
15685
- * import someConfigs from "./some-configs";
15686
- *
15687
- * export default renamePluginInConfigs(someConfigs, {
15688
- * "@typescript-eslint": "ts",
15689
- * "import-x": "import",
15690
- * });
15691
- * ```
15692
- *
15693
- * @param configs - The configs array to rename.
15694
- * @param map - A map of prefixes to rename.
15695
- * @returns The renamed configs array.
15696
- */
15697
- declare function renamePluginInConfigs(configs: Array<TypedFlatConfigItem>, map: Record<string, string>): Array<TypedFlatConfigItem>;
15698
- /**
15699
- * Rename plugin prefixes in a rule object. Accepts a map of prefixes to rename.
15700
- *
15701
- * @example
15702
- *
15703
- * ```ts
15704
- * import { renameRules } from "@antfu/eslint-config";
15705
- *
15706
- * export default [
15707
- * {
15708
- * rules: renameRules(
15709
- * {
15710
- * "@typescript-eslint/indent": "error",
15711
- * },
15712
- * { "@typescript-eslint": "ts" },
15713
- * ),
15714
- * },
15715
- * ];
15716
- * ```
15717
- *
15718
- * @param rules - The rules object to rename.
15719
- * @param map - A map of prefixes to rename.
15720
- * @returns The renamed rules object.
15721
- */
15722
- declare function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any>;
15723
- /**
15724
- * Resolve Prettier configuration options for the project.
15725
- *
15726
- * @returns The Prettier configuration options, or an empty object if none
15727
- * found.
15728
- */
15729
- declare function resolvePrettierConfigOptions(): Promise<PrettierOptions>;
15730
- declare function resolveSubOptions<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): ResolvedOptions<OptionsConfig[K]>;
15731
- /**
15732
- * Resolve options with default values. Handles the pattern where `true` means
15733
- * "use defaults", `false` disables the feature, and objects are used as-is.
15734
- *
15735
- * @template T - The type of the defaults object.
15736
- * @param value - The option value (true | false | undefined | object).
15737
- * @param defaults - Default values to use when value is true or undefined.
15738
- * @returns The resolved options.
15739
- */
15740
- declare function resolveWithDefaults<T>(value: boolean | T | undefined, defaults: T): false | T;
15741
- /**
15742
- * Check if a feature should be enabled based on options. Handles the pattern
15743
- * where features can be disabled globally or individually.
15744
- *
15745
- * @template T - The type of the options object.
15746
- * @template K - The key type within the options object.
15747
- * @param options - The options object (true | false | undefined | object).
15748
- * @param key - The key to check within the options object.
15749
- * @param defaultValue - Default value when key is not specified.
15750
- * @returns Whether the feature should be enabled.
15751
- */
15752
- declare function shouldEnableFeature<T extends Record<string, any>>(options: boolean | T | undefined, key: keyof T, defaultValue?: boolean): boolean;
15753
- //#endregion
15754
- export { Awaitable, type ConfigNames, GLOB_ALL_JSON, GLOB_ALL_SRC, 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_LUA, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_ROOT, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, GitignoreOptions, JsDocOptions, OptionsComponentExtensions, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsProjectType, OptionsRoblox, OptionsStylistic, OptionsTestFramework, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, PerfectionistConfig, type PrettierOptions, PrettierRuleOptions, ReactConfig, ResolvedOptions, Rules, SpellCheckConfig, StylisticConfig, StylisticConfigDefaults, TypedFlatConfigItem, combine, comments, createTsParser, isentinel as default, defaultPluginRenaming, disables, ensurePackages, eslintPlugin, getOverrides, getTsConfig, gitignore, ignores, imports, interopDefault, isInEditorEnvironment, isInGitHooksOrLintStaged, isentinel, javascript, jsdoc, jsonc, markdown, mergePrettierOptions, node, packageJson, parserPlain, perfectionist, pnpm, prettier, promise, react, renamePluginInConfigs, renameRules, require, resolvePrettierConfigOptions, resolveSubOptions, resolveWithDefaults, roblox, shopify, shouldEnableFeature, sonarjs, sortGithubAction, sortTsconfig, spelling, stylistic, toml, typescript, unicorn, yaml };
15760
+ export { Awaitable, type ConfigNames, ExtractRuleOptions, GLOB_ALL_JSON, GLOB_ALL_SRC, 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_LUA, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_ROOT, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, GitignoreOptions, JsDocOptions, OptionsComponentExtensions, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsProjectType, OptionsRoblox, OptionsStylistic, OptionsTestFramework, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, PerfectionistConfig, type PrettierOptions, PrettierRuleOptions, ReactConfig, ResolvedOptions, Rules, SpellCheckConfig, StylisticConfig, StylisticConfigDefaults, TypedFlatConfigItem, combine, comments, createTsParser, isentinel as default, defaultPluginRenaming, disables, ensurePackages, eslintPlugin, getOverrides, getTsConfig, gitignore, ignores, imports, interopDefault, isInEditorEnvironment, isInGitHooksOrLintStaged, isentinel, javascript, jsdoc, jsonc, markdown, mergePrettierOptions, node, packageJson, parserPlain, perfectionist, pnpm, prettier, promise, react, renamePluginInConfigs, renameRules, require, resolvePrettierConfigOptions, resolveSubOptions, resolveWithDefaults, roblox, shopify, shouldEnableFeature, sonarjs, sortGithubAction, sortTsconfig, spelling, stylistic, toml, typescript, unicorn, yaml };
package/dist/index.js CHANGED
@@ -4133,7 +4133,7 @@ const constructorGroup = {
4133
4133
  * @see https://github.com/azat-io/eslint-plugin-perfectionist
4134
4134
  */
4135
4135
  async function perfectionist(config) {
4136
- const { customClassGroups = [], type = "game" } = config ?? {};
4136
+ const { customClassGroups = [], sortObjects, type = "game" } = config ?? {};
4137
4137
  const customGroups = [];
4138
4138
  for (const customGroup of customClassGroups) customGroups.push({
4139
4139
  elementNamePattern: customGroup,
@@ -4249,7 +4249,8 @@ async function perfectionist(config) {
4249
4249
  "perfectionist/sort-object-types": ["error", { type: "natural" }],
4250
4250
  "perfectionist/sort-objects": ["error", {
4251
4251
  partitionByComment: "^Part:\\s*(.*)$",
4252
- type: "natural"
4252
+ type: "natural",
4253
+ ...sortObjects
4253
4254
  }],
4254
4255
  "perfectionist/sort-sets": ["error", { type: "natural" }],
4255
4256
  "perfectionist/sort-switch-case": ["error", { type: "natural" }],
@@ -5375,11 +5376,11 @@ function sortGithubAction() {
5375
5376
  "continue-on-error",
5376
5377
  "timeout-minutes"
5377
5378
  ],
5378
- pathPattern: "^runs\\.steps\\.[^.]+$"
5379
+ pathPattern: "^runs\\.steps\\[\\d+\\]$"
5379
5380
  },
5380
5381
  {
5381
5382
  order: { type: "asc" },
5382
- pathPattern: "^(?!^$|inputs\\.[^.]+$|outputs\\.[^.]+$|runs$|runs\\.steps\\.[^.]+$).*"
5383
+ pathPattern: "^(?!^$|inputs\\.[^.]+$|outputs\\.[^.]+$|runs$|runs\\.steps\\[\\d+\\]$).*$"
5383
5384
  }
5384
5385
  ] }
5385
5386
  }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isentinel/eslint-config",
3
- "version": "3.0.0-beta.7",
3
+ "version": "3.0.0",
4
4
  "description": "iSentinel's ESLint config",
5
5
  "keywords": [
6
6
  "eslint-config",
@@ -118,7 +118,7 @@
118
118
  "tsdown": "0.14.2",
119
119
  "type-fest": "4.41.0",
120
120
  "typescript": "5.8.3",
121
- "@isentinel/eslint-config": "3.0.0-beta.7"
121
+ "@isentinel/eslint-config": "3.0.0"
122
122
  },
123
123
  "peerDependencies": {
124
124
  "@eslint-react/eslint-plugin": "^1.45.0",