@ghettoddos/eslint-config 1.4.0 → 1.5.1
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 +139 -2
- package/dist/index.js +66 -15
- package/package.json +7 -1
package/dist/index.d.ts
CHANGED
|
@@ -219,6 +219,105 @@ interface RuleOptions {
|
|
|
219
219
|
* @see https://eslint.org/docs/latest/rules/dot-notation
|
|
220
220
|
*/
|
|
221
221
|
'dot-notation'?: Linter.RuleEntry<DotNotation>;
|
|
222
|
+
/**
|
|
223
|
+
* Enforce Fx as a suffix for any effect created by Effector methods
|
|
224
|
+
* @see https://eslint.effector.dev/rules/enforce-effect-naming-convention
|
|
225
|
+
*/
|
|
226
|
+
'effector/enforce-effect-naming-convention'?: Linter.RuleEntry<[]>;
|
|
227
|
+
/**
|
|
228
|
+
* Enforce first capital letter for gate naming
|
|
229
|
+
* @see https://eslint.effector.dev/rules/enforce-gate-naming-convention
|
|
230
|
+
*/
|
|
231
|
+
'effector/enforce-gate-naming-convention'?: Linter.RuleEntry<[]>;
|
|
232
|
+
/**
|
|
233
|
+
* Enforce $ as a prefix or postfix for any store created by Effector methods
|
|
234
|
+
* @see https://eslint.effector.dev/rules/enforce-store-naming-convention
|
|
235
|
+
*/
|
|
236
|
+
'effector/enforce-store-naming-convention'?: Linter.RuleEntry<[]>;
|
|
237
|
+
/**
|
|
238
|
+
* Enforce options order for Effector methods
|
|
239
|
+
* @see https://eslint.effector.dev/rules/keep-options-order
|
|
240
|
+
*/
|
|
241
|
+
'effector/keep-options-order'?: Linter.RuleEntry<[]>;
|
|
242
|
+
/**
|
|
243
|
+
* Forbids `Event` and `Effect` usage without `useUnit` in React components.
|
|
244
|
+
* @see https://eslint.effector.dev/rules/mandatory-scope-binding
|
|
245
|
+
*/
|
|
246
|
+
'effector/mandatory-scope-binding'?: Linter.RuleEntry<[]>;
|
|
247
|
+
/**
|
|
248
|
+
* Forbids ambiguity targets in `sample` and `guard`
|
|
249
|
+
* @see https://eslint.effector.dev/rules/no-ambiguity-target
|
|
250
|
+
*/
|
|
251
|
+
'effector/no-ambiguity-target'?: Linter.RuleEntry<[]>;
|
|
252
|
+
/**
|
|
253
|
+
* Forbids unit duplicates on `source` and `clock``
|
|
254
|
+
* @see https://eslint.effector.dev/rules/no-duplicate-clock-or-source-array-values
|
|
255
|
+
*/
|
|
256
|
+
'effector/no-duplicate-clock-or-source-array-values'?: Linter.RuleEntry<[]>;
|
|
257
|
+
/**
|
|
258
|
+
* Forbids duplicate `.on` calls on store
|
|
259
|
+
* @see https://eslint.effector.dev/rules/no-duplicate-on
|
|
260
|
+
*/
|
|
261
|
+
'effector/no-duplicate-on'?: Linter.RuleEntry<[]>;
|
|
262
|
+
/**
|
|
263
|
+
* Prefer `sample` over `forward`
|
|
264
|
+
* @see https://eslint.effector.dev/rules/no-forward
|
|
265
|
+
*/
|
|
266
|
+
'effector/no-forward'?: Linter.RuleEntry<[]>;
|
|
267
|
+
/**
|
|
268
|
+
* Forbids `.getState` calls on any Effector store
|
|
269
|
+
* @see https://eslint.effector.dev/rules/no-getState
|
|
270
|
+
*/
|
|
271
|
+
'effector/no-getState'?: Linter.RuleEntry<[]>;
|
|
272
|
+
/**
|
|
273
|
+
* Prefer `sample` over `guard`
|
|
274
|
+
* @see https://eslint.effector.dev/rules/no-guard
|
|
275
|
+
*/
|
|
276
|
+
'effector/no-guard'?: Linter.RuleEntry<[]>;
|
|
277
|
+
/**
|
|
278
|
+
* Disallow the use of patronum `debug`
|
|
279
|
+
* @see https://eslint.effector.dev/rules/no-patronum-debug
|
|
280
|
+
*/
|
|
281
|
+
'effector/no-patronum-debug'?: Linter.RuleEntry<[]>;
|
|
282
|
+
/**
|
|
283
|
+
* Forbids unnecessary combinations in `clock`, `source` and `forward`
|
|
284
|
+
* @see https://eslint.effector.dev/rules/no-unnecessary-combination
|
|
285
|
+
*/
|
|
286
|
+
'effector/no-unnecessary-combination'?: Linter.RuleEntry<[]>;
|
|
287
|
+
/**
|
|
288
|
+
* Forbids unnecessary duplication in `clock` and `source`
|
|
289
|
+
* @see https://eslint.effector.dev/rules/no-unnecessary-duplication
|
|
290
|
+
*/
|
|
291
|
+
'effector/no-unnecessary-duplication'?: Linter.RuleEntry<[]>;
|
|
292
|
+
/**
|
|
293
|
+
* Forbids useless calls of `sample` and `guard`
|
|
294
|
+
* @see https://eslint.effector.dev/rules/no-useless-methods
|
|
295
|
+
*/
|
|
296
|
+
'effector/no-useless-methods'?: Linter.RuleEntry<[]>;
|
|
297
|
+
/**
|
|
298
|
+
* Avoid `.watch` calls on any Effector unit or operator
|
|
299
|
+
* @see https://eslint.effector.dev/rules/no-watch
|
|
300
|
+
*/
|
|
301
|
+
'effector/no-watch'?: Linter.RuleEntry<[]>;
|
|
302
|
+
/**
|
|
303
|
+
* Prefer `sample` over `forward` with `.map`/`.prepend`
|
|
304
|
+
* @see https://eslint.effector.dev/rules/prefer-sample-over-forward-with-mapping
|
|
305
|
+
*/
|
|
306
|
+
'effector/prefer-sample-over-forward-with-mapping'?: Linter.RuleEntry<[]>;
|
|
307
|
+
/**
|
|
308
|
+
* Suggests to replace old hooks `useStore`/`useEvent` by the new one `useUnit`
|
|
309
|
+
* @see https://eslint.effector.dev/rules/prefer-useUnit
|
|
310
|
+
*/
|
|
311
|
+
'effector/prefer-useUnit'?: Linter.RuleEntry<[]>;
|
|
312
|
+
/**
|
|
313
|
+
* @see https://eslint.effector.dev/rules/require-pickup-in-persist
|
|
314
|
+
*/
|
|
315
|
+
'effector/require-pickup-in-persist'?: Linter.RuleEntry<[]>;
|
|
316
|
+
/**
|
|
317
|
+
* Forbids mix of async functions and effects calls in effect handlers.
|
|
318
|
+
* @see https://eslint.effector.dev/rules/strict-effect-handlers
|
|
319
|
+
*/
|
|
320
|
+
'effector/strict-effect-handlers'?: Linter.RuleEntry<[]>;
|
|
222
321
|
/**
|
|
223
322
|
* Require or disallow newline at the end of files
|
|
224
323
|
* @see https://eslint.org/docs/latest/rules/eol-last
|
|
@@ -12794,7 +12893,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
12794
12893
|
onlyEquality?: boolean;
|
|
12795
12894
|
}];
|
|
12796
12895
|
// Names of all the configs
|
|
12797
|
-
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';
|
|
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';
|
|
12798
12897
|
//#endregion
|
|
12799
12898
|
//#region src/vendor/prettier-types.d.ts
|
|
12800
12899
|
/**
|
|
@@ -12989,6 +13088,32 @@ interface OptionsUnicorn extends OptionsOverrides {
|
|
|
12989
13088
|
*/
|
|
12990
13089
|
allRecommended?: boolean;
|
|
12991
13090
|
}
|
|
13091
|
+
interface OptionsEffector extends OptionsOverrides {
|
|
13092
|
+
/**
|
|
13093
|
+
* Include react rules.
|
|
13094
|
+
*
|
|
13095
|
+
* @default auto-detect based on the dependencies
|
|
13096
|
+
*/
|
|
13097
|
+
react?: boolean;
|
|
13098
|
+
/**
|
|
13099
|
+
* Include patronum rules.
|
|
13100
|
+
*
|
|
13101
|
+
* @default auto-detect based on the dependencies
|
|
13102
|
+
*/
|
|
13103
|
+
patronum?: boolean;
|
|
13104
|
+
/**
|
|
13105
|
+
* Include future rules.
|
|
13106
|
+
*
|
|
13107
|
+
* @default false
|
|
13108
|
+
*/
|
|
13109
|
+
future?: boolean;
|
|
13110
|
+
/**
|
|
13111
|
+
* Include scope rules.
|
|
13112
|
+
*
|
|
13113
|
+
* @default false
|
|
13114
|
+
*/
|
|
13115
|
+
scope?: boolean;
|
|
13116
|
+
}
|
|
12992
13117
|
interface OptionsTypeScriptParserOptions {
|
|
12993
13118
|
/**
|
|
12994
13119
|
* Additional parser options for TypeScript.
|
|
@@ -13149,6 +13274,15 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
13149
13274
|
* @default auto-detect based on the dependencies
|
|
13150
13275
|
*/
|
|
13151
13276
|
next?: boolean | OptionsOverrides;
|
|
13277
|
+
/**
|
|
13278
|
+
* Enable effector rules.
|
|
13279
|
+
*
|
|
13280
|
+
* Requires installing:
|
|
13281
|
+
* - `eslint-plugin-effector`
|
|
13282
|
+
*
|
|
13283
|
+
* @default auto-detect based on the dependencies
|
|
13284
|
+
*/
|
|
13285
|
+
effector?: boolean | OptionsEffector;
|
|
13152
13286
|
/**
|
|
13153
13287
|
* Enable unocss rules.
|
|
13154
13288
|
*
|
|
@@ -13241,6 +13375,9 @@ declare function comments(): Promise<TypedFlatConfigItem[]>;
|
|
|
13241
13375
|
//#region src/configs/disables.d.ts
|
|
13242
13376
|
declare function disables(): Promise<TypedFlatConfigItem[]>;
|
|
13243
13377
|
//#endregion
|
|
13378
|
+
//#region src/configs/effector.d.ts
|
|
13379
|
+
declare function effector(options?: OptionsEffector): Promise<TypedFlatConfigItem[]>;
|
|
13380
|
+
//#endregion
|
|
13244
13381
|
//#region src/configs/formatters.d.ts
|
|
13245
13382
|
declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig): Promise<TypedFlatConfigItem[]>;
|
|
13246
13383
|
//#endregion
|
|
@@ -13404,4 +13541,4 @@ declare function ensurePackages(packages: (string | undefined)[]): Promise<void>
|
|
|
13404
13541
|
declare function isInEditorEnv(): boolean;
|
|
13405
13542
|
declare function isInGitHooksOrLintStaged(): boolean;
|
|
13406
13543
|
//#endregion
|
|
13407
|
-
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, 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, 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 };
|
|
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 };
|
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";
|
|
@@ -125,6 +126,18 @@ async function disables() {
|
|
|
125
126
|
];
|
|
126
127
|
}
|
|
127
128
|
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/constants.ts
|
|
131
|
+
const ReactPackages = ["react", "nest"];
|
|
132
|
+
const ReactRefreshAllowConstantExportPackages = ["vite"];
|
|
133
|
+
const ReactRouterPackages = [
|
|
134
|
+
"@react-router/node",
|
|
135
|
+
"@react-router/react",
|
|
136
|
+
"@react-router/serve",
|
|
137
|
+
"@react-router/dev"
|
|
138
|
+
];
|
|
139
|
+
const NextJsPackages = ["next"];
|
|
140
|
+
|
|
128
141
|
//#endregion
|
|
129
142
|
//#region src/utils.ts
|
|
130
143
|
const scopeUrl = fileURLToPath(new URL(".", import.meta.url));
|
|
@@ -203,6 +216,49 @@ function isInGitHooksOrLintStaged() {
|
|
|
203
216
|
return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged"));
|
|
204
217
|
}
|
|
205
218
|
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/configs/effector.ts
|
|
221
|
+
async function effector(options = {}) {
|
|
222
|
+
const { future = false, overrides = {}, patronum = isPackageExists("patronum"), react: react$1 = ReactPackages.some((i) => isPackageExists(i)), scope = false } = options;
|
|
223
|
+
await ensurePackages(["eslint-plugin-effector"]);
|
|
224
|
+
const [pluginEffector] = await Promise.all([interopDefault(import("eslint-plugin-effector"))]);
|
|
225
|
+
return [{
|
|
226
|
+
name: "effector/setup",
|
|
227
|
+
plugins: { effector: fixupPluginRules(pluginEffector) }
|
|
228
|
+
}, {
|
|
229
|
+
name: "effector/rules",
|
|
230
|
+
rules: {
|
|
231
|
+
"effector/enforce-effect-naming-convention": "error",
|
|
232
|
+
"effector/enforce-store-naming-convention": "error",
|
|
233
|
+
"effector/keep-options-order": "warn",
|
|
234
|
+
"effector/no-ambiguity-target": "warn",
|
|
235
|
+
"effector/no-duplicate-on": "error",
|
|
236
|
+
"effector/no-getState": "error",
|
|
237
|
+
"effector/no-unnecessary-combination": "warn",
|
|
238
|
+
"effector/no-unnecessary-duplication": "warn",
|
|
239
|
+
"effector/no-useless-methods": "error",
|
|
240
|
+
"effector/no-watch": "warn",
|
|
241
|
+
"effector/prefer-sample-over-forward-with-mapping": "warn",
|
|
242
|
+
...react$1 ? {
|
|
243
|
+
"effector/enforce-gate-naming-convention": "error",
|
|
244
|
+
"effector/mandatory-scope-binding": "error",
|
|
245
|
+
"effector/prefer-useUnit": "warn"
|
|
246
|
+
} : {},
|
|
247
|
+
...patronum ? { "effector/no-patronum-debug": "error" } : {},
|
|
248
|
+
...scope ? {
|
|
249
|
+
"effector/require-pickup-in-persist": "error",
|
|
250
|
+
"effector/strict-effect-handlers": "error"
|
|
251
|
+
} : {},
|
|
252
|
+
...future ? {
|
|
253
|
+
"effector/no-forward": "warn",
|
|
254
|
+
"effector/no-guard": "warn",
|
|
255
|
+
"effector/prefer-sample-over-forward-with-mapping": "off"
|
|
256
|
+
} : {},
|
|
257
|
+
...overrides
|
|
258
|
+
}
|
|
259
|
+
}];
|
|
260
|
+
}
|
|
261
|
+
|
|
206
262
|
//#endregion
|
|
207
263
|
//#region src/configs/stylistic.ts
|
|
208
264
|
const StylisticConfigDefaults = {
|
|
@@ -687,12 +743,11 @@ async function jsx() {
|
|
|
687
743
|
|
|
688
744
|
//#endregion
|
|
689
745
|
//#region src/configs/jsx-a11y.ts
|
|
690
|
-
const NextJsPackages$1 = ["next"];
|
|
691
|
-
const isUsingNext = NextJsPackages$1.some((i) => isPackageExists(i));
|
|
692
746
|
async function jsxA11y(options = {}) {
|
|
693
747
|
const { overrides = {} } = options;
|
|
694
748
|
await ensurePackages(["eslint-plugin-jsx-a11y"]);
|
|
695
749
|
const [pluginJsxA11y] = await Promise.all([interopDefault(import("eslint-plugin-jsx-a11y"))]);
|
|
750
|
+
const isUsingNext = NextJsPackages.some((i) => isPackageExists(i));
|
|
696
751
|
return [{
|
|
697
752
|
name: "jsx-a11y/rules",
|
|
698
753
|
plugins: { "jsx-a11y": pluginJsxA11y },
|
|
@@ -908,14 +963,6 @@ async function pnpm() {
|
|
|
908
963
|
|
|
909
964
|
//#endregion
|
|
910
965
|
//#region src/configs/react.ts
|
|
911
|
-
const ReactRefreshAllowConstantExportPackages = ["vite"];
|
|
912
|
-
const ReactRouterPackages = [
|
|
913
|
-
"@react-router/node",
|
|
914
|
-
"@react-router/react",
|
|
915
|
-
"@react-router/serve",
|
|
916
|
-
"@react-router/dev"
|
|
917
|
-
];
|
|
918
|
-
const NextJsPackages = ["next"];
|
|
919
966
|
async function react(options = {}) {
|
|
920
967
|
const { files = [GLOB_SRC], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [`${GLOB_MARKDOWN}/**`], overrides = {}, tsconfigPath } = options;
|
|
921
968
|
const isTypeAware = !!tsconfigPath;
|
|
@@ -927,7 +974,7 @@ async function react(options = {}) {
|
|
|
927
974
|
]);
|
|
928
975
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => isPackageExists(i));
|
|
929
976
|
const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists(i));
|
|
930
|
-
const isUsingNext
|
|
977
|
+
const isUsingNext = NextJsPackages.some((i) => isPackageExists(i));
|
|
931
978
|
const plugins = pluginReact.configs.all.plugins;
|
|
932
979
|
return [
|
|
933
980
|
{
|
|
@@ -1014,7 +1061,7 @@ async function react(options = {}) {
|
|
|
1014
1061
|
"react-web-api/no-leaked-timeout": "warn",
|
|
1015
1062
|
"react-refresh/only-export-components": ["warn", {
|
|
1016
1063
|
allowConstantExport: isAllowConstantExport,
|
|
1017
|
-
allowExportNames: [...isUsingNext
|
|
1064
|
+
allowExportNames: [...isUsingNext ? [
|
|
1018
1065
|
"dynamic",
|
|
1019
1066
|
"dynamicParams",
|
|
1020
1067
|
"revalidate",
|
|
@@ -1604,7 +1651,6 @@ const flatConfigProps = [
|
|
|
1604
1651
|
"rules",
|
|
1605
1652
|
"settings"
|
|
1606
1653
|
];
|
|
1607
|
-
const ReactPackages = ["react", "nest"];
|
|
1608
1654
|
const defaultPluginRenaming = {
|
|
1609
1655
|
"@eslint-react": "react",
|
|
1610
1656
|
"@eslint-react/dom": "react-dom",
|
|
@@ -1627,7 +1673,8 @@ const defaultPluginRenaming = {
|
|
|
1627
1673
|
* The merged ESLint configurations.
|
|
1628
1674
|
*/
|
|
1629
1675
|
function config(options = {}, ...userConfigs) {
|
|
1630
|
-
const
|
|
1676
|
+
const isUsingReact = ReactPackages.some((i) => isPackageExists(i));
|
|
1677
|
+
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;
|
|
1631
1678
|
let isInEditor = options.isInEditor;
|
|
1632
1679
|
if (isInEditor == null) {
|
|
1633
1680
|
isInEditor = isInEditorEnv();
|
|
@@ -1670,6 +1717,10 @@ function config(options = {}, ...userConfigs) {
|
|
|
1670
1717
|
}));
|
|
1671
1718
|
if (enableJsxA11y) configs$1.push(jsxA11y({ overrides: getOverrides(options, "jsxA11y") }));
|
|
1672
1719
|
if (enableNext) configs$1.push(next({ overrides: getOverrides(options, "next") }));
|
|
1720
|
+
if (enableEffector) configs$1.push(effector({
|
|
1721
|
+
...resolveSubOptions(options, "effector"),
|
|
1722
|
+
overrides: getOverrides(options, "effector")
|
|
1723
|
+
}));
|
|
1673
1724
|
if (enableUnoCSS) configs$1.push(unocss({
|
|
1674
1725
|
...resolveSubOptions(options, "unocss"),
|
|
1675
1726
|
overrides: getOverrides(options, "unocss")
|
|
@@ -1721,4 +1772,4 @@ function getOverrides(options, key) {
|
|
|
1721
1772
|
var src_default = config;
|
|
1722
1773
|
|
|
1723
1774
|
//#endregion
|
|
1724
|
-
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, 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 };
|
|
1775
|
+
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 };
|
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.5.1",
|
|
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-effector": "^0.15.0",
|
|
32
33
|
"eslint-plugin-format": ">=0.1.0",
|
|
33
34
|
"eslint-plugin-jsx-a11y": "^6.10.2"
|
|
34
35
|
},
|
|
@@ -42,6 +43,9 @@
|
|
|
42
43
|
"@unocss/eslint-plugin": {
|
|
43
44
|
"optional": true
|
|
44
45
|
},
|
|
46
|
+
"eslint-plugin-effector": {
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
45
49
|
"eslint-plugin-format": {
|
|
46
50
|
"optional": true
|
|
47
51
|
},
|
|
@@ -54,6 +58,7 @@
|
|
|
54
58
|
"@clack/prompts": "^0.11.0",
|
|
55
59
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
56
60
|
"@eslint-react/eslint-plugin": "^1.50.0",
|
|
61
|
+
"@eslint/compat": "^1.2.9",
|
|
57
62
|
"@eslint/markdown": "^6.4.0",
|
|
58
63
|
"@stylistic/eslint-plugin": "^4.4.0",
|
|
59
64
|
"@typescript-eslint/eslint-plugin": "^8.33.0",
|
|
@@ -89,6 +94,7 @@
|
|
|
89
94
|
"@unocss/eslint-plugin": "66.1.0-beta.3",
|
|
90
95
|
"bumpp": "^10.1.1",
|
|
91
96
|
"eslint": "^9.27.0",
|
|
97
|
+
"eslint-plugin-effector": "^0.15.0",
|
|
92
98
|
"eslint-plugin-format": "^1.0.1",
|
|
93
99
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
94
100
|
"eslint-typegen": "^2.2.0",
|