@ghettoddos/eslint-config 1.8.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/dist/index.d.ts +64 -21
- package/dist/index.js +37 -28
- package/package.json +19 -18
package/README.md
CHANGED
|
@@ -293,13 +293,14 @@ Check out the [configs](https://github.com/ghettoDdOS/eslint-config/blob/master/
|
|
|
293
293
|
|
|
294
294
|
Since flat config requires us to explicitly provide the plugin names (instead of the mandatory convention from npm package name), we renamed some plugins to make the overall scope more consistent and easier to write.
|
|
295
295
|
|
|
296
|
-
| New Prefix | Original Prefix | Source Plugin
|
|
297
|
-
| ---------- | ---------------------- |
|
|
298
|
-
| `import/*` | `import-lite/*` | [eslint-plugin-import-lite](https://github.com/9romise/eslint-plugin-import-lite)
|
|
299
|
-
| `node/*` | `n/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n)
|
|
300
|
-
| `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml)
|
|
301
|
-
| `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint)
|
|
302
|
-
| `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic)
|
|
296
|
+
| New Prefix | Original Prefix | Source Plugin |
|
|
297
|
+
| ---------- | ---------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
298
|
+
| `import/*` | `import-lite/*` | [eslint-plugin-import-lite](https://github.com/9romise/eslint-plugin-import-lite) |
|
|
299
|
+
| `node/*` | `n/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) |
|
|
300
|
+
| `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) |
|
|
301
|
+
| `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
|
|
302
|
+
| `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |
|
|
303
|
+
| `next/*` | `@next/next` | [@next/eslint-plugin-next](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next) |
|
|
303
304
|
|
|
304
305
|
When you want to override rules, or disable them inline, you need to update to the new prefix:
|
|
305
306
|
|
package/dist/index.d.ts
CHANGED
|
@@ -375,6 +375,16 @@ interface RuleOptions {
|
|
|
375
375
|
* @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/require-description.html
|
|
376
376
|
*/
|
|
377
377
|
'eslint-comments/require-description'?: Linter.RuleEntry<EslintCommentsRequireDescription>;
|
|
378
|
+
/**
|
|
379
|
+
* Prevents process.env from being accessed dynamically
|
|
380
|
+
* @see https://github.com/expo/expo/blob/main/packages/eslint-plugin-expo/docs/rules/no-dynamic-env-var.md
|
|
381
|
+
*/
|
|
382
|
+
'expo/no-dynamic-env-var'?: Linter.RuleEntry<[]>;
|
|
383
|
+
/**
|
|
384
|
+
* Disallow desctructuring of environment variables
|
|
385
|
+
* @see https://github.com/expo/expo/blob/main/packages/eslint-plugin-expo/docs/rules/no-env-var-destructuring.md
|
|
386
|
+
*/
|
|
387
|
+
'expo/no-env-var-destructuring'?: Linter.RuleEntry<[]>;
|
|
378
388
|
/**
|
|
379
389
|
* Enforce `for` loop update clause moving the counter in the right direction
|
|
380
390
|
* @see https://eslint.org/docs/latest/rules/for-direction
|
|
@@ -5593,7 +5603,7 @@ interface RuleOptions {
|
|
|
5593
5603
|
* Order of UnoCSS utilities in class attribute
|
|
5594
5604
|
* @see https://unocss.dev/integrations/eslint#rules
|
|
5595
5605
|
*/
|
|
5596
|
-
'unocss/order'?: Linter.RuleEntry<
|
|
5606
|
+
'unocss/order'?: Linter.RuleEntry<UnocssOrder>;
|
|
5597
5607
|
/**
|
|
5598
5608
|
* Order of UnoCSS attributes
|
|
5599
5609
|
* @see https://unocss.dev/integrations/eslint#rules
|
|
@@ -6159,6 +6169,16 @@ interface RuleOptions {
|
|
|
6159
6169
|
* @see https://eslint.vuejs.org/rules/no-mutating-props.html
|
|
6160
6170
|
*/
|
|
6161
6171
|
'vue/no-mutating-props'?: Linter.RuleEntry<VueNoMutatingProps>;
|
|
6172
|
+
/**
|
|
6173
|
+
* Disallow negated conditions in `<template>`
|
|
6174
|
+
* @see https://eslint.vuejs.org/rules/no-negated-condition.html
|
|
6175
|
+
*/
|
|
6176
|
+
'vue/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
6177
|
+
/**
|
|
6178
|
+
* disallow negated conditions in v-if/v-else
|
|
6179
|
+
* @see https://eslint.vuejs.org/rules/no-negated-v-if-condition.html
|
|
6180
|
+
*/
|
|
6181
|
+
'vue/no-negated-v-if-condition'?: Linter.RuleEntry<[]>;
|
|
6162
6182
|
/**
|
|
6163
6183
|
* disallow parsing errors in `<template>`
|
|
6164
6184
|
* @see https://eslint.vuejs.org/rules/no-parsing-error.html
|
|
@@ -7024,6 +7044,7 @@ type AccessorPairs = [] | [{
|
|
|
7024
7044
|
getWithoutSet?: boolean;
|
|
7025
7045
|
setWithoutGet?: boolean;
|
|
7026
7046
|
enforceForClassMembers?: boolean;
|
|
7047
|
+
enforceForTSTypes?: boolean;
|
|
7027
7048
|
}];
|
|
7028
7049
|
// ----- antfu/consistent-chaining -----
|
|
7029
7050
|
type AntfuConsistentChaining = [] | [{
|
|
@@ -7272,7 +7293,9 @@ type GetterReturn = [] | [{
|
|
|
7272
7293
|
allowImplicit?: boolean;
|
|
7273
7294
|
}];
|
|
7274
7295
|
// ----- grouped-accessor-pairs -----
|
|
7275
|
-
type GroupedAccessorPairs = [] | [("anyOrder" | "getBeforeSet" | "setBeforeGet")]
|
|
7296
|
+
type GroupedAccessorPairs = [] | [("anyOrder" | "getBeforeSet" | "setBeforeGet")] | [("anyOrder" | "getBeforeSet" | "setBeforeGet"), {
|
|
7297
|
+
enforceForTSTypes?: boolean;
|
|
7298
|
+
}];
|
|
7276
7299
|
// ----- handle-callback-err -----
|
|
7277
7300
|
type HandleCallbackErr = [] | [string];
|
|
7278
7301
|
// ----- id-blacklist -----
|
|
@@ -8749,6 +8772,7 @@ type NoUnusedVars = [] | [(("all" | "local") | {
|
|
|
8749
8772
|
caughtErrorsIgnorePattern?: string;
|
|
8750
8773
|
destructuredArrayIgnorePattern?: string;
|
|
8751
8774
|
ignoreClassWithStaticInitBlock?: boolean;
|
|
8775
|
+
ignoreUsingDeclarations?: boolean;
|
|
8752
8776
|
reportUsedIgnorePattern?: boolean;
|
|
8753
8777
|
})];
|
|
8754
8778
|
// ----- no-use-before-define -----
|
|
@@ -13678,6 +13702,12 @@ type UnocssEnforceClassCompile = [] | [{
|
|
|
13678
13702
|
prefix?: string;
|
|
13679
13703
|
enableFix?: boolean;
|
|
13680
13704
|
}];
|
|
13705
|
+
// ----- unocss/order -----
|
|
13706
|
+
type UnocssOrder = [] | [{
|
|
13707
|
+
unoFunctions?: string[];
|
|
13708
|
+
unoVariables?: string[];
|
|
13709
|
+
[k: string]: unknown | undefined;
|
|
13710
|
+
}];
|
|
13681
13711
|
// ----- unused-imports/no-unused-imports -----
|
|
13682
13712
|
type UnusedImportsNoUnusedImports = [] | [(("all" | "local") | {
|
|
13683
13713
|
args?: ("all" | "after-used" | "none");
|
|
@@ -14430,6 +14460,7 @@ type VueNoDeprecatedRouterLinkTagProp = [] | [{
|
|
|
14430
14460
|
// ----- vue/no-deprecated-slot-attribute -----
|
|
14431
14461
|
type VueNoDeprecatedSlotAttribute = [] | [{
|
|
14432
14462
|
ignore?: string[];
|
|
14463
|
+
ignoreParents?: string[];
|
|
14433
14464
|
}];
|
|
14434
14465
|
// ----- vue/no-dupe-keys -----
|
|
14435
14466
|
type VueNoDupeKeys = [] | [{
|
|
@@ -15112,7 +15143,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
15112
15143
|
onlyEquality?: boolean;
|
|
15113
15144
|
}];
|
|
15114
15145
|
// Names of all the configs
|
|
15115
|
-
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' | 'react-native/setup' | 'react-native/rules' | 'sort/package-json' | 'stylistic/rules' | 'toml/setup' | 'toml/rules' | 'regexp/rules' | 'typescript/setup' | 'typescript/parser' | 'typescript/rules' | 'unicorn/rules' | 'unocss' | 'vue/setup' | 'vue/rules' | 'yaml/setup' | 'yaml/rules' | 'yaml/pnpm-workspace' | 'next/setup' | 'next/rules' | '
|
|
15146
|
+
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' | 'react-native/setup' | 'react-native/rules' | 'sort/package-json' | 'stylistic/rules' | 'toml/setup' | 'toml/rules' | 'regexp/rules' | 'typescript/setup' | 'typescript/parser' | 'typescript/rules' | 'unicorn/rules' | 'unocss' | 'vue/setup' | 'vue/rules' | 'yaml/setup' | 'yaml/rules' | 'yaml/pnpm-workspace' | 'next/setup' | 'next/rules' | 'effector/setup' | 'effector/rules';
|
|
15116
15147
|
//#endregion
|
|
15117
15148
|
//#region src/vendor/prettier-types.d.ts
|
|
15118
15149
|
/**
|
|
@@ -15236,18 +15267,25 @@ interface VendoredPrettierOptionsRequired {
|
|
|
15236
15267
|
//#endregion
|
|
15237
15268
|
//#region src/types.d.ts
|
|
15238
15269
|
type Awaitable<T> = T | Promise<T>;
|
|
15239
|
-
|
|
15240
|
-
|
|
15270
|
+
type Rules = Record<string, Linter.RuleEntry<any> | undefined> & RuleOptions;
|
|
15271
|
+
/**
|
|
15272
|
+
* An updated version of ESLint's `Linter.Config`, which provides autocompletion
|
|
15273
|
+
* for `rules` and relaxes type limitations for `plugins` and `rules`, because
|
|
15274
|
+
* many plugins still lack proper type definitions.
|
|
15275
|
+
*/
|
|
15276
|
+
type TypedFlatConfigItem = Omit<Linter.Config, 'plugins' | 'rules'> & {
|
|
15241
15277
|
/**
|
|
15242
|
-
* An object containing a name-value mapping of plugin names to plugin objects.
|
|
15278
|
+
* An object containing a name-value mapping of plugin names to plugin objects.
|
|
15279
|
+
* When `files` is specified, these plugins are only available to the matching files.
|
|
15243
15280
|
*
|
|
15244
15281
|
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
15245
15282
|
*/
|
|
15246
15283
|
plugins?: Record<string, any>;
|
|
15247
15284
|
/**
|
|
15248
|
-
*
|
|
15285
|
+
* An object containing the configured rules. When `files` or `ignores` are
|
|
15286
|
+
* specified, these rule configurations are only available to the matching files.
|
|
15249
15287
|
*/
|
|
15250
|
-
rules?:
|
|
15288
|
+
rules?: Rules;
|
|
15251
15289
|
};
|
|
15252
15290
|
interface OptionsFiles {
|
|
15253
15291
|
/**
|
|
@@ -15255,6 +15293,19 @@ interface OptionsFiles {
|
|
|
15255
15293
|
*/
|
|
15256
15294
|
files?: string[];
|
|
15257
15295
|
}
|
|
15296
|
+
interface OptionsJSXA11y extends OptionsOverrides {}
|
|
15297
|
+
interface OptionsJSX {
|
|
15298
|
+
/**
|
|
15299
|
+
* Enable JSX accessibility rules.
|
|
15300
|
+
*
|
|
15301
|
+
* Requires installing:
|
|
15302
|
+
* - `eslint-plugin-jsx-a11y`
|
|
15303
|
+
*
|
|
15304
|
+
* Can be a boolean or an object for custom options and overrides.
|
|
15305
|
+
* @default false
|
|
15306
|
+
*/
|
|
15307
|
+
a11y?: boolean | OptionsJSXA11y;
|
|
15308
|
+
}
|
|
15258
15309
|
interface OptionsVue extends OptionsOverrides {
|
|
15259
15310
|
/**
|
|
15260
15311
|
* Create virtual files for Vue SFC blocks to enable linting.
|
|
@@ -15461,11 +15512,11 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
15461
15512
|
/**
|
|
15462
15513
|
* Enable JSX related rules.
|
|
15463
15514
|
*
|
|
15464
|
-
*
|
|
15515
|
+
* Passing an object to enable JSX accessibility rules.
|
|
15465
15516
|
*
|
|
15466
15517
|
* @default true
|
|
15467
15518
|
*/
|
|
15468
|
-
jsx?: boolean;
|
|
15519
|
+
jsx?: boolean | OptionsJSX;
|
|
15469
15520
|
/**
|
|
15470
15521
|
* Options for eslint-plugin-unicorn.
|
|
15471
15522
|
*
|
|
@@ -15530,12 +15581,6 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
15530
15581
|
* @default auto-detect based on the dependencies
|
|
15531
15582
|
*/
|
|
15532
15583
|
react?: boolean | OptionsOverrides;
|
|
15533
|
-
/**
|
|
15534
|
-
* Enable jsxA11y rules.
|
|
15535
|
-
*
|
|
15536
|
-
* @default auto-detect based on the react dependencies
|
|
15537
|
-
*/
|
|
15538
|
-
jsxA11y?: boolean | OptionsOverrides;
|
|
15539
15584
|
/**
|
|
15540
15585
|
* Enable next rules.
|
|
15541
15586
|
*
|
|
@@ -15627,6 +15672,7 @@ declare const defaultPluginRenaming: {
|
|
|
15627
15672
|
'@eslint-react/dom': string;
|
|
15628
15673
|
'@eslint-react/hooks-extra': string;
|
|
15629
15674
|
'@eslint-react/naming-convention': string;
|
|
15675
|
+
'@next/next': string;
|
|
15630
15676
|
'@stylistic': string;
|
|
15631
15677
|
'@typescript-eslint': string;
|
|
15632
15678
|
'import-lite': string;
|
|
@@ -15670,10 +15716,7 @@ declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): Pro
|
|
|
15670
15716
|
declare function jsonc(options?: OptionsFiles & OptionsStylistic & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
15671
15717
|
//#endregion
|
|
15672
15718
|
//#region src/configs/jsx.d.ts
|
|
15673
|
-
declare function jsx(): Promise<TypedFlatConfigItem[]>;
|
|
15674
|
-
//#endregion
|
|
15675
|
-
//#region src/configs/jsx-a11y.d.ts
|
|
15676
|
-
declare function jsxA11y(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
15719
|
+
declare function jsx(options?: OptionsJSX): Promise<TypedFlatConfigItem[]>;
|
|
15677
15720
|
//#endregion
|
|
15678
15721
|
//#region src/configs/markdown.d.ts
|
|
15679
15722
|
declare function markdown(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
@@ -15827,4 +15870,4 @@ type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
|
15827
15870
|
declare function resolveSubOptions<C extends Record<string, any>, K extends keyof C>(options: C, key: K): ResolvedOptions<C[K]>;
|
|
15828
15871
|
declare function getOverrides<C extends Record<string, any>, K extends keyof C>(options: C, key: K): Partial<Linter.RulesRecord & RuleOptions>;
|
|
15829
15872
|
//#endregion
|
|
15830
|
-
export { Awaitable, type 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_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsEffector, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsProjectType, OptionsReactNative, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, 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,
|
|
15873
|
+
export { Awaitable, type 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_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsEffector, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsProjectType, OptionsReactNative, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, 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, markdown, next, node, parserPlain, perfectionist, pnpm, react, reactNative, regexp, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, toml, typescript, unicorn, unocss, vue, yaml };
|
package/dist/index.js
CHANGED
|
@@ -749,35 +749,44 @@ async function jsonc(options = {}) {
|
|
|
749
749
|
|
|
750
750
|
//#endregion
|
|
751
751
|
//#region src/configs/jsx.ts
|
|
752
|
-
async function jsx() {
|
|
753
|
-
|
|
752
|
+
async function jsx(options = {}) {
|
|
753
|
+
const { a11y } = options;
|
|
754
|
+
const baseConfig = {
|
|
754
755
|
files: [GLOB_JSX, GLOB_TSX],
|
|
755
756
|
languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
|
|
756
|
-
name: "jsx/setup"
|
|
757
|
-
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
//#region src/configs/jsx-a11y.ts
|
|
762
|
-
async function jsxA11y(options = {}) {
|
|
763
|
-
const { overrides = {} } = options;
|
|
757
|
+
name: "jsx/setup",
|
|
758
|
+
plugins: {},
|
|
759
|
+
rules: {}
|
|
760
|
+
};
|
|
761
|
+
if (!a11y) return [baseConfig];
|
|
764
762
|
await ensurePackages(["eslint-plugin-jsx-a11y"]);
|
|
765
|
-
const
|
|
763
|
+
const jsxA11yPlugin = await interopDefault(import("eslint-plugin-jsx-a11y"));
|
|
764
|
+
const a11yConfig = jsxA11yPlugin.flatConfigs.recommended;
|
|
766
765
|
const isUsingNext = NextJsPackages.some((i) => isPackageExists(i));
|
|
766
|
+
const a11yRules = {
|
|
767
|
+
...a11yConfig.rules || {},
|
|
768
|
+
"jsx-a11y/alt-text": ["error", {
|
|
769
|
+
elements: ["img"],
|
|
770
|
+
img: [...isUsingNext ? ["Image"] : []]
|
|
771
|
+
}],
|
|
772
|
+
...typeof a11y === "object" && a11y.overrides ? a11y.overrides : {}
|
|
773
|
+
};
|
|
767
774
|
return [{
|
|
768
|
-
|
|
769
|
-
|
|
775
|
+
...baseConfig,
|
|
776
|
+
...a11yConfig,
|
|
777
|
+
files: baseConfig.files,
|
|
778
|
+
languageOptions: {
|
|
779
|
+
...baseConfig.languageOptions,
|
|
780
|
+
...a11yConfig.languageOptions
|
|
781
|
+
},
|
|
782
|
+
name: baseConfig.name,
|
|
783
|
+
plugins: {
|
|
784
|
+
...baseConfig.plugins,
|
|
785
|
+
"jsx-a11y": jsxA11yPlugin
|
|
786
|
+
},
|
|
770
787
|
rules: {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
img: [...isUsingNext ? ["Image"] : []]
|
|
774
|
-
}],
|
|
775
|
-
"jsx-a11y/aria-props": "warn",
|
|
776
|
-
"jsx-a11y/aria-proptypes": "warn",
|
|
777
|
-
"jsx-a11y/aria-unsupported-elements": "warn",
|
|
778
|
-
"jsx-a11y/role-has-required-aria-props": "warn",
|
|
779
|
-
"jsx-a11y/role-supports-aria-props": "warn",
|
|
780
|
-
...overrides
|
|
788
|
+
...baseConfig.rules,
|
|
789
|
+
...a11yRules
|
|
781
790
|
}
|
|
782
791
|
}];
|
|
783
792
|
}
|
|
@@ -1963,6 +1972,7 @@ const defaultPluginRenaming = {
|
|
|
1963
1972
|
"@eslint-react/dom": "react-dom",
|
|
1964
1973
|
"@eslint-react/hooks-extra": "react-hooks-extra",
|
|
1965
1974
|
"@eslint-react/naming-convention": "react-naming-convention",
|
|
1975
|
+
"@next/next": "next",
|
|
1966
1976
|
"@stylistic": "style",
|
|
1967
1977
|
"@typescript-eslint": "ts",
|
|
1968
1978
|
"import-lite": "import",
|
|
@@ -1981,14 +1991,14 @@ const defaultPluginRenaming = {
|
|
|
1981
1991
|
*/
|
|
1982
1992
|
function config(options = {}, ...userConfigs) {
|
|
1983
1993
|
const isUsingReact = ReactPackages.some((i) => isPackageExists(i));
|
|
1984
|
-
const { autoRenamePlugins = true, componentExts = [], effector: enableEffector = isPackageExists("effector"), gitignore: enableGitignore = true, imports: enableImports = true, jsx: enableJsx = true,
|
|
1994
|
+
const { autoRenamePlugins = true, componentExts = [], effector: enableEffector = isPackageExists("effector"), gitignore: enableGitignore = true, imports: enableImports = true, jsx: enableJsx = true, next: enableNext = NextJsPackages.some((i) => isPackageExists(i)), pnpm: enableCatalogs = false, react: enableReact = isUsingReact, reactNative: enableReactNative = ReactNativePackages.some((i) => isPackageExists(i)), regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
1985
1995
|
let isInEditor = options.isInEditor;
|
|
1986
1996
|
if (isInEditor == null) {
|
|
1987
1997
|
isInEditor = isInEditorEnv();
|
|
1988
1998
|
if (isInEditor) console.log("[@ghettoddos/eslint-config] Detected running in editor, some rules are disabled.");
|
|
1989
1999
|
}
|
|
1990
2000
|
const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
|
|
1991
|
-
if (stylisticOptions && !("jsx" in stylisticOptions)) stylisticOptions.jsx = enableJsx;
|
|
2001
|
+
if (stylisticOptions && !("jsx" in stylisticOptions)) stylisticOptions.jsx = typeof enableJsx === "object" ? true : enableJsx;
|
|
1992
2002
|
const configs$1 = [];
|
|
1993
2003
|
if (enableGitignore) if (typeof enableGitignore !== "boolean") configs$1.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({
|
|
1994
2004
|
name: "gitignore",
|
|
@@ -2010,7 +2020,7 @@ function config(options = {}, ...userConfigs) {
|
|
|
2010
2020
|
}));
|
|
2011
2021
|
if (enableUnicorn) configs$1.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
|
|
2012
2022
|
if (enableVue) componentExts.push("vue");
|
|
2013
|
-
if (enableJsx) configs$1.push(jsx());
|
|
2023
|
+
if (enableJsx) configs$1.push(jsx(enableJsx === true ? {} : enableJsx));
|
|
2014
2024
|
if (enableTypeScript) configs$1.push(typescript({
|
|
2015
2025
|
...typescriptOptions,
|
|
2016
2026
|
componentExts,
|
|
@@ -2037,7 +2047,6 @@ function config(options = {}, ...userConfigs) {
|
|
|
2037
2047
|
...resolveSubOptions(options, "reactNative"),
|
|
2038
2048
|
overrides: getOverrides(options, "reactNative")
|
|
2039
2049
|
}));
|
|
2040
|
-
if (enableJsxA11y) configs$1.push(jsxA11y({ overrides: getOverrides(options, "jsxA11y") }));
|
|
2041
2050
|
if (enableNext) configs$1.push(next({ overrides: getOverrides(options, "next") }));
|
|
2042
2051
|
if (enableEffector) configs$1.push(effector({
|
|
2043
2052
|
...resolveSubOptions(options, "effector"),
|
|
@@ -2084,4 +2093,4 @@ function config(options = {}, ...userConfigs) {
|
|
|
2084
2093
|
var src_default = config;
|
|
2085
2094
|
|
|
2086
2095
|
//#endregion
|
|
2087
|
-
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_VUE, 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,
|
|
2096
|
+
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_VUE, 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, markdown, next, node, parserPlain, perfectionist, pnpm, react, reactNative, regexp, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, toml, typescript, unicorn, unocss, vue, yaml };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghettoddos/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"description": "ghettoDdOS ESLint config",
|
|
6
6
|
"author": "ghettoDdOS <pen.egor2002@gamil.com> (https://github.com/ghettoDdOS/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -77,25 +77,25 @@
|
|
|
77
77
|
"@eslint/compat": "^1.3.1",
|
|
78
78
|
"@eslint/markdown": "^7.1.0",
|
|
79
79
|
"@stylistic/eslint-plugin": "^5.2.2",
|
|
80
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
81
|
-
"@typescript-eslint/parser": "^8.
|
|
80
|
+
"@typescript-eslint/eslint-plugin": "^8.39.0",
|
|
81
|
+
"@typescript-eslint/parser": "^8.39.0",
|
|
82
82
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
83
|
-
"eslint-flat-config-utils": "^2.1.
|
|
83
|
+
"eslint-flat-config-utils": "^2.1.1",
|
|
84
84
|
"eslint-merge-processors": "^2.0.0",
|
|
85
85
|
"eslint-plugin-antfu": "^3.1.1",
|
|
86
86
|
"eslint-plugin-import-lite": "^0.3.0",
|
|
87
87
|
"eslint-plugin-import-x": "^4.16.1",
|
|
88
88
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
89
|
-
"eslint-plugin-n": "^17.21.
|
|
89
|
+
"eslint-plugin-n": "^17.21.3",
|
|
90
90
|
"eslint-plugin-perfectionist": "^4.15.0",
|
|
91
91
|
"eslint-plugin-pnpm": "^1.1.0",
|
|
92
92
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
93
93
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
94
|
-
"eslint-plugin-regexp": "^2.9.
|
|
94
|
+
"eslint-plugin-regexp": "^2.9.1",
|
|
95
95
|
"eslint-plugin-toml": "^0.12.0",
|
|
96
96
|
"eslint-plugin-unicorn": "^60.0.0",
|
|
97
97
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
98
|
-
"eslint-plugin-vue": "^10.
|
|
98
|
+
"eslint-plugin-vue": "^10.4.0",
|
|
99
99
|
"eslint-plugin-yml": "^1.18.0",
|
|
100
100
|
"eslint-processor-vue-blocks": "^2.0.0",
|
|
101
101
|
"globals": "^16.3.0",
|
|
@@ -108,25 +108,26 @@
|
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@eslint/config-inspector": "^1.1.0",
|
|
111
|
-
"@next/eslint-plugin-next": "^15.4.
|
|
111
|
+
"@next/eslint-plugin-next": "^15.4.5",
|
|
112
112
|
"@prettier/plugin-xml": "^3.4.2",
|
|
113
|
-
"@react-native/eslint-plugin": "^0.80.
|
|
114
|
-
"@types/
|
|
115
|
-
"@
|
|
116
|
-
"
|
|
117
|
-
"
|
|
113
|
+
"@react-native/eslint-plugin": "^0.80.2",
|
|
114
|
+
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
|
|
115
|
+
"@types/node": "^24.2.0",
|
|
116
|
+
"@unocss/eslint-plugin": "^66.4.1",
|
|
117
|
+
"bumpp": "^10.2.2",
|
|
118
|
+
"eslint": "^9.32.0",
|
|
118
119
|
"eslint-plugin-effector": "^0.15.0",
|
|
119
120
|
"eslint-plugin-expo": "^0.1.4",
|
|
120
121
|
"eslint-plugin-format": "^1.0.1",
|
|
121
122
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
122
123
|
"eslint-plugin-react-native": "^5.0.0",
|
|
123
124
|
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
124
|
-
"eslint-typegen": "^2.
|
|
125
|
-
"lint-staged": "^16.1.
|
|
126
|
-
"simple-git-hooks": "^2.13.
|
|
127
|
-
"tsdown": "^0.13.
|
|
125
|
+
"eslint-typegen": "^2.3.0",
|
|
126
|
+
"lint-staged": "^16.1.4",
|
|
127
|
+
"simple-git-hooks": "^2.13.1",
|
|
128
|
+
"tsdown": "^0.13.3",
|
|
128
129
|
"tsx": "^4.20.3",
|
|
129
|
-
"typescript": "^5.
|
|
130
|
+
"typescript": "^5.9.2"
|
|
130
131
|
},
|
|
131
132
|
"simple-git-hooks": {
|
|
132
133
|
"pre-commit": "npx lint-staged"
|