@isentinel/eslint-config 3.1.3 → 3.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/cli.js +1 -1
- package/dist/index.d.ts +44 -28
- package/dist/index.js +40 -29
- package/package.json +2 -2
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -15544,13 +15544,19 @@ declare function createTsParser(options: {
|
|
|
15544
15544
|
configName: string;
|
|
15545
15545
|
files: Array<string>;
|
|
15546
15546
|
ignores?: Array<string>;
|
|
15547
|
+
outOfProjectFiles?: Array<string>;
|
|
15547
15548
|
parser: Parser;
|
|
15548
15549
|
parserOptions?: ParserOptions;
|
|
15550
|
+
parserOptionsNonTypeAware?: ParserOptions;
|
|
15551
|
+
parserOptionsTypeAware?: ParserOptions;
|
|
15549
15552
|
tsconfigPath?: string;
|
|
15550
15553
|
typeAware: boolean;
|
|
15551
15554
|
}): TypedFlatConfigItem;
|
|
15552
15555
|
declare function ensurePackages(packages: Array<string | undefined>): Promise<void>;
|
|
15553
|
-
declare function getOverrides(options: OptionsConfig, key: keyof OptionsConfig):
|
|
15556
|
+
declare function getOverrides(options: OptionsConfig, key: keyof OptionsConfig): {
|
|
15557
|
+
overrides: TypedFlatConfigItem["rules"];
|
|
15558
|
+
overridesTypeAware: TypedFlatConfigItem["rules"];
|
|
15559
|
+
};
|
|
15554
15560
|
declare function getTsConfig(tsconfigPath?: string): string | undefined;
|
|
15555
15561
|
declare function interopDefault<T>(dynamicImport: ModuleImport<T>): Promise<T>;
|
|
15556
15562
|
declare function isInEditorEnvironment(): boolean;
|
|
@@ -15634,7 +15640,7 @@ declare function shouldEnableFeature<T extends Record<string, any>>(options: boo
|
|
|
15634
15640
|
//#endregion
|
|
15635
15641
|
//#region src/types.d.ts
|
|
15636
15642
|
type Awaitable<T> = Promise<T> | T;
|
|
15637
|
-
interface
|
|
15643
|
+
interface JsdocOptions {
|
|
15638
15644
|
/**
|
|
15639
15645
|
* By default we have different rules enabled for different project types.
|
|
15640
15646
|
* This option allows you to enable the package rules regardless of the
|
|
@@ -15689,16 +15695,14 @@ interface OptionsConfig extends OptionsComponentExtensions, OptionsProjectType {
|
|
|
15689
15695
|
* @default auto-detect based on the process.env
|
|
15690
15696
|
*/
|
|
15691
15697
|
isInEditor?: boolean;
|
|
15692
|
-
/**
|
|
15693
|
-
* Core rules. Can't be disabled.
|
|
15694
|
-
*/
|
|
15698
|
+
/** Core rules. Can't be disabled. */
|
|
15695
15699
|
javascript?: OptionsOverrides;
|
|
15696
15700
|
/**
|
|
15697
15701
|
* Enable JSDoc support.
|
|
15698
15702
|
*
|
|
15699
15703
|
* @default true
|
|
15700
15704
|
*/
|
|
15701
|
-
jsdoc?: boolean |
|
|
15705
|
+
jsdoc?: boolean | JsdocOptions;
|
|
15702
15706
|
/**
|
|
15703
15707
|
* Enable JSONC support.
|
|
15704
15708
|
*
|
|
@@ -15746,13 +15750,11 @@ interface OptionsConfig extends OptionsComponentExtensions, OptionsProjectType {
|
|
|
15746
15750
|
*/
|
|
15747
15751
|
react?: boolean | ReactConfig;
|
|
15748
15752
|
/**
|
|
15749
|
-
* Enable Roblox
|
|
15753
|
+
* Enable Roblox linting rules.
|
|
15750
15754
|
*
|
|
15751
|
-
* @
|
|
15752
|
-
* @note This is only required as we are linting this
|
|
15753
|
-
* project with its own rule-set, despite not being a roblox project.
|
|
15755
|
+
* @default true
|
|
15754
15756
|
*/
|
|
15755
|
-
roblox?: boolean;
|
|
15757
|
+
roblox?: boolean | OptionsOverrides;
|
|
15756
15758
|
/**
|
|
15757
15759
|
* Enable CSpell support.
|
|
15758
15760
|
*
|
|
@@ -15860,6 +15862,9 @@ interface OptionsIsInEditor {
|
|
|
15860
15862
|
interface OptionsOverrides {
|
|
15861
15863
|
overrides?: TypedFlatConfigItem["rules"];
|
|
15862
15864
|
}
|
|
15865
|
+
interface OptionsOverridesTypeAware extends OptionsOverrides {
|
|
15866
|
+
overridesTypeAware?: TypedFlatConfigItem["rules"];
|
|
15867
|
+
}
|
|
15863
15868
|
interface OptionsProjectType {
|
|
15864
15869
|
/**
|
|
15865
15870
|
* Type of the project. `package` will enable more strict rules for
|
|
@@ -15887,8 +15892,8 @@ interface OptionsTypeScriptErasableOnly {
|
|
|
15887
15892
|
/**
|
|
15888
15893
|
* Enable erasable syntax only rules.
|
|
15889
15894
|
*
|
|
15890
|
-
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-erasable-syntax-only
|
|
15891
15895
|
* @default false
|
|
15896
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-erasable-syntax-only
|
|
15892
15897
|
*/
|
|
15893
15898
|
erasableOnly?: boolean;
|
|
15894
15899
|
}
|
|
@@ -15896,7 +15901,7 @@ interface OptionsTypeScriptParserOptions {
|
|
|
15896
15901
|
/**
|
|
15897
15902
|
* Glob patterns for files that should be type aware.
|
|
15898
15903
|
*
|
|
15899
|
-
* @default
|
|
15904
|
+
* @default ["**\/*.{ts,tsx}"]
|
|
15900
15905
|
*/
|
|
15901
15906
|
filesTypeAware?: Array<string>;
|
|
15902
15907
|
/**
|
|
@@ -15904,15 +15909,24 @@ interface OptionsTypeScriptParserOptions {
|
|
|
15904
15909
|
* virtual files created by processors (e.g., markdown TypeScript code
|
|
15905
15910
|
* blocks).
|
|
15906
15911
|
*
|
|
15907
|
-
* @default
|
|
15912
|
+
* @default ["**\/*.md\/**"]
|
|
15908
15913
|
*/
|
|
15909
15914
|
ignoresTypeAware?: Array<string>;
|
|
15910
|
-
/**
|
|
15915
|
+
/**
|
|
15916
|
+
* Globs of files to allow running with the default project compiler options
|
|
15917
|
+
* despite not being matched by the project service.
|
|
15918
|
+
*
|
|
15919
|
+
* @default ["*.js", "*.ts", ".*.js", ".*.ts"]
|
|
15920
|
+
*/
|
|
15921
|
+
outOfProjectFiles?: Array<string>;
|
|
15922
|
+
/** Additional parser options for all TypeScript files. */
|
|
15911
15923
|
parserOptions?: Partial<ParserOptions>;
|
|
15924
|
+
/** Additional parser options for non-type-aware files. */
|
|
15925
|
+
parserOptionsNonTypeAware?: Partial<ParserOptions>;
|
|
15926
|
+
/** Additional parser options for type-aware files. */
|
|
15927
|
+
parserOptionsTypeAware?: Partial<ParserOptions>;
|
|
15912
15928
|
}
|
|
15913
15929
|
interface OptionsTypeScriptWithTypes {
|
|
15914
|
-
/** Override type aware rules. */
|
|
15915
|
-
overridesTypeAware?: TypedFlatConfigItem["rules"];
|
|
15916
15930
|
/**
|
|
15917
15931
|
* Provide a path to the TypeScript configuration file to use a different
|
|
15918
15932
|
* default to 'tsconfig.json'.
|
|
@@ -15931,12 +15945,12 @@ interface OptionsTypeScriptWithTypes {
|
|
|
15931
15945
|
interface PerfectionistConfig {
|
|
15932
15946
|
customClassGroups?: Array<string>;
|
|
15933
15947
|
/**
|
|
15934
|
-
* Custom configuration for perfectionist/sort-objects rule.
|
|
15935
|
-
*
|
|
15948
|
+
* Custom configuration for perfectionist/sort-objects rule. Merges with
|
|
15949
|
+
* default config.
|
|
15936
15950
|
*/
|
|
15937
15951
|
sortObjects?: Partial<ExtractRuleOptions<NonNullable<RuleOptions["perfectionist/sort-objects"]>>[0]>;
|
|
15938
15952
|
}
|
|
15939
|
-
type ReactConfig = ESLintReactSettings &
|
|
15953
|
+
type ReactConfig = ESLintReactSettings & OptionsOverridesTypeAware & {
|
|
15940
15954
|
filenameCase?: "kebabCase" | "pascalCase";
|
|
15941
15955
|
};
|
|
15942
15956
|
type Rules = Record<string, Linter.RuleEntry<any> | undefined> & RuleOptions;
|
|
@@ -15964,15 +15978,17 @@ type StylisticConfig = Pick<StylisticCustomizeOptions, "indent" | "jsx" | "quote
|
|
|
15964
15978
|
*/
|
|
15965
15979
|
type TypedFlatConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
|
|
15966
15980
|
/**
|
|
15967
|
-
* An object containing a name-value mapping of plugin names to plugin
|
|
15968
|
-
* When `files` is specified, these plugins are only available to
|
|
15981
|
+
* An object containing a name-value mapping of plugin names to plugin
|
|
15982
|
+
* objects. When `files` is specified, these plugins are only available to
|
|
15983
|
+
* the matching files.
|
|
15969
15984
|
*
|
|
15970
15985
|
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
15971
15986
|
*/
|
|
15972
15987
|
plugins?: Record<string, any>;
|
|
15973
15988
|
/**
|
|
15974
15989
|
* An object containing the configured rules. When `files` or `ignores` are
|
|
15975
|
-
* specified, these rule configurations are only available to the matching
|
|
15990
|
+
* specified, these rule configurations are only available to the matching
|
|
15991
|
+
* files.
|
|
15976
15992
|
*/
|
|
15977
15993
|
rules?: Rules;
|
|
15978
15994
|
};
|
|
@@ -15987,7 +16003,7 @@ declare function disables(): Promise<Array<TypedFlatConfigItem>>;
|
|
|
15987
16003
|
declare function eslintPlugin(options?: OptionsFiles & OptionsOverrides): Promise<Array<TypedFlatConfigItem>>;
|
|
15988
16004
|
//#endregion
|
|
15989
16005
|
//#region src/configs/flawless.d.ts
|
|
15990
|
-
declare function flawless(options?: OptionsTypeScriptParserOptions & OptionsTypeScriptWithTypes): Promise<Array<TypedFlatConfigItem>>;
|
|
16006
|
+
declare function flawless(options?: OptionsOverridesTypeAware & OptionsTypeScriptParserOptions & OptionsTypeScriptWithTypes): Promise<Array<TypedFlatConfigItem>>;
|
|
15991
16007
|
//#endregion
|
|
15992
16008
|
//#region src/configs/gitignore.d.ts
|
|
15993
16009
|
interface GitignoreOptions {
|
|
@@ -16006,7 +16022,7 @@ declare function imports(options?: OptionsProjectType & OptionsStylistic): Promi
|
|
|
16006
16022
|
declare function javascript(options?: OptionsIsInEditor & OptionsOverrides & OptionsRoblox & OptionsStylistic): Promise<Array<TypedFlatConfigItem>>;
|
|
16007
16023
|
//#endregion
|
|
16008
16024
|
//#region src/configs/jsdoc.d.ts
|
|
16009
|
-
declare function jsdoc(options?:
|
|
16025
|
+
declare function jsdoc(options?: JsdocOptions & OptionsProjectType & OptionsStylistic): Promise<Array<TypedFlatConfigItem>>;
|
|
16010
16026
|
//#endregion
|
|
16011
16027
|
//#region src/configs/jsonc.d.ts
|
|
16012
16028
|
declare function jsonc(options?: OptionsFiles & OptionsOverrides & OptionsStylistic): Promise<Array<TypedFlatConfigItem>>;
|
|
@@ -16050,7 +16066,7 @@ declare function promise(): Promise<Array<TypedFlatConfigItem>>;
|
|
|
16050
16066
|
declare function react(options?: OptionsComponentExtensions & OptionsFiles & OptionsStylistic & OptionsTypeScriptParserOptions & OptionsTypeScriptWithTypes & ReactConfig): Promise<Array<TypedFlatConfigItem>>;
|
|
16051
16067
|
//#endregion
|
|
16052
16068
|
//#region src/configs/roblox.d.ts
|
|
16053
|
-
declare function roblox(options?: OptionsComponentExtensions & OptionsFiles &
|
|
16069
|
+
declare function roblox(options?: OptionsComponentExtensions & OptionsFiles & OptionsOverridesTypeAware & OptionsStylistic & OptionsTypeScriptParserOptions & OptionsTypeScriptWithTypes, formatLua?: boolean): Promise<Array<TypedFlatConfigItem>>;
|
|
16054
16070
|
//#endregion
|
|
16055
16071
|
//#region src/configs/shopify.d.ts
|
|
16056
16072
|
declare function shopify(options?: OptionsStylistic): Promise<Array<TypedFlatConfigItem>>;
|
|
@@ -16095,7 +16111,7 @@ declare function stylistic(options?: StylisticConfig, prettierOptions?: Prettier
|
|
|
16095
16111
|
declare function toml(options?: OptionsFiles & OptionsOverrides & OptionsStylistic): Promise<Array<TypedFlatConfigItem>>;
|
|
16096
16112
|
//#endregion
|
|
16097
16113
|
//#region src/configs/typescript.d.ts
|
|
16098
|
-
declare function typescript(options?: OptionsComponentExtensions & OptionsFiles &
|
|
16114
|
+
declare function typescript(options?: OptionsComponentExtensions & OptionsFiles & OptionsOverridesTypeAware & OptionsStylistic & OptionsTypeScriptErasableOnly & OptionsTypeScriptParserOptions & OptionsTypeScriptWithTypes): Promise<Array<TypedFlatConfigItem>>;
|
|
16099
16115
|
//#endregion
|
|
16100
16116
|
//#region src/configs/unicorn.d.ts
|
|
16101
16117
|
declare function unicorn(options?: OptionsStylistic): Promise<Array<TypedFlatConfigItem>>;
|
|
@@ -16158,4 +16174,4 @@ declare const GLOB_BUILD_TOOLS: string[];
|
|
|
16158
16174
|
declare const GLOB_ALL_SRC: string[];
|
|
16159
16175
|
declare const GLOB_EXCLUDE: string[];
|
|
16160
16176
|
//#endregion
|
|
16161
|
-
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_BLOCKS, 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,
|
|
16177
|
+
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_BLOCKS, 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, OptionsOverridesTypeAware, 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, flawless, 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, sortRojoProject, sortTsconfig, spelling, stylistic, toml, typescript, unicorn, yaml };
|
package/dist/index.js
CHANGED
|
@@ -133,7 +133,7 @@ async function combine(...configs) {
|
|
|
133
133
|
return (await Promise.all(configs)).flat();
|
|
134
134
|
}
|
|
135
135
|
function createTsParser(options) {
|
|
136
|
-
const { componentExtensions = [], configName, files, ignores: ignores$1, parser, parserOptions = {}, tsconfigPath, typeAware } = options;
|
|
136
|
+
const { componentExtensions = [], configName, files, ignores: ignores$1, outOfProjectFiles, parser, parserOptions = {}, parserOptionsNonTypeAware = {}, parserOptionsTypeAware = {}, tsconfigPath, typeAware } = options;
|
|
137
137
|
return {
|
|
138
138
|
files,
|
|
139
139
|
ignores: ignores$1 ?? [],
|
|
@@ -146,7 +146,7 @@ function createTsParser(options) {
|
|
|
146
146
|
useJSXTextNode: true,
|
|
147
147
|
...typeAware ? {
|
|
148
148
|
projectService: {
|
|
149
|
-
allowDefaultProject: [
|
|
149
|
+
allowDefaultProject: outOfProjectFiles ?? [
|
|
150
150
|
"*.js",
|
|
151
151
|
"*.ts",
|
|
152
152
|
".*.js",
|
|
@@ -154,11 +154,13 @@ function createTsParser(options) {
|
|
|
154
154
|
],
|
|
155
155
|
defaultProject: tsconfigPath
|
|
156
156
|
},
|
|
157
|
-
tsconfigRootDir: process.cwd()
|
|
157
|
+
tsconfigRootDir: process.cwd(),
|
|
158
|
+
...parserOptionsTypeAware
|
|
158
159
|
} : {
|
|
159
160
|
program: null,
|
|
160
161
|
project: false,
|
|
161
|
-
projectService: false
|
|
162
|
+
projectService: false,
|
|
163
|
+
...parserOptionsNonTypeAware
|
|
162
164
|
},
|
|
163
165
|
...parserOptions
|
|
164
166
|
}
|
|
@@ -176,7 +178,10 @@ async function ensurePackages(packages) {
|
|
|
176
178
|
}
|
|
177
179
|
function getOverrides(options, key) {
|
|
178
180
|
const sub = resolveSubOptions(options, key);
|
|
179
|
-
return {
|
|
181
|
+
return {
|
|
182
|
+
overrides: { ...typeof sub === "object" && "overrides" in sub ? sub.overrides : {} },
|
|
183
|
+
overridesTypeAware: { ...typeof sub === "object" && "overridesTypeAware" in sub ? sub.overridesTypeAware : {} }
|
|
184
|
+
};
|
|
180
185
|
}
|
|
181
186
|
function getTsConfig(tsconfigPath) {
|
|
182
187
|
if (tsconfigPath !== void 0) return tsconfigPath;
|
|
@@ -4779,7 +4784,8 @@ const defaultPluginRenaming = {
|
|
|
4779
4784
|
* @returns A promise that resolves to an array of user configuration items.
|
|
4780
4785
|
*/
|
|
4781
4786
|
async function isentinel(options = {}, ...userConfigs) {
|
|
4782
|
-
const { autoRenamePlugins = true, componentExts: componentExtensions = [], eslintPlugin: enableEslintPlugin = false, formatters, gitignore: enableGitignore = true, jsdoc: enableJsdoc = true, jsx: enableJsx = true, pnpm: enableCatalogs = false, react: enableReact = false,
|
|
4787
|
+
const { autoRenamePlugins = true, componentExts: componentExtensions = [], eslintPlugin: enableEslintPlugin = false, formatters, gitignore: enableGitignore = true, jsdoc: enableJsdoc = true, jsx: enableJsx = true, pnpm: enableCatalogs = false, react: enableReact = false, spellCheck: enableSpellCheck, typescript: enableTypeScript } = options;
|
|
4788
|
+
const enableRoblox = options.roblox !== false;
|
|
4783
4789
|
let { isInEditor } = options;
|
|
4784
4790
|
if (isInEditor === void 0) {
|
|
4785
4791
|
isInEditor = isInEditorEnvironment();
|
|
@@ -4819,31 +4825,32 @@ async function isentinel(options = {}, ...userConfigs) {
|
|
|
4819
4825
|
stylistic: stylisticOptions,
|
|
4820
4826
|
type: options.type
|
|
4821
4827
|
}), packageJson({
|
|
4822
|
-
roblox:
|
|
4828
|
+
roblox: enableRoblox,
|
|
4823
4829
|
type: options.type
|
|
4824
4830
|
}), javascript({
|
|
4831
|
+
...getOverrides(options, "javascript"),
|
|
4825
4832
|
isInEditor,
|
|
4826
|
-
|
|
4827
|
-
roblox: options.roblox,
|
|
4833
|
+
roblox: enableRoblox,
|
|
4828
4834
|
stylistic: stylisticOptions
|
|
4829
4835
|
}), promise(), shopify({ stylistic: stylisticOptions }), sonarjs({ isInEditor }), typescript({
|
|
4830
4836
|
...resolveSubOptions(options, "typescript"),
|
|
4837
|
+
...getOverrides(options, "typescript"),
|
|
4831
4838
|
componentExts: componentExtensions,
|
|
4832
|
-
overrides: getOverrides(options, "typescript"),
|
|
4833
4839
|
stylistic: stylisticOptions
|
|
4834
4840
|
}), unicorn({ stylistic: stylisticOptions }));
|
|
4835
|
-
if (options.flawless === true) configs.push(flawless());
|
|
4841
|
+
if (options.flawless === true) configs.push(flawless({ ...getOverrides(options, "flawless") }));
|
|
4836
4842
|
if (enableJsdoc !== false) configs.push(jsdoc({
|
|
4837
4843
|
stylistic: stylisticOptions,
|
|
4838
4844
|
type: options.type
|
|
4839
4845
|
}));
|
|
4840
|
-
if (options.type === "package" &&
|
|
4846
|
+
if (options.type === "package" && !enableRoblox) configs.push(node());
|
|
4841
4847
|
if (enableJsx) configs.push(jsx());
|
|
4842
|
-
if (enableEslintPlugin !== false) configs.push(eslintPlugin({
|
|
4848
|
+
if (enableEslintPlugin !== false) configs.push(eslintPlugin({ ...getOverrides(options, "eslintPlugin") }));
|
|
4843
4849
|
if (enableRoblox) {
|
|
4844
4850
|
const shouldFormatLua = shouldEnableFeature(formatters, "lua");
|
|
4845
4851
|
configs.push(roblox({
|
|
4846
4852
|
...resolveSubOptions(options, "typescript"),
|
|
4853
|
+
...getOverrides(options, "roblox"),
|
|
4847
4854
|
componentExts: componentExtensions,
|
|
4848
4855
|
stylistic: stylisticOptions
|
|
4849
4856
|
}, shouldFormatLua));
|
|
@@ -4855,20 +4862,20 @@ async function isentinel(options = {}, ...userConfigs) {
|
|
|
4855
4862
|
if (options.test !== void 0 && options.test !== false) {
|
|
4856
4863
|
const testOptions = typeof options.test === "object" ? options.test : {};
|
|
4857
4864
|
configs.push(test({
|
|
4865
|
+
...getOverrides(options, "test"),
|
|
4858
4866
|
isInEditor,
|
|
4859
|
-
|
|
4860
|
-
roblox: options.roblox,
|
|
4867
|
+
roblox: enableRoblox,
|
|
4861
4868
|
type: options.type,
|
|
4862
4869
|
...testOptions
|
|
4863
4870
|
}));
|
|
4864
4871
|
}
|
|
4865
4872
|
if (enableReact !== false) configs.push(react({
|
|
4866
4873
|
...resolveSubOptions(options, "react"),
|
|
4867
|
-
|
|
4874
|
+
...getOverrides(options, "react")
|
|
4868
4875
|
}));
|
|
4869
4876
|
if (options.jsonc !== false) {
|
|
4870
4877
|
configs.push(jsonc({
|
|
4871
|
-
|
|
4878
|
+
...getOverrides(options, "jsonc"),
|
|
4872
4879
|
stylistic: stylisticOptions
|
|
4873
4880
|
}));
|
|
4874
4881
|
if (stylisticOptions !== false) configs.push(sortTsconfig());
|
|
@@ -4877,18 +4884,18 @@ async function isentinel(options = {}, ...userConfigs) {
|
|
|
4877
4884
|
if (enableCatalogs) configs.push(pnpm());
|
|
4878
4885
|
if (options.yaml !== false) {
|
|
4879
4886
|
configs.push(yaml({
|
|
4880
|
-
|
|
4887
|
+
...getOverrides(options, "yaml"),
|
|
4881
4888
|
stylistic: stylisticOptions
|
|
4882
4889
|
}));
|
|
4883
4890
|
if (stylisticOptions !== false) configs.push(sortGithubAction());
|
|
4884
4891
|
}
|
|
4885
4892
|
if (options.toml !== false) configs.push(toml({
|
|
4886
|
-
|
|
4893
|
+
...getOverrides(options, "toml"),
|
|
4887
4894
|
stylistic: stylisticOptions
|
|
4888
4895
|
}));
|
|
4889
4896
|
if (options.markdown !== false) configs.push(markdown({
|
|
4897
|
+
...getOverrides(options, "markdown"),
|
|
4890
4898
|
componentExts: componentExtensions,
|
|
4891
|
-
overrides: getOverrides(options, "markdown"),
|
|
4892
4899
|
type: options.type
|
|
4893
4900
|
}));
|
|
4894
4901
|
if (enableSpellCheck !== false) configs.push(spelling({
|
|
@@ -4899,9 +4906,9 @@ async function isentinel(options = {}, ...userConfigs) {
|
|
|
4899
4906
|
configs.push(disables());
|
|
4900
4907
|
if (stylisticOptions !== false) configs.push(prettier({
|
|
4901
4908
|
...resolveWithDefaults(enableTypeScript, {}),
|
|
4909
|
+
...getOverrides(options, "typescript"),
|
|
4902
4910
|
componentExts: componentExtensions,
|
|
4903
4911
|
formatters: formatters !== false ? formatters : void 0,
|
|
4904
|
-
overrides: getOverrides(options, "typescript"),
|
|
4905
4912
|
prettierOptions: prettierSettings,
|
|
4906
4913
|
stylistic: stylisticOptions
|
|
4907
4914
|
}));
|
|
@@ -4980,10 +4987,7 @@ async function prettier(options) {
|
|
|
4980
4987
|
rules: {
|
|
4981
4988
|
...rules,
|
|
4982
4989
|
"arrow-body-style": "off",
|
|
4983
|
-
"format/prettier": ["error", mergePrettierOptions(prettierOptions, {
|
|
4984
|
-
parser: "oxc-ts",
|
|
4985
|
-
plugins: [require$1.resolve("@prettier/plugin-oxc")]
|
|
4986
|
-
})],
|
|
4990
|
+
"format/prettier": ["error", mergePrettierOptions(prettierOptions, {})],
|
|
4987
4991
|
"prefer-arrow-callback": "off"
|
|
4988
4992
|
}
|
|
4989
4993
|
});
|
|
@@ -5073,7 +5077,7 @@ async function promise() {
|
|
|
5073
5077
|
//#endregion
|
|
5074
5078
|
//#region src/configs/react.ts
|
|
5075
5079
|
async function react(options = {}) {
|
|
5076
|
-
const { additionalComponents, additionalHooks, filenameCase = "kebabCase", files = [GLOB_JSX, GLOB_TSX], filesTypeAware = [GLOB_TSX], ignoresTypeAware = [`${GLOB_MARKDOWN}/**`], importSource, jsxPragma, overrides = {}, skipImportCheck, stylistic: stylistic$1 = true, typeAware = true } = options;
|
|
5080
|
+
const { additionalComponents, additionalHooks, filenameCase = "kebabCase", files = [GLOB_JSX, GLOB_TSX], filesTypeAware = [GLOB_TSX], ignoresTypeAware = [`${GLOB_MARKDOWN}/**`], importSource, jsxPragma, overrides = {}, overridesTypeAware, skipImportCheck, stylistic: stylistic$1 = true, typeAware = true } = options;
|
|
5077
5081
|
await ensurePackages(["@eslint-react/eslint-plugin", "eslint-plugin-react-roblox-hooks"]);
|
|
5078
5082
|
const [pluginReact, pluginReactHooks, pluginStylistic, pluginTs, pluginUnicorn, pluginUnusedImports] = await Promise.all([
|
|
5079
5083
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
@@ -5214,7 +5218,10 @@ async function react(options = {}) {
|
|
|
5214
5218
|
files: filesTypeAware,
|
|
5215
5219
|
ignores: ignoresTypeAware,
|
|
5216
5220
|
name: "isentinel/react/type-aware-rules",
|
|
5217
|
-
rules: {
|
|
5221
|
+
rules: {
|
|
5222
|
+
...typeAwareRules,
|
|
5223
|
+
...overridesTypeAware
|
|
5224
|
+
}
|
|
5218
5225
|
}] : []
|
|
5219
5226
|
];
|
|
5220
5227
|
}
|
|
@@ -5303,7 +5310,7 @@ async function roblox(options = {}, formatLua = true) {
|
|
|
5303
5310
|
}] : []
|
|
5304
5311
|
];
|
|
5305
5312
|
if (formatLua) {
|
|
5306
|
-
const
|
|
5313
|
+
const pluginFormatLua = await interopDefault(import("eslint-plugin-format-lua"));
|
|
5307
5314
|
configs.push({
|
|
5308
5315
|
name: "isentinel/roblox/format-lua/setup",
|
|
5309
5316
|
plugins: { "format-lua": pluginFormatLua }
|
|
@@ -6026,7 +6033,7 @@ async function toml(options = {}) {
|
|
|
6026
6033
|
//#endregion
|
|
6027
6034
|
//#region src/configs/typescript.ts
|
|
6028
6035
|
async function typescript(options = {}) {
|
|
6029
|
-
const { componentExts: componentExtensions = [], erasableOnly = false, overrides = {}, overridesTypeAware = {}, parserOptions = {}, stylistic: stylistic$1 = true, typeAware = true } = options;
|
|
6036
|
+
const { componentExts: componentExtensions = [], erasableOnly = false, outOfProjectFiles, overrides = {}, overridesTypeAware = {}, parserOptions = {}, parserOptionsNonTypeAware = {}, parserOptionsTypeAware = {}, stylistic: stylistic$1 = true, typeAware = true } = options;
|
|
6030
6037
|
const files = options.files ?? [
|
|
6031
6038
|
GLOB_TS,
|
|
6032
6039
|
GLOB_TSX,
|
|
@@ -6116,8 +6123,11 @@ async function typescript(options = {}) {
|
|
|
6116
6123
|
configName: "typescript",
|
|
6117
6124
|
files: parserFiles,
|
|
6118
6125
|
ignores: ignores$1,
|
|
6126
|
+
outOfProjectFiles,
|
|
6119
6127
|
parser: parserTs,
|
|
6120
6128
|
parserOptions,
|
|
6129
|
+
parserOptionsNonTypeAware,
|
|
6130
|
+
parserOptionsTypeAware,
|
|
6121
6131
|
tsconfigPath,
|
|
6122
6132
|
typeAware: usesTypeInformation
|
|
6123
6133
|
});
|
|
@@ -6268,6 +6278,7 @@ async function unicorn(options = {}) {
|
|
|
6268
6278
|
"unicorn/no-negated-condition": "off",
|
|
6269
6279
|
"unicorn/no-negation-in-equality-check": "error",
|
|
6270
6280
|
"unicorn/no-object-as-default-parameter": "error",
|
|
6281
|
+
"unicorn/no-single-promise-in-promise-methods": "error",
|
|
6271
6282
|
"unicorn/no-static-only-class": "error",
|
|
6272
6283
|
"unicorn/no-unreadable-array-destructuring": "error",
|
|
6273
6284
|
"unicorn/no-unused-properties": "error",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isentinel/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "iSentinel's ESLint config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint-config",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"tsdown": "0.14.2",
|
|
120
120
|
"type-fest": "4.41.0",
|
|
121
121
|
"typescript": "5.9.2",
|
|
122
|
-
"@isentinel/eslint-config": "3.
|
|
122
|
+
"@isentinel/eslint-config": "3.2.0"
|
|
123
123
|
},
|
|
124
124
|
"peerDependencies": {
|
|
125
125
|
"@eslint-react/eslint-plugin": "^1.45.0",
|