@ghettoddos/eslint-config 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +112 -5
- package/dist/index.js +127 -13
- package/package.json +7 -1
package/dist/index.d.ts
CHANGED
|
@@ -117,6 +117,41 @@ interface RuleOptions {
|
|
|
117
117
|
* @deprecated
|
|
118
118
|
*/
|
|
119
119
|
'block-spacing'?: Linter.RuleEntry<BlockSpacing>;
|
|
120
|
+
/**
|
|
121
|
+
* Check allowed dependencies between element types
|
|
122
|
+
* @see https://github.com/javierbrea/eslint-plugin-boundaries/blob/master/docs/rules/element-types.md
|
|
123
|
+
*/
|
|
124
|
+
'boundaries/element-types'?: Linter.RuleEntry<BoundariesElementTypes>;
|
|
125
|
+
/**
|
|
126
|
+
* Check entry point used for each element type
|
|
127
|
+
* @see https://github.com/javierbrea/eslint-plugin-boundaries/blob/master/docs/rules/entry-point.md
|
|
128
|
+
*/
|
|
129
|
+
'boundaries/entry-point'?: Linter.RuleEntry<BoundariesEntryPoint>;
|
|
130
|
+
/**
|
|
131
|
+
* Check allowed external dependencies by element type
|
|
132
|
+
* @see https://github.com/javierbrea/eslint-plugin-boundaries/blob/master/docs/rules/external.md
|
|
133
|
+
*/
|
|
134
|
+
'boundaries/external'?: Linter.RuleEntry<BoundariesExternal>;
|
|
135
|
+
/**
|
|
136
|
+
* Prevent importing ignored files from recognized elements
|
|
137
|
+
* @see https://github.com/javierbrea/eslint-plugin-boundaries/blob/master/docs/rules/no-ignored.md
|
|
138
|
+
*/
|
|
139
|
+
'boundaries/no-ignored'?: Linter.RuleEntry<[]>;
|
|
140
|
+
/**
|
|
141
|
+
* Prevent importing private elements of another element
|
|
142
|
+
* @see https://github.com/javierbrea/eslint-plugin-boundaries/blob/master/docs/rules/no-private.md
|
|
143
|
+
*/
|
|
144
|
+
'boundaries/no-private'?: Linter.RuleEntry<BoundariesNoPrivate>;
|
|
145
|
+
/**
|
|
146
|
+
* Prevent importing unknown elements from the known ones
|
|
147
|
+
* @see https://github.com/javierbrea/eslint-plugin-boundaries/blob/master/docs/rules/no-unknown.md
|
|
148
|
+
*/
|
|
149
|
+
'boundaries/no-unknown'?: Linter.RuleEntry<[]>;
|
|
150
|
+
/**
|
|
151
|
+
* Prevent creating files not recognized as any of the element types
|
|
152
|
+
* @see https://github.com/javierbrea/eslint-plugin-boundaries/blob/master/docs/rules/no-unknown-files.md
|
|
153
|
+
*/
|
|
154
|
+
'boundaries/no-unknown-files'?: Linter.RuleEntry<[]>;
|
|
120
155
|
/**
|
|
121
156
|
* Enforce consistent brace style for blocks
|
|
122
157
|
* @see https://eslint.org/docs/latest/rules/brace-style
|
|
@@ -5966,6 +6001,47 @@ type ArrowSpacing = [] | [{
|
|
|
5966
6001
|
}];
|
|
5967
6002
|
// ----- block-spacing -----
|
|
5968
6003
|
type BlockSpacing = [] | [("always" | "never")];
|
|
6004
|
+
// ----- boundaries/element-types -----
|
|
6005
|
+
type BoundariesElementTypes = [] | [{
|
|
6006
|
+
message?: string;
|
|
6007
|
+
default?: ("allow" | "disallow");
|
|
6008
|
+
rules?: ({
|
|
6009
|
+
[k: string]: unknown | undefined;
|
|
6010
|
+
} | {
|
|
6011
|
+
[k: string]: unknown | undefined;
|
|
6012
|
+
} | {
|
|
6013
|
+
[k: string]: unknown | undefined;
|
|
6014
|
+
})[];
|
|
6015
|
+
}];
|
|
6016
|
+
// ----- boundaries/entry-point -----
|
|
6017
|
+
type BoundariesEntryPoint = [] | [{
|
|
6018
|
+
message?: string;
|
|
6019
|
+
default?: ("allow" | "disallow");
|
|
6020
|
+
rules?: ({
|
|
6021
|
+
[k: string]: unknown | undefined;
|
|
6022
|
+
} | {
|
|
6023
|
+
[k: string]: unknown | undefined;
|
|
6024
|
+
} | {
|
|
6025
|
+
[k: string]: unknown | undefined;
|
|
6026
|
+
})[];
|
|
6027
|
+
}];
|
|
6028
|
+
// ----- boundaries/external -----
|
|
6029
|
+
type BoundariesExternal = [] | [{
|
|
6030
|
+
message?: string;
|
|
6031
|
+
default?: ("allow" | "disallow");
|
|
6032
|
+
rules?: ({
|
|
6033
|
+
[k: string]: unknown | undefined;
|
|
6034
|
+
} | {
|
|
6035
|
+
[k: string]: unknown | undefined;
|
|
6036
|
+
} | {
|
|
6037
|
+
[k: string]: unknown | undefined;
|
|
6038
|
+
})[];
|
|
6039
|
+
}];
|
|
6040
|
+
// ----- boundaries/no-private -----
|
|
6041
|
+
type BoundariesNoPrivate = [] | [{
|
|
6042
|
+
allowUncles?: boolean;
|
|
6043
|
+
message?: string;
|
|
6044
|
+
}];
|
|
5969
6045
|
// ----- brace-style -----
|
|
5970
6046
|
type BraceStyle = [] | [("1tbs" | "stroustrup" | "allman")] | [("1tbs" | "stroustrup" | "allman"), {
|
|
5971
6047
|
allowSingleLine?: boolean;
|
|
@@ -12893,7 +12969,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
12893
12969
|
onlyEquality?: boolean;
|
|
12894
12970
|
}];
|
|
12895
12971
|
// Names of all the configs
|
|
12896
|
-
type ConfigNames = 'eslint-comments/rules' | 'formatter/setup' | 'imports/rules' | 'javascript/setup' | 'javascript/rules' | 'jsx/setup' | 'jsonc/setup' | 'jsonc/rules' | 'markdown/setup' | 'markdown/processor' | 'markdown/parser' | 'markdown/disables' | 'node/rules' | 'perfectionist/setup' | 'pnpm/package-json' | 'pnpm/pnpm-workspace-yaml' | 'react/setup' | 'react/rules' | 'sort/package-json' | 'stylistic/rules' | 'toml/setup' | 'toml/rules' | 'regexp/rules' | 'typescript/setup' | 'typescript/parser' | 'typescript/rules' | 'unicorn/rules' | 'unocss' | 'yaml/setup' | 'yaml/rules' | 'yaml/pnpm-workspace' | 'next/rules' | 'jsx-a11y/rules' | 'effector/setup' | 'effector/rules';
|
|
12972
|
+
type ConfigNames = 'eslint-comments/rules' | 'formatter/setup' | 'imports/rules' | 'javascript/setup' | 'javascript/rules' | 'jsx/setup' | 'jsonc/setup' | 'jsonc/rules' | 'markdown/setup' | 'markdown/processor' | 'markdown/parser' | 'markdown/disables' | 'node/rules' | 'perfectionist/setup' | 'pnpm/package-json' | 'pnpm/pnpm-workspace-yaml' | 'react/setup' | 'react/rules' | 'sort/package-json' | 'stylistic/rules' | 'toml/setup' | 'toml/rules' | 'regexp/rules' | 'typescript/setup' | 'typescript/parser' | 'typescript/rules' | 'unicorn/rules' | 'unocss' | 'yaml/setup' | 'yaml/rules' | 'yaml/pnpm-workspace' | 'next/rules' | 'jsx-a11y/rules' | 'effector/setup' | 'effector/rules' | 'fsd/setup' | 'fsd/public-api' | 'fsd/layers-slices';
|
|
12897
12973
|
//#endregion
|
|
12898
12974
|
//#region src/vendor/prettier-types.d.ts
|
|
12899
12975
|
/**
|
|
@@ -13180,6 +13256,27 @@ interface OptionsUnoCSS extends OptionsOverrides {
|
|
|
13180
13256
|
*/
|
|
13181
13257
|
strict?: boolean;
|
|
13182
13258
|
}
|
|
13259
|
+
interface OptionsFSDPublicApi extends OptionsOverrides {
|
|
13260
|
+
/**
|
|
13261
|
+
* Without SegmentsAPI / InnerAPI restrictions.
|
|
13262
|
+
* @default true
|
|
13263
|
+
*/
|
|
13264
|
+
lite?: boolean;
|
|
13265
|
+
}
|
|
13266
|
+
interface OptionsFSD {
|
|
13267
|
+
/**
|
|
13268
|
+
* FSD Public API rules.
|
|
13269
|
+
* @see https://github.com/feature-sliced/eslint-config/tree/master/rules/public-api
|
|
13270
|
+
* @default true
|
|
13271
|
+
*/
|
|
13272
|
+
publicApi?: boolean | OptionsFSDPublicApi;
|
|
13273
|
+
/**
|
|
13274
|
+
* FSD Layers slices rules.
|
|
13275
|
+
* @see https://github.com/feature-sliced/eslint-config/tree/master/rules/layers-slices
|
|
13276
|
+
* @default true
|
|
13277
|
+
*/
|
|
13278
|
+
layersSlices?: boolean | OptionsOverrides;
|
|
13279
|
+
}
|
|
13183
13280
|
interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
13184
13281
|
/**
|
|
13185
13282
|
* Enable gitignore support.
|
|
@@ -13303,6 +13400,13 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
13303
13400
|
* @default false
|
|
13304
13401
|
*/
|
|
13305
13402
|
pnpm?: boolean;
|
|
13403
|
+
/**
|
|
13404
|
+
* Enable FSD rules.
|
|
13405
|
+
*
|
|
13406
|
+
* @see https://feature-sliced.github.io/
|
|
13407
|
+
* @default false
|
|
13408
|
+
*/
|
|
13409
|
+
fsd?: boolean | OptionsFSD;
|
|
13306
13410
|
/**
|
|
13307
13411
|
* Use external formatters to format files.
|
|
13308
13412
|
*
|
|
@@ -13365,9 +13469,6 @@ declare const defaultPluginRenaming: {
|
|
|
13365
13469
|
* The merged ESLint configurations.
|
|
13366
13470
|
*/
|
|
13367
13471
|
declare function config(options?: OptionsConfig & Omit<TypedFlatConfigItem, 'files'>, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
13368
|
-
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
13369
|
-
declare function resolveSubOptions<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): ResolvedOptions<OptionsConfig[K]>;
|
|
13370
|
-
declare function getOverrides<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): Partial<Linter.RulesRecord & RuleOptions>;
|
|
13371
13472
|
//#endregion
|
|
13372
13473
|
//#region src/configs/comments.d.ts
|
|
13373
13474
|
declare function comments(): Promise<TypedFlatConfigItem[]>;
|
|
@@ -13381,6 +13482,9 @@ declare function effector(options?: OptionsEffector): Promise<TypedFlatConfigIte
|
|
|
13381
13482
|
//#region src/configs/formatters.d.ts
|
|
13382
13483
|
declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig): Promise<TypedFlatConfigItem[]>;
|
|
13383
13484
|
//#endregion
|
|
13485
|
+
//#region src/configs/fsd.d.ts
|
|
13486
|
+
declare function fsd(options?: OptionsFSD): Promise<TypedFlatConfigItem[]>;
|
|
13487
|
+
//#endregion
|
|
13384
13488
|
//#region src/configs/ignores.d.ts
|
|
13385
13489
|
declare function ignores(userIgnores?: string[]): Promise<TypedFlatConfigItem[]>;
|
|
13386
13490
|
//#endregion
|
|
@@ -13540,5 +13644,8 @@ declare function isPackageInScope(name: string): boolean;
|
|
|
13540
13644
|
declare function ensurePackages(packages: (string | undefined)[]): Promise<void>;
|
|
13541
13645
|
declare function isInEditorEnv(): boolean;
|
|
13542
13646
|
declare function isInGitHooksOrLintStaged(): boolean;
|
|
13647
|
+
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
13648
|
+
declare function resolveSubOptions<C extends Record<string, any>, K extends keyof C>(options: C, key: K): ResolvedOptions<C[K]>;
|
|
13649
|
+
declare function getOverrides<C extends Record<string, any>, K extends keyof C>(options: C, key: K): Partial<Linter.RulesRecord & RuleOptions>;
|
|
13543
13650
|
//#endregion
|
|
13544
|
-
export { Awaitable, ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsEffector, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsProjectType, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, combine, comments, config, config as default, defaultPluginRenaming, disables, effector, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsonc, jsx, jsxA11y, markdown, next, node, parserPlain, perfectionist, pnpm, react, regexp, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, toml, typescript, unicorn, unocss, yaml };
|
|
13651
|
+
export { Awaitable, ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsEffector, OptionsFSD, OptionsFSDPublicApi, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsProjectType, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, combine, comments, config, config as default, defaultPluginRenaming, disables, effector, ensurePackages, formatters, fsd, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsonc, jsx, jsxA11y, markdown, next, node, parserPlain, perfectionist, pnpm, react, regexp, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, toml, typescript, unicorn, unocss, yaml };
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import pluginNode from "eslint-plugin-n";
|
|
|
7
7
|
import pluginPerfectionist from "eslint-plugin-perfectionist";
|
|
8
8
|
import pluginUnicorn from "eslint-plugin-unicorn";
|
|
9
9
|
import pluginUnusedImports from "eslint-plugin-unused-imports";
|
|
10
|
+
import { fixupPluginRules } from "@eslint/compat";
|
|
10
11
|
import process from "node:process";
|
|
11
12
|
import { fileURLToPath } from "node:url";
|
|
12
13
|
import globals from "globals";
|
|
@@ -214,6 +215,16 @@ function isInEditorEnv() {
|
|
|
214
215
|
function isInGitHooksOrLintStaged() {
|
|
215
216
|
return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged"));
|
|
216
217
|
}
|
|
218
|
+
function resolveSubOptions(options, key) {
|
|
219
|
+
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
220
|
+
}
|
|
221
|
+
function getOverrides(options, key) {
|
|
222
|
+
const sub = resolveSubOptions(options, key);
|
|
223
|
+
return {
|
|
224
|
+
...options.overrides?.[key],
|
|
225
|
+
..."overrides" in sub ? sub.overrides : {}
|
|
226
|
+
};
|
|
227
|
+
}
|
|
217
228
|
|
|
218
229
|
//#endregion
|
|
219
230
|
//#region src/configs/effector.ts
|
|
@@ -223,7 +234,7 @@ async function effector(options = {}) {
|
|
|
223
234
|
const [pluginEffector] = await Promise.all([interopDefault(import("eslint-plugin-effector"))]);
|
|
224
235
|
return [{
|
|
225
236
|
name: "effector/setup",
|
|
226
|
-
plugins: { effector: pluginEffector }
|
|
237
|
+
plugins: { effector: fixupPluginRules(pluginEffector) }
|
|
227
238
|
}, {
|
|
228
239
|
name: "effector/rules",
|
|
229
240
|
rules: {
|
|
@@ -403,6 +414,118 @@ async function formatters(options = {}, stylistic$1 = {}) {
|
|
|
403
414
|
return configs$1;
|
|
404
415
|
}
|
|
405
416
|
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region src/configs/fsd.ts
|
|
419
|
+
const FS_LAYERS = [
|
|
420
|
+
"app",
|
|
421
|
+
"processes",
|
|
422
|
+
"pages",
|
|
423
|
+
"widgets",
|
|
424
|
+
"features",
|
|
425
|
+
"entities",
|
|
426
|
+
"shared"
|
|
427
|
+
];
|
|
428
|
+
const FS_SEGMENTS = [
|
|
429
|
+
"ui",
|
|
430
|
+
"model",
|
|
431
|
+
"lib",
|
|
432
|
+
"api",
|
|
433
|
+
"config",
|
|
434
|
+
"assets"
|
|
435
|
+
];
|
|
436
|
+
function getLowerLayers(layer) {
|
|
437
|
+
return FS_LAYERS.slice(FS_LAYERS.indexOf(layer) + 1);
|
|
438
|
+
}
|
|
439
|
+
function getUpperLayers(layer) {
|
|
440
|
+
return FS_LAYERS.slice(0, FS_LAYERS.indexOf(layer));
|
|
441
|
+
}
|
|
442
|
+
const FS_SLICED_LAYERS_REG = getUpperLayers("shared").join("|");
|
|
443
|
+
const FS_SEGMENTS_REG = [...FS_SEGMENTS, ...FS_SEGMENTS.map((seg) => `${seg}.*`)].join("|");
|
|
444
|
+
function getNotSharedLayersRules() {
|
|
445
|
+
return getUpperLayers("shared").map((layer) => ({
|
|
446
|
+
allow: getLowerLayers(layer),
|
|
447
|
+
from: layer
|
|
448
|
+
}));
|
|
449
|
+
}
|
|
450
|
+
const slicelessLayerRules = [{
|
|
451
|
+
allow: "shared",
|
|
452
|
+
from: "shared"
|
|
453
|
+
}, {
|
|
454
|
+
allow: "app",
|
|
455
|
+
from: "app"
|
|
456
|
+
}];
|
|
457
|
+
function getLayersBoundariesElements() {
|
|
458
|
+
return FS_LAYERS.map((layer) => ({
|
|
459
|
+
capture: ["slices"],
|
|
460
|
+
mode: "folder",
|
|
461
|
+
pattern: `${layer}/!(_*){,/*}`,
|
|
462
|
+
type: layer
|
|
463
|
+
}));
|
|
464
|
+
}
|
|
465
|
+
function getGodModeRules() {
|
|
466
|
+
return FS_LAYERS.map((layer) => ({
|
|
467
|
+
allow: [layer, ...getLowerLayers(layer)],
|
|
468
|
+
from: `gm_${layer}`
|
|
469
|
+
}));
|
|
470
|
+
}
|
|
471
|
+
function getGodModeElements() {
|
|
472
|
+
return FS_LAYERS.map((layer) => ({
|
|
473
|
+
capture: ["slices"],
|
|
474
|
+
mode: "folder",
|
|
475
|
+
pattern: `${layer}/_*`,
|
|
476
|
+
type: `gm_${layer}`
|
|
477
|
+
}));
|
|
478
|
+
}
|
|
479
|
+
async function fsd(options = {}) {
|
|
480
|
+
const { layersSlices: enableLayersSlices = true, publicApi: enablePublicApi = true } = options;
|
|
481
|
+
const configs$1 = [{
|
|
482
|
+
name: "fsd/setup",
|
|
483
|
+
plugins: { "eslint-comments": pluginComments }
|
|
484
|
+
}];
|
|
485
|
+
if (enablePublicApi) {
|
|
486
|
+
const { lite = true } = resolveSubOptions(options, "publicApi");
|
|
487
|
+
configs$1.push({
|
|
488
|
+
name: "fsd/public-api",
|
|
489
|
+
rules: {
|
|
490
|
+
"import/no-internal-modules": ["error", { allow: [
|
|
491
|
+
`**/*(${FS_SLICED_LAYERS_REG})/!(${FS_SEGMENTS_REG})`,
|
|
492
|
+
`**/*(${FS_SLICED_LAYERS_REG})/!(${FS_SEGMENTS_REG})/!(${FS_SEGMENTS_REG})`,
|
|
493
|
+
`**/*shared/*(${FS_SEGMENTS_REG})/!(${FS_SEGMENTS_REG})`,
|
|
494
|
+
`**/*shared/*(${FS_SEGMENTS_REG})`,
|
|
495
|
+
`**/node_modules/**`,
|
|
496
|
+
`**/*shared/_*`,
|
|
497
|
+
`**/*shared/_*/*`,
|
|
498
|
+
...lite ? [`./**`] : []
|
|
499
|
+
] }],
|
|
500
|
+
...getOverrides(options, "publicApi")
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
if (enableLayersSlices) {
|
|
505
|
+
ensurePackages(["eslint-plugin-boundaries"]);
|
|
506
|
+
const [pluginBoundaries] = await Promise.all([interopDefault(import("eslint-plugin-boundaries"))]);
|
|
507
|
+
configs$1.push({
|
|
508
|
+
name: "fsd/layers-slices",
|
|
509
|
+
plugins: { boundaries: pluginBoundaries },
|
|
510
|
+
rules: {
|
|
511
|
+
...pluginBoundaries.configs.recommended.rules,
|
|
512
|
+
"boundaries/element-types": [2, {
|
|
513
|
+
default: "disallow",
|
|
514
|
+
message: "\"${file.type}\" is not allowed to import \"${dependency.type}\" | See rules: https://feature-sliced.design/docs/reference/layers/overview ",
|
|
515
|
+
rules: [
|
|
516
|
+
...getNotSharedLayersRules(),
|
|
517
|
+
...slicelessLayerRules,
|
|
518
|
+
...getGodModeRules()
|
|
519
|
+
]
|
|
520
|
+
}],
|
|
521
|
+
...getOverrides(options, "layersSlices")
|
|
522
|
+
},
|
|
523
|
+
settings: { "boundaries/elements": [...getLayersBoundariesElements(), ...getGodModeElements()] }
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
return configs$1;
|
|
527
|
+
}
|
|
528
|
+
|
|
406
529
|
//#endregion
|
|
407
530
|
//#region src/configs/ignores.ts
|
|
408
531
|
async function ignores(userIgnores = []) {
|
|
@@ -1673,7 +1796,7 @@ const defaultPluginRenaming = {
|
|
|
1673
1796
|
*/
|
|
1674
1797
|
function config(options = {}, ...userConfigs) {
|
|
1675
1798
|
const isUsingReact = ReactPackages.some((i) => isPackageExists(i));
|
|
1676
|
-
const { autoRenamePlugins = true, componentExts = [], effector: enableEffector = isPackageExists("effector"), gitignore: enableGitignore = true, jsx: enableJsx = true, jsxA11y: enableJsxA11y = isUsingReact, next: enableNext = NextJsPackages.some((i) => isPackageExists(i)), pnpm: enableCatalogs = false, react: enableReact = isUsingReact, regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false } = options;
|
|
1799
|
+
const { autoRenamePlugins = true, componentExts = [], effector: enableEffector = isPackageExists("effector"), fsd: enableFsd = false, gitignore: enableGitignore = true, jsx: enableJsx = true, jsxA11y: enableJsxA11y = isUsingReact, next: enableNext = NextJsPackages.some((i) => isPackageExists(i)), pnpm: enableCatalogs = false, react: enableReact = isUsingReact, regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false } = options;
|
|
1677
1800
|
let isInEditor = options.isInEditor;
|
|
1678
1801
|
if (isInEditor == null) {
|
|
1679
1802
|
isInEditor = isInEditorEnv();
|
|
@@ -1716,6 +1839,7 @@ function config(options = {}, ...userConfigs) {
|
|
|
1716
1839
|
}));
|
|
1717
1840
|
if (enableJsxA11y) configs$1.push(jsxA11y({ overrides: getOverrides(options, "jsxA11y") }));
|
|
1718
1841
|
if (enableNext) configs$1.push(next({ overrides: getOverrides(options, "next") }));
|
|
1842
|
+
if (enableFsd) configs$1.push(fsd({ ...resolveSubOptions(options, "fsd") }));
|
|
1719
1843
|
if (enableEffector) configs$1.push(effector({
|
|
1720
1844
|
...resolveSubOptions(options, "effector"),
|
|
1721
1845
|
overrides: getOverrides(options, "effector")
|
|
@@ -1755,20 +1879,10 @@ function config(options = {}, ...userConfigs) {
|
|
|
1755
1879
|
if (isInEditor) composer = composer.disableRulesFix(["unused-imports/no-unused-imports", "prefer-const"], { builtinRules: () => import(["eslint", "use-at-your-own-risk"].join("/")).then((r) => r.builtinRules) });
|
|
1756
1880
|
return composer;
|
|
1757
1881
|
}
|
|
1758
|
-
function resolveSubOptions(options, key) {
|
|
1759
|
-
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
1760
|
-
}
|
|
1761
|
-
function getOverrides(options, key) {
|
|
1762
|
-
const sub = resolveSubOptions(options, key);
|
|
1763
|
-
return {
|
|
1764
|
-
...options.overrides?.[key],
|
|
1765
|
-
..."overrides" in sub ? sub.overrides : {}
|
|
1766
|
-
};
|
|
1767
|
-
}
|
|
1768
1882
|
|
|
1769
1883
|
//#endregion
|
|
1770
1884
|
//#region src/index.ts
|
|
1771
1885
|
var src_default = config;
|
|
1772
1886
|
|
|
1773
1887
|
//#endregion
|
|
1774
|
-
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, combine, comments, config, src_default as default, defaultPluginRenaming, disables, effector, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsonc, jsx, jsxA11y, markdown, next, node, parserPlain, perfectionist, pnpm, react, regexp, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, toml, typescript, unicorn, unocss, yaml };
|
|
1888
|
+
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, combine, comments, config, src_default as default, defaultPluginRenaming, disables, effector, ensurePackages, formatters, fsd, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsonc, jsx, jsxA11y, markdown, next, node, parserPlain, perfectionist, pnpm, react, regexp, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, toml, typescript, unicorn, unocss, yaml };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghettoddos/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"description": "ghettoDdOS ESLint config",
|
|
6
6
|
"author": "ghettoDdOS <pen.egor2002@gamil.com> (https://github.com/ghettoDdOS/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"@prettier/plugin-xml": "^3.4.1",
|
|
30
30
|
"@unocss/eslint-plugin": ">=0.50.0",
|
|
31
31
|
"eslint": "^9.10.0",
|
|
32
|
+
"eslint-plugin-boundaries": "^5.0.1",
|
|
32
33
|
"eslint-plugin-effector": "^0.15.0",
|
|
33
34
|
"eslint-plugin-format": ">=0.1.0",
|
|
34
35
|
"eslint-plugin-jsx-a11y": "^6.10.2"
|
|
@@ -43,6 +44,9 @@
|
|
|
43
44
|
"@unocss/eslint-plugin": {
|
|
44
45
|
"optional": true
|
|
45
46
|
},
|
|
47
|
+
"eslint-plugin-boundaries": {
|
|
48
|
+
"optional": true
|
|
49
|
+
},
|
|
46
50
|
"eslint-plugin-effector": {
|
|
47
51
|
"optional": true
|
|
48
52
|
},
|
|
@@ -58,6 +62,7 @@
|
|
|
58
62
|
"@clack/prompts": "^0.11.0",
|
|
59
63
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
60
64
|
"@eslint-react/eslint-plugin": "^1.50.0",
|
|
65
|
+
"@eslint/compat": "^1.2.9",
|
|
61
66
|
"@eslint/markdown": "^6.4.0",
|
|
62
67
|
"@stylistic/eslint-plugin": "^4.4.0",
|
|
63
68
|
"@typescript-eslint/eslint-plugin": "^8.33.0",
|
|
@@ -93,6 +98,7 @@
|
|
|
93
98
|
"@unocss/eslint-plugin": "66.1.0-beta.3",
|
|
94
99
|
"bumpp": "^10.1.1",
|
|
95
100
|
"eslint": "^9.27.0",
|
|
101
|
+
"eslint-plugin-boundaries": "^5.0.1",
|
|
96
102
|
"eslint-plugin-effector": "^0.15.0",
|
|
97
103
|
"eslint-plugin-format": "^1.0.1",
|
|
98
104
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|