@isentinel/eslint-config 3.1.2 → 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 +45 -28
- package/dist/index.js +43 -31
- 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>>;
|
|
@@ -16147,6 +16163,7 @@ declare const GLOB_ALL_JSON = "**/*.json?(5|c)";
|
|
|
16147
16163
|
declare const GLOB_MARKDOWN = "**/*.md";
|
|
16148
16164
|
declare const GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
|
|
16149
16165
|
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
16166
|
+
declare const GLOB_MARKDOWN_BLOCKS = "**/*.md/**/*.{?([cm])[jt]s?(x),json,json5,jsonc,y?(a)ml,{c,le,sc}ss,htm?(l),toml,{g,graph}ql,lua?(u)}";
|
|
16150
16167
|
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
16151
16168
|
declare const GLOB_TOML = "**/*.toml";
|
|
16152
16169
|
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
@@ -16157,4 +16174,4 @@ declare const GLOB_BUILD_TOOLS: string[];
|
|
|
16157
16174
|
declare const GLOB_ALL_SRC: string[];
|
|
16158
16175
|
declare const GLOB_EXCLUDE: string[];
|
|
16159
16176
|
//#endregion
|
|
16160
|
-
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,
|
|
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
|
@@ -32,6 +32,7 @@ const GLOB_ALL_JSON = "**/*.json?(5|c)";
|
|
|
32
32
|
const GLOB_MARKDOWN = "**/*.md";
|
|
33
33
|
const GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
|
|
34
34
|
const GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
35
|
+
const GLOB_MARKDOWN_BLOCKS = `${GLOB_MARKDOWN}/**/*.{${GLOB_SRC_EXT},json,json5,jsonc,y?(a)ml,{c,le,sc}ss,htm?(l),toml,{g,graph}ql,lua?(u)}`;
|
|
35
36
|
const GLOB_YAML = "**/*.y?(a)ml";
|
|
36
37
|
const GLOB_TOML = "**/*.toml";
|
|
37
38
|
const GLOB_HTML = "**/*.htm?(l)";
|
|
@@ -132,7 +133,7 @@ async function combine(...configs) {
|
|
|
132
133
|
return (await Promise.all(configs)).flat();
|
|
133
134
|
}
|
|
134
135
|
function createTsParser(options) {
|
|
135
|
-
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;
|
|
136
137
|
return {
|
|
137
138
|
files,
|
|
138
139
|
ignores: ignores$1 ?? [],
|
|
@@ -145,7 +146,7 @@ function createTsParser(options) {
|
|
|
145
146
|
useJSXTextNode: true,
|
|
146
147
|
...typeAware ? {
|
|
147
148
|
projectService: {
|
|
148
|
-
allowDefaultProject: [
|
|
149
|
+
allowDefaultProject: outOfProjectFiles ?? [
|
|
149
150
|
"*.js",
|
|
150
151
|
"*.ts",
|
|
151
152
|
".*.js",
|
|
@@ -153,11 +154,13 @@ function createTsParser(options) {
|
|
|
153
154
|
],
|
|
154
155
|
defaultProject: tsconfigPath
|
|
155
156
|
},
|
|
156
|
-
tsconfigRootDir: process.cwd()
|
|
157
|
+
tsconfigRootDir: process.cwd(),
|
|
158
|
+
...parserOptionsTypeAware
|
|
157
159
|
} : {
|
|
158
160
|
program: null,
|
|
159
161
|
project: false,
|
|
160
|
-
projectService: false
|
|
162
|
+
projectService: false,
|
|
163
|
+
...parserOptionsNonTypeAware
|
|
161
164
|
},
|
|
162
165
|
...parserOptions
|
|
163
166
|
}
|
|
@@ -175,7 +178,10 @@ async function ensurePackages(packages) {
|
|
|
175
178
|
}
|
|
176
179
|
function getOverrides(options, key) {
|
|
177
180
|
const sub = resolveSubOptions(options, key);
|
|
178
|
-
return {
|
|
181
|
+
return {
|
|
182
|
+
overrides: { ...typeof sub === "object" && "overrides" in sub ? sub.overrides : {} },
|
|
183
|
+
overridesTypeAware: { ...typeof sub === "object" && "overridesTypeAware" in sub ? sub.overridesTypeAware : {} }
|
|
184
|
+
};
|
|
179
185
|
}
|
|
180
186
|
function getTsConfig(tsconfigPath) {
|
|
181
187
|
if (tsconfigPath !== void 0) return tsconfigPath;
|
|
@@ -4306,7 +4312,7 @@ async function markdown(options = {}) {
|
|
|
4306
4312
|
}
|
|
4307
4313
|
},
|
|
4308
4314
|
{
|
|
4309
|
-
files: [
|
|
4315
|
+
files: [GLOB_MARKDOWN_BLOCKS, ...componentExtensions.map((extension) => `${GLOB_MARKDOWN}/**/*.${extension}`)],
|
|
4310
4316
|
languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
|
|
4311
4317
|
name: "isentinel/markdown/disables",
|
|
4312
4318
|
rules: {
|
|
@@ -4778,7 +4784,8 @@ const defaultPluginRenaming = {
|
|
|
4778
4784
|
* @returns A promise that resolves to an array of user configuration items.
|
|
4779
4785
|
*/
|
|
4780
4786
|
async function isentinel(options = {}, ...userConfigs) {
|
|
4781
|
-
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;
|
|
4782
4789
|
let { isInEditor } = options;
|
|
4783
4790
|
if (isInEditor === void 0) {
|
|
4784
4791
|
isInEditor = isInEditorEnvironment();
|
|
@@ -4818,31 +4825,32 @@ async function isentinel(options = {}, ...userConfigs) {
|
|
|
4818
4825
|
stylistic: stylisticOptions,
|
|
4819
4826
|
type: options.type
|
|
4820
4827
|
}), packageJson({
|
|
4821
|
-
roblox:
|
|
4828
|
+
roblox: enableRoblox,
|
|
4822
4829
|
type: options.type
|
|
4823
4830
|
}), javascript({
|
|
4831
|
+
...getOverrides(options, "javascript"),
|
|
4824
4832
|
isInEditor,
|
|
4825
|
-
|
|
4826
|
-
roblox: options.roblox,
|
|
4833
|
+
roblox: enableRoblox,
|
|
4827
4834
|
stylistic: stylisticOptions
|
|
4828
4835
|
}), promise(), shopify({ stylistic: stylisticOptions }), sonarjs({ isInEditor }), typescript({
|
|
4829
4836
|
...resolveSubOptions(options, "typescript"),
|
|
4837
|
+
...getOverrides(options, "typescript"),
|
|
4830
4838
|
componentExts: componentExtensions,
|
|
4831
|
-
overrides: getOverrides(options, "typescript"),
|
|
4832
4839
|
stylistic: stylisticOptions
|
|
4833
4840
|
}), unicorn({ stylistic: stylisticOptions }));
|
|
4834
|
-
if (options.flawless === true) configs.push(flawless());
|
|
4841
|
+
if (options.flawless === true) configs.push(flawless({ ...getOverrides(options, "flawless") }));
|
|
4835
4842
|
if (enableJsdoc !== false) configs.push(jsdoc({
|
|
4836
4843
|
stylistic: stylisticOptions,
|
|
4837
4844
|
type: options.type
|
|
4838
4845
|
}));
|
|
4839
|
-
if (options.type === "package" &&
|
|
4846
|
+
if (options.type === "package" && !enableRoblox) configs.push(node());
|
|
4840
4847
|
if (enableJsx) configs.push(jsx());
|
|
4841
|
-
if (enableEslintPlugin !== false) configs.push(eslintPlugin({
|
|
4848
|
+
if (enableEslintPlugin !== false) configs.push(eslintPlugin({ ...getOverrides(options, "eslintPlugin") }));
|
|
4842
4849
|
if (enableRoblox) {
|
|
4843
4850
|
const shouldFormatLua = shouldEnableFeature(formatters, "lua");
|
|
4844
4851
|
configs.push(roblox({
|
|
4845
4852
|
...resolveSubOptions(options, "typescript"),
|
|
4853
|
+
...getOverrides(options, "roblox"),
|
|
4846
4854
|
componentExts: componentExtensions,
|
|
4847
4855
|
stylistic: stylisticOptions
|
|
4848
4856
|
}, shouldFormatLua));
|
|
@@ -4854,20 +4862,20 @@ async function isentinel(options = {}, ...userConfigs) {
|
|
|
4854
4862
|
if (options.test !== void 0 && options.test !== false) {
|
|
4855
4863
|
const testOptions = typeof options.test === "object" ? options.test : {};
|
|
4856
4864
|
configs.push(test({
|
|
4865
|
+
...getOverrides(options, "test"),
|
|
4857
4866
|
isInEditor,
|
|
4858
|
-
|
|
4859
|
-
roblox: options.roblox,
|
|
4867
|
+
roblox: enableRoblox,
|
|
4860
4868
|
type: options.type,
|
|
4861
4869
|
...testOptions
|
|
4862
4870
|
}));
|
|
4863
4871
|
}
|
|
4864
4872
|
if (enableReact !== false) configs.push(react({
|
|
4865
4873
|
...resolveSubOptions(options, "react"),
|
|
4866
|
-
|
|
4874
|
+
...getOverrides(options, "react")
|
|
4867
4875
|
}));
|
|
4868
4876
|
if (options.jsonc !== false) {
|
|
4869
4877
|
configs.push(jsonc({
|
|
4870
|
-
|
|
4878
|
+
...getOverrides(options, "jsonc"),
|
|
4871
4879
|
stylistic: stylisticOptions
|
|
4872
4880
|
}));
|
|
4873
4881
|
if (stylisticOptions !== false) configs.push(sortTsconfig());
|
|
@@ -4876,18 +4884,18 @@ async function isentinel(options = {}, ...userConfigs) {
|
|
|
4876
4884
|
if (enableCatalogs) configs.push(pnpm());
|
|
4877
4885
|
if (options.yaml !== false) {
|
|
4878
4886
|
configs.push(yaml({
|
|
4879
|
-
|
|
4887
|
+
...getOverrides(options, "yaml"),
|
|
4880
4888
|
stylistic: stylisticOptions
|
|
4881
4889
|
}));
|
|
4882
4890
|
if (stylisticOptions !== false) configs.push(sortGithubAction());
|
|
4883
4891
|
}
|
|
4884
4892
|
if (options.toml !== false) configs.push(toml({
|
|
4885
|
-
|
|
4893
|
+
...getOverrides(options, "toml"),
|
|
4886
4894
|
stylistic: stylisticOptions
|
|
4887
4895
|
}));
|
|
4888
4896
|
if (options.markdown !== false) configs.push(markdown({
|
|
4897
|
+
...getOverrides(options, "markdown"),
|
|
4889
4898
|
componentExts: componentExtensions,
|
|
4890
|
-
overrides: getOverrides(options, "markdown"),
|
|
4891
4899
|
type: options.type
|
|
4892
4900
|
}));
|
|
4893
4901
|
if (enableSpellCheck !== false) configs.push(spelling({
|
|
@@ -4898,9 +4906,9 @@ async function isentinel(options = {}, ...userConfigs) {
|
|
|
4898
4906
|
configs.push(disables());
|
|
4899
4907
|
if (stylisticOptions !== false) configs.push(prettier({
|
|
4900
4908
|
...resolveWithDefaults(enableTypeScript, {}),
|
|
4909
|
+
...getOverrides(options, "typescript"),
|
|
4901
4910
|
componentExts: componentExtensions,
|
|
4902
4911
|
formatters: formatters !== false ? formatters : void 0,
|
|
4903
|
-
overrides: getOverrides(options, "typescript"),
|
|
4904
4912
|
prettierOptions: prettierSettings,
|
|
4905
4913
|
stylistic: stylisticOptions
|
|
4906
4914
|
}));
|
|
@@ -4979,10 +4987,7 @@ async function prettier(options) {
|
|
|
4979
4987
|
rules: {
|
|
4980
4988
|
...rules,
|
|
4981
4989
|
"arrow-body-style": "off",
|
|
4982
|
-
"format/prettier": ["error", mergePrettierOptions(prettierOptions, {
|
|
4983
|
-
parser: "oxc-ts",
|
|
4984
|
-
plugins: [require$1.resolve("@prettier/plugin-oxc")]
|
|
4985
|
-
})],
|
|
4990
|
+
"format/prettier": ["error", mergePrettierOptions(prettierOptions, {})],
|
|
4986
4991
|
"prefer-arrow-callback": "off"
|
|
4987
4992
|
}
|
|
4988
4993
|
});
|
|
@@ -5072,7 +5077,7 @@ async function promise() {
|
|
|
5072
5077
|
//#endregion
|
|
5073
5078
|
//#region src/configs/react.ts
|
|
5074
5079
|
async function react(options = {}) {
|
|
5075
|
-
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;
|
|
5076
5081
|
await ensurePackages(["@eslint-react/eslint-plugin", "eslint-plugin-react-roblox-hooks"]);
|
|
5077
5082
|
const [pluginReact, pluginReactHooks, pluginStylistic, pluginTs, pluginUnicorn, pluginUnusedImports] = await Promise.all([
|
|
5078
5083
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
@@ -5213,7 +5218,10 @@ async function react(options = {}) {
|
|
|
5213
5218
|
files: filesTypeAware,
|
|
5214
5219
|
ignores: ignoresTypeAware,
|
|
5215
5220
|
name: "isentinel/react/type-aware-rules",
|
|
5216
|
-
rules: {
|
|
5221
|
+
rules: {
|
|
5222
|
+
...typeAwareRules,
|
|
5223
|
+
...overridesTypeAware
|
|
5224
|
+
}
|
|
5217
5225
|
}] : []
|
|
5218
5226
|
];
|
|
5219
5227
|
}
|
|
@@ -5302,7 +5310,7 @@ async function roblox(options = {}, formatLua = true) {
|
|
|
5302
5310
|
}] : []
|
|
5303
5311
|
];
|
|
5304
5312
|
if (formatLua) {
|
|
5305
|
-
const
|
|
5313
|
+
const pluginFormatLua = await interopDefault(import("eslint-plugin-format-lua"));
|
|
5306
5314
|
configs.push({
|
|
5307
5315
|
name: "isentinel/roblox/format-lua/setup",
|
|
5308
5316
|
plugins: { "format-lua": pluginFormatLua }
|
|
@@ -6025,7 +6033,7 @@ async function toml(options = {}) {
|
|
|
6025
6033
|
//#endregion
|
|
6026
6034
|
//#region src/configs/typescript.ts
|
|
6027
6035
|
async function typescript(options = {}) {
|
|
6028
|
-
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;
|
|
6029
6037
|
const files = options.files ?? [
|
|
6030
6038
|
GLOB_TS,
|
|
6031
6039
|
GLOB_TSX,
|
|
@@ -6115,8 +6123,11 @@ async function typescript(options = {}) {
|
|
|
6115
6123
|
configName: "typescript",
|
|
6116
6124
|
files: parserFiles,
|
|
6117
6125
|
ignores: ignores$1,
|
|
6126
|
+
outOfProjectFiles,
|
|
6118
6127
|
parser: parserTs,
|
|
6119
6128
|
parserOptions,
|
|
6129
|
+
parserOptionsNonTypeAware,
|
|
6130
|
+
parserOptionsTypeAware,
|
|
6120
6131
|
tsconfigPath,
|
|
6121
6132
|
typeAware: usesTypeInformation
|
|
6122
6133
|
});
|
|
@@ -6267,6 +6278,7 @@ async function unicorn(options = {}) {
|
|
|
6267
6278
|
"unicorn/no-negated-condition": "off",
|
|
6268
6279
|
"unicorn/no-negation-in-equality-check": "error",
|
|
6269
6280
|
"unicorn/no-object-as-default-parameter": "error",
|
|
6281
|
+
"unicorn/no-single-promise-in-promise-methods": "error",
|
|
6270
6282
|
"unicorn/no-static-only-class": "error",
|
|
6271
6283
|
"unicorn/no-unreadable-array-destructuring": "error",
|
|
6272
6284
|
"unicorn/no-unused-properties": "error",
|
|
@@ -6349,4 +6361,4 @@ async function yaml(options = {}) {
|
|
|
6349
6361
|
}
|
|
6350
6362
|
|
|
6351
6363
|
//#endregion
|
|
6352
|
-
export { 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, StylisticConfigDefaults, 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$1 as require, resolvePrettierConfigOptions, resolveSubOptions, resolveWithDefaults, roblox, shopify, shouldEnableFeature, sonarjs, sortGithubAction, sortRojoProject, sortTsconfig, spelling, stylistic, toml, typescript, unicorn, yaml };
|
|
6364
|
+
export { 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, StylisticConfigDefaults, 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$1 as require, resolvePrettierConfigOptions, resolveSubOptions, resolveWithDefaults, roblox, shopify, shouldEnableFeature, sonarjs, sortGithubAction, sortRojoProject, sortTsconfig, spelling, stylistic, toml, typescript, unicorn, yaml };
|
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",
|