@ariestools/eslint-config-react-flat 8.6.11

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/LICENSE ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
package/README.md ADDED
@@ -0,0 +1,111 @@
1
+ [![logo][]](https://xylabs.com)
2
+
3
+ # @ariestools/eslint-config-react-flat
4
+
5
+ [![npm][npm-badge]][npm-link]
6
+ [![license][license-badge]][license-link]
7
+
8
+ > ESLint Config used throughout XY Labs TypeScript/JavaScript libraries and react projects
9
+
10
+ ## Install
11
+
12
+ Using npm:
13
+
14
+ ```sh
15
+ npm install -D {{name}}
16
+ ```
17
+
18
+ Using yarn:
19
+
20
+ ```sh
21
+ yarn add -D {{name}}
22
+ ```
23
+
24
+ Using pnpm:
25
+
26
+ ```sh
27
+ pnpm add -D {{name}}
28
+ ```
29
+
30
+ Using bun:
31
+
32
+ ```sh
33
+ bun add -D {{name}}
34
+ ```
35
+
36
+ ## Usage
37
+
38
+ Use this config in your `eslint.config.ts`:
39
+
40
+ ```ts
41
+ import {
42
+ configReactStorybook,
43
+ recommendedConfig,
44
+ } from '@ariestools/eslint-config-react-flat'
45
+
46
+ const xylabsConfig = recommendedConfig({ tier: 3, isTypeChecked: true })
47
+
48
+ export default [
49
+ ...xylabsConfig,
50
+ ...configReactStorybook,
51
+ ]
52
+ ```
53
+
54
+ `recommendedConfig` accepts `tier` (0–4, default `3`) and `isTypeChecked` (default `true`). Named `configReactTier*` exports remain available but are deprecated.
55
+
56
+ ### Tiered presets
57
+
58
+ React layers are added at **tier 2 (best practices)** and above. Lower tiers match `@ariestools/eslint-config-flat` without React rules.
59
+
60
+ | Export | Description |
61
+ |--------|-------------|
62
+ | `configReactTier0Correctness` / `configReactTier0CorrectnessTypeChecked` | Base tier 0 only |
63
+ | `configReactTier1Consistency` / `configReactTier1ConsistencyTypeChecked` | Base tier 1 only |
64
+ | `configReactTier2BestPractices` / `configReactTier2BestPracticesTypeChecked` | Base + React |
65
+ | `configReactTier3OpinionatedTypeChecked` | SonarJS + optional rules at error severity; preferred default |
66
+ | `configReactTier4Experimental` / `configReactTier4ExperimentalTypeChecked` | Opinionated + newly introduced unicorn rules as warnings |
67
+
68
+ `config` is deprecated. Use `configReactTier3OpinionatedTypeChecked` instead, and add `configReactStorybook` explicitly if needed.
69
+
70
+ ### Extending with custom rules
71
+
72
+ ```ts
73
+ import { configReactTier3OpinionatedTypeChecked } from '@ariestools/eslint-config-react-flat'
74
+
75
+ const eslintConfig = [
76
+ ...configReactTier3OpinionatedTypeChecked,
77
+ {
78
+ rules: {
79
+ // your overrides
80
+ },
81
+ },
82
+ ]
83
+
84
+ export default eslintConfig
85
+ ```
86
+
87
+ ## What's included
88
+
89
+ Everything from [`@ariestools/eslint-config-flat`](https://www.npmjs.com/package/@ariestools/eslint-config-flat), plus:
90
+
91
+ - React component and hooks linting via `eslint-plugin-react-x`
92
+ - DOM API validation via `eslint-plugin-react-dom`
93
+ - Enhanced hooks rules via `eslint-plugin-react-hooks-extra`
94
+ - Naming convention enforcement via `eslint-plugin-react-naming-convention`
95
+ - React Refresh validation via `eslint-plugin-react-refresh`
96
+ - Web API best practices via `eslint-plugin-react-web-api`
97
+
98
+
99
+ ## License
100
+
101
+ See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
102
+
103
+ ## Credits
104
+
105
+ [Made with 🔥 and ❄️ by XY Labs](https://xylabs.com)
106
+
107
+ [npm-badge]: https://img.shields.io/npm/v/@ariestools/eslint-config-react-flat.svg
108
+ [npm-link]: https://www.npmjs.com/package/@ariestools/eslint-config-react-flat
109
+ [license-badge]: https://img.shields.io/npm/l/@ariestools/eslint-config-react-flat.svg
110
+ [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
111
+ [logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg
@@ -0,0 +1,3 @@
1
+ export { storybookConfig } from './storybook/index.ts';
2
+ export * from './tiers/index.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,164 @@
1
+ // src/storybook/index.ts
2
+ import storybook from "eslint-plugin-storybook";
3
+ var storybookConfig = storybook.configs["flat/recommended"];
4
+
5
+ // src/tiers/recommendedConfig.ts
6
+ import {
7
+ applyRecommendedConfigTypeChecked as applyFlatRecommendedConfigTypeChecked,
8
+ parseRecommendedConfigSource as parseFlatRecommendedConfigSource,
9
+ recommendedConfig as flatRecommendedConfig,
10
+ resolveRecommendedConfigOptions
11
+ } from "@ariestools/eslint-config-flat";
12
+
13
+ // src/react/index.ts
14
+ import tsParser from "@typescript-eslint/parser";
15
+ import reactDomPlugin from "eslint-plugin-react-dom";
16
+ import reactHooksPlugin from "eslint-plugin-react-hooks";
17
+ import reactNamingConventionPlugin from "eslint-plugin-react-naming-convention";
18
+ import eslintReactRefreshPlugin from "eslint-plugin-react-refresh";
19
+ import reactWebApiPlugin from "eslint-plugin-react-web-api";
20
+ import reactPlugin from "eslint-plugin-react-x";
21
+ import globals from "globals";
22
+ var reactFiles = ["**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}"];
23
+ function currentWorkingDirectory() {
24
+ return globalThis.process?.cwd?.();
25
+ }
26
+ function typeCheckedParserOptions(isTypeChecked) {
27
+ if (!isTypeChecked) return {};
28
+ const tsconfigRootDir = currentWorkingDirectory();
29
+ const parserOptions = { projectService: true };
30
+ if (tsconfigRootDir !== void 0) {
31
+ parserOptions.tsconfigRootDir = tsconfigRootDir;
32
+ }
33
+ return parserOptions;
34
+ }
35
+ function scopeReactConfigs(configs, isTypeChecked = false) {
36
+ return (Array.isArray(configs) ? configs : [configs]).map((config2) => ({
37
+ ...config2,
38
+ files: reactFiles,
39
+ languageOptions: {
40
+ parser: tsParser,
41
+ ...config2.languageOptions,
42
+ globals: {
43
+ ...globals.browser,
44
+ ...config2.languageOptions?.globals
45
+ },
46
+ parserOptions: {
47
+ ecmaFeatures: { jsx: true },
48
+ ...config2.languageOptions?.parserOptions,
49
+ ...typeCheckedParserOptions(isTypeChecked)
50
+ }
51
+ }
52
+ }));
53
+ }
54
+ function createReactOverride(isTypeChecked = false) {
55
+ return {
56
+ files: reactFiles,
57
+ languageOptions: {
58
+ parser: tsParser,
59
+ parserOptions: {
60
+ ecmaFeatures: { jsx: true },
61
+ ...typeCheckedParserOptions(isTypeChecked)
62
+ },
63
+ globals: { ...globals.browser }
64
+ },
65
+ plugins: {
66
+ "react-dom": reactDomPlugin,
67
+ "react-web-api": reactWebApiPlugin,
68
+ "react-refresh": eslintReactRefreshPlugin,
69
+ "react-hooks": reactHooksPlugin,
70
+ "react-naming-convention": reactNamingConventionPlugin
71
+ },
72
+ rules: {
73
+ ...reactDomPlugin.configs.strict.rules,
74
+ ...reactWebApiPlugin.configs.recommended.rules,
75
+ ...reactHooksPlugin.configs.flat.recommended.rules,
76
+ ...reactNamingConventionPlugin.configs.recommended.rules,
77
+ ...eslintReactRefreshPlugin.configs.recommended.rules,
78
+ "react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
79
+ "react-hooks/use-memo": "warn",
80
+ "react-hooks/set-state-in-effect": "warn"
81
+ }
82
+ };
83
+ }
84
+ var reactBestPracticesConfig = [
85
+ ...scopeReactConfigs(reactPlugin.configs["strict-typescript"]),
86
+ createReactOverride()
87
+ ];
88
+ var reactBestPracticesTypeCheckedConfig = [
89
+ ...scopeReactConfigs(reactPlugin.configs["strict-type-checked"], true),
90
+ createReactOverride(true)
91
+ ];
92
+
93
+ // src/tiers/recommendedConfig.ts
94
+ import {
95
+ DEFAULT_RECOMMENDED_CONFIG_OPTIONS,
96
+ formatRecommendedConfigCall,
97
+ resolveRecommendedConfigOptions as resolveRecommendedConfigOptions2
98
+ } from "@ariestools/eslint-config-flat";
99
+ function mergeTierConfigs(...parts) {
100
+ return parts.flat();
101
+ }
102
+ function reactLayersForTier(tier, isTypeChecked) {
103
+ if (tier <= 1) return [];
104
+ return isTypeChecked ? [...reactBestPracticesTypeCheckedConfig] : [...reactBestPracticesConfig];
105
+ }
106
+ function recommendedConfig(options) {
107
+ const resolved = resolveRecommendedConfigOptions(options);
108
+ return mergeTierConfigs(
109
+ flatRecommendedConfig(resolved),
110
+ reactLayersForTier(resolved.tier, resolved.isTypeChecked)
111
+ );
112
+ }
113
+ function parseRecommendedConfigSource(source) {
114
+ return parseFlatRecommendedConfigSource(source);
115
+ }
116
+ function applyRecommendedConfigTypeChecked(source, isEnabled) {
117
+ return applyFlatRecommendedConfigTypeChecked(source, isEnabled);
118
+ }
119
+
120
+ // src/tiers/index.ts
121
+ function mergeTierConfigs2(...parts) {
122
+ return parts.flat();
123
+ }
124
+ var configReactStorybook = [...storybookConfig];
125
+ var configReactTier0Correctness = recommendedConfig({ tier: 0, isTypeChecked: false });
126
+ var configReactTier0CorrectnessTypeChecked = recommendedConfig({ tier: 0, isTypeChecked: true });
127
+ var configReactTier1Consistency = recommendedConfig({ tier: 1, isTypeChecked: false });
128
+ var configReactTier1ConsistencyTypeChecked = recommendedConfig({ tier: 1, isTypeChecked: true });
129
+ var configReactTier2BestPractices = recommendedConfig({ tier: 2, isTypeChecked: false });
130
+ var configReactTier2BestPracticesTypeChecked = recommendedConfig({ tier: 2, isTypeChecked: true });
131
+ var configReactTier3Opinionated = recommendedConfig({ tier: 3, isTypeChecked: false });
132
+ var configReactTier3OpinionatedTypeChecked = recommendedConfig({ tier: 3, isTypeChecked: true });
133
+ var configReactTier4Experimental = recommendedConfig({ tier: 4, isTypeChecked: false });
134
+ var configReactTier4ExperimentalTypeChecked = recommendedConfig({ tier: 4, isTypeChecked: true });
135
+ var recommendedTypeCheckedConfig = recommendedConfig({ tier: 2, isTypeChecked: true });
136
+ var recommendedTypeCheckedWithStorybookConfig = mergeTierConfigs2(
137
+ recommendedConfig({ tier: 2, isTypeChecked: true }),
138
+ configReactStorybook
139
+ );
140
+ var config = recommendedTypeCheckedWithStorybookConfig;
141
+ export {
142
+ DEFAULT_RECOMMENDED_CONFIG_OPTIONS,
143
+ applyRecommendedConfigTypeChecked,
144
+ config,
145
+ configReactStorybook,
146
+ configReactTier0Correctness,
147
+ configReactTier0CorrectnessTypeChecked,
148
+ configReactTier1Consistency,
149
+ configReactTier1ConsistencyTypeChecked,
150
+ configReactTier2BestPractices,
151
+ configReactTier2BestPracticesTypeChecked,
152
+ configReactTier3Opinionated,
153
+ configReactTier3OpinionatedTypeChecked,
154
+ configReactTier4Experimental,
155
+ configReactTier4ExperimentalTypeChecked,
156
+ formatRecommendedConfigCall,
157
+ parseRecommendedConfigSource,
158
+ recommendedConfig,
159
+ recommendedTypeCheckedConfig,
160
+ recommendedTypeCheckedWithStorybookConfig,
161
+ resolveRecommendedConfigOptions2 as resolveRecommendedConfigOptions,
162
+ storybookConfig
163
+ };
164
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/storybook/index.ts", "../../src/tiers/recommendedConfig.ts", "../../src/react/index.ts", "../../src/tiers/index.ts"],
4
+ "sourcesContent": ["import type { Linter } from 'eslint'\nimport storybook from 'eslint-plugin-storybook'\n\nexport const storybookConfig: Linter.Config[] = storybook.configs['flat/recommended'] as Linter.Config[]\n", "import {\n applyRecommendedConfigTypeChecked as applyFlatRecommendedConfigTypeChecked,\n type LintTier,\n parseRecommendedConfigSource as parseFlatRecommendedConfigSource,\n recommendedConfig as flatRecommendedConfig,\n type RecommendedConfigOptions,\n resolveRecommendedConfigOptions,\n} from '@ariestools/eslint-config-flat'\nimport type { Linter } from 'eslint'\n\nimport {\n reactBestPracticesConfig,\n reactBestPracticesTypeCheckedConfig,\n} from '../react/index.ts'\n\nexport type { LintTier, RecommendedConfigOptions } from '@ariestools/eslint-config-flat'\nexport {\n DEFAULT_RECOMMENDED_CONFIG_OPTIONS,\n formatRecommendedConfigCall,\n resolveRecommendedConfigOptions,\n} from '@ariestools/eslint-config-flat'\n\nfunction mergeTierConfigs(...parts: readonly Linter.Config[][]): Linter.Config[] {\n return parts.flat()\n}\n\nfunction reactLayersForTier(tier: LintTier, isTypeChecked: boolean): Linter.Config[] {\n if (tier <= 1) return []\n return isTypeChecked\n ? [...reactBestPracticesTypeCheckedConfig]\n : [...reactBestPracticesConfig]\n}\n\nexport function recommendedConfig(options?: RecommendedConfigOptions): Linter.Config[] {\n const resolved = resolveRecommendedConfigOptions(options)\n return mergeTierConfigs(\n flatRecommendedConfig(resolved),\n reactLayersForTier(resolved.tier, resolved.isTypeChecked),\n )\n}\n\nexport function parseRecommendedConfigSource(\n source: string,\n): { configKind: 'custom' | 'preset'; options: Required<RecommendedConfigOptions> } | undefined {\n return parseFlatRecommendedConfigSource(source)\n}\n\nexport function applyRecommendedConfigTypeChecked(source: string, isEnabled: boolean): string {\n return applyFlatRecommendedConfigTypeChecked(source, isEnabled)\n}\n", "import tsParser from '@typescript-eslint/parser'\nimport type { ESLint, Linter } from 'eslint'\nimport reactDomPlugin from 'eslint-plugin-react-dom'\nimport reactHooksPlugin from 'eslint-plugin-react-hooks'\nimport reactNamingConventionPlugin from 'eslint-plugin-react-naming-convention'\nimport eslintReactRefreshPlugin from 'eslint-plugin-react-refresh'\nimport reactWebApiPlugin from 'eslint-plugin-react-web-api'\nimport reactPlugin from 'eslint-plugin-react-x'\nimport globals from 'globals'\n\nconst reactFiles = ['**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}']\n\nfunction currentWorkingDirectory(): string | undefined {\n return (globalThis as { process?: { cwd?: () => string } }).process?.cwd?.()\n}\n\nfunction typeCheckedParserOptions(isTypeChecked: boolean): Record<string, unknown> {\n if (!isTypeChecked) return {}\n const tsconfigRootDir = currentWorkingDirectory()\n const parserOptions: Record<string, unknown> = { projectService: true }\n if (tsconfigRootDir !== undefined) {\n parserOptions.tsconfigRootDir = tsconfigRootDir\n }\n return parserOptions\n}\n\nfunction scopeReactConfigs(\n configs: Linter.Config | Linter.Config[],\n isTypeChecked = false,\n): Linter.Config[] {\n return (Array.isArray(configs) ? configs : [configs]).map(config => ({\n ...config,\n files: reactFiles,\n languageOptions: {\n parser: tsParser,\n ...config.languageOptions,\n globals: {\n ...(globals.browser as Record<string, boolean>),\n ...(config.languageOptions?.globals as Record<string, unknown> | undefined),\n },\n parserOptions: {\n ecmaFeatures: { jsx: true },\n ...(config.languageOptions?.parserOptions as Record<string, unknown> | undefined),\n ...typeCheckedParserOptions(isTypeChecked),\n },\n },\n }))\n}\n\nfunction createReactOverride(isTypeChecked = false): Linter.Config {\n return {\n files: reactFiles,\n languageOptions: {\n parser: tsParser,\n parserOptions: {\n ecmaFeatures: { jsx: true },\n ...typeCheckedParserOptions(isTypeChecked),\n },\n globals: { ...globals.browser },\n },\n plugins: {\n 'react-dom': reactDomPlugin,\n 'react-web-api': reactWebApiPlugin,\n 'react-refresh': eslintReactRefreshPlugin,\n 'react-hooks': reactHooksPlugin as unknown as ESLint.Plugin,\n 'react-naming-convention': reactNamingConventionPlugin,\n },\n rules: {\n ...reactDomPlugin.configs.strict.rules,\n ...reactWebApiPlugin.configs.recommended.rules,\n ...reactHooksPlugin.configs.flat.recommended.rules,\n ...reactNamingConventionPlugin.configs.recommended.rules,\n ...eslintReactRefreshPlugin.configs.recommended.rules,\n 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],\n 'react-hooks/use-memo': 'warn',\n 'react-hooks/set-state-in-effect': 'warn',\n },\n }\n}\n\nexport const reactBestPracticesConfig: Linter.Config[] = [\n ...scopeReactConfigs(reactPlugin.configs['strict-typescript']),\n createReactOverride(),\n]\n\nexport const reactBestPracticesTypeCheckedConfig: Linter.Config[] = [\n ...scopeReactConfigs(reactPlugin.configs['strict-type-checked'], true),\n createReactOverride(true),\n]\n\nexport const reactConfig: Linter.Config[] = reactBestPracticesTypeCheckedConfig\n", "import type { Linter } from 'eslint'\n\nexport {\n applyRecommendedConfigTypeChecked,\n DEFAULT_RECOMMENDED_CONFIG_OPTIONS,\n formatRecommendedConfigCall,\n type LintTier,\n parseRecommendedConfigSource,\n recommendedConfig,\n type RecommendedConfigOptions,\n resolveRecommendedConfigOptions,\n} from './recommendedConfig.ts'\n\nimport { storybookConfig } from '../storybook/index.ts'\nimport { recommendedConfig } from './recommendedConfig.ts'\n\nfunction mergeTierConfigs(...parts: readonly Linter.Config[][]): Linter.Config[] {\n return parts.flat()\n}\n\nexport const configReactStorybook: Linter.Config[] = [...storybookConfig]\n\n/** @deprecated Use `recommendedConfig({ tier: 0, isTypeChecked: false })` instead. */\nexport const configReactTier0Correctness: Linter.Config[] = recommendedConfig({ tier: 0, isTypeChecked: false })\n\n/** @deprecated Use `recommendedConfig({ tier: 0, isTypeChecked: true })` instead. */\nexport const configReactTier0CorrectnessTypeChecked: Linter.Config[] = recommendedConfig({ tier: 0, isTypeChecked: true })\n\n/** @deprecated Use `recommendedConfig({ tier: 1, isTypeChecked: false })` instead. */\nexport const configReactTier1Consistency: Linter.Config[] = recommendedConfig({ tier: 1, isTypeChecked: false })\n\n/** @deprecated Use `recommendedConfig({ tier: 1, isTypeChecked: true })` instead. */\nexport const configReactTier1ConsistencyTypeChecked: Linter.Config[] = recommendedConfig({ tier: 1, isTypeChecked: true })\n\n/** @deprecated Use `recommendedConfig({ tier: 2, isTypeChecked: false })` instead. */\nexport const configReactTier2BestPractices: Linter.Config[] = recommendedConfig({ tier: 2, isTypeChecked: false })\n\n/** @deprecated Use `recommendedConfig({ tier: 2, isTypeChecked: true })` instead. */\nexport const configReactTier2BestPracticesTypeChecked: Linter.Config[] = recommendedConfig({ tier: 2, isTypeChecked: true })\n\n/** @deprecated Use `recommendedConfig({ tier: 3, isTypeChecked: false })` instead. */\nexport const configReactTier3Opinionated: Linter.Config[] = recommendedConfig({ tier: 3, isTypeChecked: false })\n\n/** @deprecated Use `recommendedConfig({ tier: 3, isTypeChecked: true })` instead. */\nexport const configReactTier3OpinionatedTypeChecked: Linter.Config[] = recommendedConfig({ tier: 3, isTypeChecked: true })\n\n/** @deprecated Use `recommendedConfig({ tier: 4, isTypeChecked: false })` instead. */\nexport const configReactTier4Experimental: Linter.Config[] = recommendedConfig({ tier: 4, isTypeChecked: false })\n\n/** @deprecated Use `recommendedConfig({ tier: 4, isTypeChecked: true })` instead. */\nexport const configReactTier4ExperimentalTypeChecked: Linter.Config[] = recommendedConfig({ tier: 4, isTypeChecked: true })\n\n/** @deprecated Use `recommendedConfig({ tier: 2, isTypeChecked: true })` instead. */\nexport const recommendedTypeCheckedConfig: Linter.Config[] = recommendedConfig({ tier: 2, isTypeChecked: true })\n\nexport const recommendedTypeCheckedWithStorybookConfig: Linter.Config[] = mergeTierConfigs(\n recommendedConfig({ tier: 2, isTypeChecked: true }),\n configReactStorybook,\n)\n\n/** @deprecated Use `recommendedConfig({ tier: 3, isTypeChecked: true })` plus `configReactStorybook` if needed. */\nexport const config: Linter.Config[] = recommendedTypeCheckedWithStorybookConfig\n"],
5
+ "mappings": ";AACA,OAAO,eAAe;AAEf,IAAM,kBAAmC,UAAU,QAAQ,kBAAkB;;;ACHpF;AAAA,EACE,qCAAqC;AAAA,EAErC,gCAAgC;AAAA,EAChC,qBAAqB;AAAA,EAErB;AAAA,OACK;;;ACPP,OAAO,cAAc;AAErB,OAAO,oBAAoB;AAC3B,OAAO,sBAAsB;AAC7B,OAAO,iCAAiC;AACxC,OAAO,8BAA8B;AACrC,OAAO,uBAAuB;AAC9B,OAAO,iBAAiB;AACxB,OAAO,aAAa;AAEpB,IAAM,aAAa,CAAC,sCAAsC;AAE1D,SAAS,0BAA8C;AACrD,SAAQ,WAAoD,SAAS,MAAM;AAC7E;AAEA,SAAS,yBAAyB,eAAiD;AACjF,MAAI,CAAC,cAAe,QAAO,CAAC;AAC5B,QAAM,kBAAkB,wBAAwB;AAChD,QAAM,gBAAyC,EAAE,gBAAgB,KAAK;AACtE,MAAI,oBAAoB,QAAW;AACjC,kBAAc,kBAAkB;AAAA,EAClC;AACA,SAAO;AACT;AAEA,SAAS,kBACP,SACA,gBAAgB,OACC;AACjB,UAAQ,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,GAAG,IAAI,CAAAA,aAAW;AAAA,IACnE,GAAGA;AAAA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;AAGlH,IAAM,+BAAgD,kBAAkB,EAAE,MAAM,GAAG,eAAe,MAAM,CAAC;AAGzG,IAAM,0CAA2D,kBAAkB,EAAE,MAAM,GAAG,eAAe,KAAK,CAAC;AAGnH,IAAM,+BAAgD,kBAAkB,EAAE,MAAM,GAAG,eAAe,KAAK,CAAC;AAExG,IAAM,4CAA6DA;AAAA,EACxE,kBAAkB,EAAE,MAAM,GAAG,eAAe,KAAK,CAAC;AAAA,EAClD;AACF;AAGO,IAAM,SAA0B;",
6
+ "names": ["config", "resolveRecommendedConfigOptions", "mergeTierConfigs"]
7
+ }
@@ -0,0 +1,5 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const reactBestPracticesConfig: Linter.Config[];
3
+ export declare const reactBestPracticesTypeCheckedConfig: Linter.Config[];
4
+ export declare const reactConfig: Linter.Config[];
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AA+E5C,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAGnD,CAAA;AAED,eAAO,MAAM,mCAAmC,EAAE,MAAM,CAAC,MAAM,EAG9D,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAwC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const storybookConfig: Linter.Config[];
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storybook/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAGpC,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAA6D,CAAA"}
@@ -0,0 +1,29 @@
1
+ import type { Linter } from 'eslint';
2
+ export { applyRecommendedConfigTypeChecked, DEFAULT_RECOMMENDED_CONFIG_OPTIONS, formatRecommendedConfigCall, type LintTier, parseRecommendedConfigSource, recommendedConfig, type RecommendedConfigOptions, resolveRecommendedConfigOptions, } from './recommendedConfig.ts';
3
+ export declare const configReactStorybook: Linter.Config[];
4
+ /** @deprecated Use `recommendedConfig({ tier: 0, isTypeChecked: false })` instead. */
5
+ export declare const configReactTier0Correctness: Linter.Config[];
6
+ /** @deprecated Use `recommendedConfig({ tier: 0, isTypeChecked: true })` instead. */
7
+ export declare const configReactTier0CorrectnessTypeChecked: Linter.Config[];
8
+ /** @deprecated Use `recommendedConfig({ tier: 1, isTypeChecked: false })` instead. */
9
+ export declare const configReactTier1Consistency: Linter.Config[];
10
+ /** @deprecated Use `recommendedConfig({ tier: 1, isTypeChecked: true })` instead. */
11
+ export declare const configReactTier1ConsistencyTypeChecked: Linter.Config[];
12
+ /** @deprecated Use `recommendedConfig({ tier: 2, isTypeChecked: false })` instead. */
13
+ export declare const configReactTier2BestPractices: Linter.Config[];
14
+ /** @deprecated Use `recommendedConfig({ tier: 2, isTypeChecked: true })` instead. */
15
+ export declare const configReactTier2BestPracticesTypeChecked: Linter.Config[];
16
+ /** @deprecated Use `recommendedConfig({ tier: 3, isTypeChecked: false })` instead. */
17
+ export declare const configReactTier3Opinionated: Linter.Config[];
18
+ /** @deprecated Use `recommendedConfig({ tier: 3, isTypeChecked: true })` instead. */
19
+ export declare const configReactTier3OpinionatedTypeChecked: Linter.Config[];
20
+ /** @deprecated Use `recommendedConfig({ tier: 4, isTypeChecked: false })` instead. */
21
+ export declare const configReactTier4Experimental: Linter.Config[];
22
+ /** @deprecated Use `recommendedConfig({ tier: 4, isTypeChecked: true })` instead. */
23
+ export declare const configReactTier4ExperimentalTypeChecked: Linter.Config[];
24
+ /** @deprecated Use `recommendedConfig({ tier: 2, isTypeChecked: true })` instead. */
25
+ export declare const recommendedTypeCheckedConfig: Linter.Config[];
26
+ export declare const recommendedTypeCheckedWithStorybookConfig: Linter.Config[];
27
+ /** @deprecated Use `recommendedConfig({ tier: 3, isTypeChecked: true })` plus `configReactStorybook` if needed. */
28
+ export declare const config: Linter.Config[];
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tiers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,2BAA2B,EAC3B,KAAK,QAAQ,EACb,4BAA4B,EAC5B,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,+BAA+B,GAChC,MAAM,wBAAwB,CAAA;AAS/B,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAyB,CAAA;AAEzE,sFAAsF;AACtF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAyD,CAAA;AAEhH,qFAAqF;AACrF,eAAO,MAAM,sCAAsC,EAAE,MAAM,CAAC,MAAM,EAAwD,CAAA;AAE1H,sFAAsF;AACtF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAyD,CAAA;AAEhH,qFAAqF;AACrF,eAAO,MAAM,sCAAsC,EAAE,MAAM,CAAC,MAAM,EAAwD,CAAA;AAE1H,sFAAsF;AACtF,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAyD,CAAA;AAElH,qFAAqF;AACrF,eAAO,MAAM,wCAAwC,EAAE,MAAM,CAAC,MAAM,EAAwD,CAAA;AAE5H,sFAAsF;AACtF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAyD,CAAA;AAEhH,qFAAqF;AACrF,eAAO,MAAM,sCAAsC,EAAE,MAAM,CAAC,MAAM,EAAwD,CAAA;AAE1H,sFAAsF;AACtF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAyD,CAAA;AAEjH,qFAAqF;AACrF,eAAO,MAAM,uCAAuC,EAAE,MAAM,CAAC,MAAM,EAAwD,CAAA;AAE3H,qFAAqF;AACrF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAwD,CAAA;AAEhH,eAAO,MAAM,yCAAyC,EAAE,MAAM,CAAC,MAAM,EAGpE,CAAA;AAED,mHAAmH;AACnH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAA8C,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { type RecommendedConfigOptions } from '@ariestools/eslint-config-flat';
2
+ import type { Linter } from 'eslint';
3
+ export type { LintTier, RecommendedConfigOptions } from '@ariestools/eslint-config-flat';
4
+ export { DEFAULT_RECOMMENDED_CONFIG_OPTIONS, formatRecommendedConfigCall, resolveRecommendedConfigOptions, } from '@ariestools/eslint-config-flat';
5
+ export declare function recommendedConfig(options?: RecommendedConfigOptions): Linter.Config[];
6
+ export declare function parseRecommendedConfigSource(source: string): {
7
+ configKind: 'custom' | 'preset';
8
+ options: Required<RecommendedConfigOptions>;
9
+ } | undefined;
10
+ export declare function applyRecommendedConfigTypeChecked(source: string, isEnabled: boolean): string;
11
+ //# sourceMappingURL=recommendedConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recommendedConfig.d.ts","sourceRoot":"","sources":["../../../src/tiers/recommendedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,wBAAwB,EAE9B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAOpC,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AACxF,OAAO,EACL,kCAAkC,EAClC,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,gCAAgC,CAAA;AAavC,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,CAMrF;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,MAAM,GACb;IAAE,UAAU,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAA;CAAE,GAAG,SAAS,CAE9F;AAED,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAE5F"}
@@ -0,0 +1,3 @@
1
+ export { storybookConfig } from './storybook/index.ts';
2
+ export * from './tiers/index.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,164 @@
1
+ // src/storybook/index.ts
2
+ import storybook from "eslint-plugin-storybook";
3
+ var storybookConfig = storybook.configs["flat/recommended"];
4
+
5
+ // src/tiers/recommendedConfig.ts
6
+ import {
7
+ applyRecommendedConfigTypeChecked as applyFlatRecommendedConfigTypeChecked,
8
+ parseRecommendedConfigSource as parseFlatRecommendedConfigSource,
9
+ recommendedConfig as flatRecommendedConfig,
10
+ resolveRecommendedConfigOptions
11
+ } from "@ariestools/eslint-config-flat";
12
+
13
+ // src/react/index.ts
14
+ import tsParser from "@typescript-eslint/parser";
15
+ import reactDomPlugin from "eslint-plugin-react-dom";
16
+ import reactHooksPlugin from "eslint-plugin-react-hooks";
17
+ import reactNamingConventionPlugin from "eslint-plugin-react-naming-convention";
18
+ import eslintReactRefreshPlugin from "eslint-plugin-react-refresh";
19
+ import reactWebApiPlugin from "eslint-plugin-react-web-api";
20
+ import reactPlugin from "eslint-plugin-react-x";
21
+ import globals from "globals";
22
+ var reactFiles = ["**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}"];
23
+ function currentWorkingDirectory() {
24
+ return globalThis.process?.cwd?.();
25
+ }
26
+ function typeCheckedParserOptions(isTypeChecked) {
27
+ if (!isTypeChecked) return {};
28
+ const tsconfigRootDir = currentWorkingDirectory();
29
+ const parserOptions = { projectService: true };
30
+ if (tsconfigRootDir !== void 0) {
31
+ parserOptions.tsconfigRootDir = tsconfigRootDir;
32
+ }
33
+ return parserOptions;
34
+ }
35
+ function scopeReactConfigs(configs, isTypeChecked = false) {
36
+ return (Array.isArray(configs) ? configs : [configs]).map((config2) => ({
37
+ ...config2,
38
+ files: reactFiles,
39
+ languageOptions: {
40
+ parser: tsParser,
41
+ ...config2.languageOptions,
42
+ globals: {
43
+ ...globals.browser,
44
+ ...config2.languageOptions?.globals
45
+ },
46
+ parserOptions: {
47
+ ecmaFeatures: { jsx: true },
48
+ ...config2.languageOptions?.parserOptions,
49
+ ...typeCheckedParserOptions(isTypeChecked)
50
+ }
51
+ }
52
+ }));
53
+ }
54
+ function createReactOverride(isTypeChecked = false) {
55
+ return {
56
+ files: reactFiles,
57
+ languageOptions: {
58
+ parser: tsParser,
59
+ parserOptions: {
60
+ ecmaFeatures: { jsx: true },
61
+ ...typeCheckedParserOptions(isTypeChecked)
62
+ },
63
+ globals: { ...globals.browser }
64
+ },
65
+ plugins: {
66
+ "react-dom": reactDomPlugin,
67
+ "react-web-api": reactWebApiPlugin,
68
+ "react-refresh": eslintReactRefreshPlugin,
69
+ "react-hooks": reactHooksPlugin,
70
+ "react-naming-convention": reactNamingConventionPlugin
71
+ },
72
+ rules: {
73
+ ...reactDomPlugin.configs.strict.rules,
74
+ ...reactWebApiPlugin.configs.recommended.rules,
75
+ ...reactHooksPlugin.configs.flat.recommended.rules,
76
+ ...reactNamingConventionPlugin.configs.recommended.rules,
77
+ ...eslintReactRefreshPlugin.configs.recommended.rules,
78
+ "react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
79
+ "react-hooks/use-memo": "warn",
80
+ "react-hooks/set-state-in-effect": "warn"
81
+ }
82
+ };
83
+ }
84
+ var reactBestPracticesConfig = [
85
+ ...scopeReactConfigs(reactPlugin.configs["strict-typescript"]),
86
+ createReactOverride()
87
+ ];
88
+ var reactBestPracticesTypeCheckedConfig = [
89
+ ...scopeReactConfigs(reactPlugin.configs["strict-type-checked"], true),
90
+ createReactOverride(true)
91
+ ];
92
+
93
+ // src/tiers/recommendedConfig.ts
94
+ import {
95
+ DEFAULT_RECOMMENDED_CONFIG_OPTIONS,
96
+ formatRecommendedConfigCall,
97
+ resolveRecommendedConfigOptions as resolveRecommendedConfigOptions2
98
+ } from "@ariestools/eslint-config-flat";
99
+ function mergeTierConfigs(...parts) {
100
+ return parts.flat();
101
+ }
102
+ function reactLayersForTier(tier, isTypeChecked) {
103
+ if (tier <= 1) return [];
104
+ return isTypeChecked ? [...reactBestPracticesTypeCheckedConfig] : [...reactBestPracticesConfig];
105
+ }
106
+ function recommendedConfig(options) {
107
+ const resolved = resolveRecommendedConfigOptions(options);
108
+ return mergeTierConfigs(
109
+ flatRecommendedConfig(resolved),
110
+ reactLayersForTier(resolved.tier, resolved.isTypeChecked)
111
+ );
112
+ }
113
+ function parseRecommendedConfigSource(source) {
114
+ return parseFlatRecommendedConfigSource(source);
115
+ }
116
+ function applyRecommendedConfigTypeChecked(source, isEnabled) {
117
+ return applyFlatRecommendedConfigTypeChecked(source, isEnabled);
118
+ }
119
+
120
+ // src/tiers/index.ts
121
+ function mergeTierConfigs2(...parts) {
122
+ return parts.flat();
123
+ }
124
+ var configReactStorybook = [...storybookConfig];
125
+ var configReactTier0Correctness = recommendedConfig({ tier: 0, isTypeChecked: false });
126
+ var configReactTier0CorrectnessTypeChecked = recommendedConfig({ tier: 0, isTypeChecked: true });
127
+ var configReactTier1Consistency = recommendedConfig({ tier: 1, isTypeChecked: false });
128
+ var configReactTier1ConsistencyTypeChecked = recommendedConfig({ tier: 1, isTypeChecked: true });
129
+ var configReactTier2BestPractices = recommendedConfig({ tier: 2, isTypeChecked: false });
130
+ var configReactTier2BestPracticesTypeChecked = recommendedConfig({ tier: 2, isTypeChecked: true });
131
+ var configReactTier3Opinionated = recommendedConfig({ tier: 3, isTypeChecked: false });
132
+ var configReactTier3OpinionatedTypeChecked = recommendedConfig({ tier: 3, isTypeChecked: true });
133
+ var configReactTier4Experimental = recommendedConfig({ tier: 4, isTypeChecked: false });
134
+ var configReactTier4ExperimentalTypeChecked = recommendedConfig({ tier: 4, isTypeChecked: true });
135
+ var recommendedTypeCheckedConfig = recommendedConfig({ tier: 2, isTypeChecked: true });
136
+ var recommendedTypeCheckedWithStorybookConfig = mergeTierConfigs2(
137
+ recommendedConfig({ tier: 2, isTypeChecked: true }),
138
+ configReactStorybook
139
+ );
140
+ var config = recommendedTypeCheckedWithStorybookConfig;
141
+ export {
142
+ DEFAULT_RECOMMENDED_CONFIG_OPTIONS,
143
+ applyRecommendedConfigTypeChecked,
144
+ config,
145
+ configReactStorybook,
146
+ configReactTier0Correctness,
147
+ configReactTier0CorrectnessTypeChecked,
148
+ configReactTier1Consistency,
149
+ configReactTier1ConsistencyTypeChecked,
150
+ configReactTier2BestPractices,
151
+ configReactTier2BestPracticesTypeChecked,
152
+ configReactTier3Opinionated,
153
+ configReactTier3OpinionatedTypeChecked,
154
+ configReactTier4Experimental,
155
+ configReactTier4ExperimentalTypeChecked,
156
+ formatRecommendedConfigCall,
157
+ parseRecommendedConfigSource,
158
+ recommendedConfig,
159
+ recommendedTypeCheckedConfig,
160
+ recommendedTypeCheckedWithStorybookConfig,
161
+ resolveRecommendedConfigOptions2 as resolveRecommendedConfigOptions,
162
+ storybookConfig
163
+ };
164
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/storybook/index.ts", "../../src/tiers/recommendedConfig.ts", "../../src/react/index.ts", "../../src/tiers/index.ts"],
4
+ "sourcesContent": ["import type { Linter } from 'eslint'\nimport storybook from 'eslint-plugin-storybook'\n\nexport const storybookConfig: Linter.Config[] = storybook.configs['flat/recommended'] as Linter.Config[]\n", "import {\n applyRecommendedConfigTypeChecked as applyFlatRecommendedConfigTypeChecked,\n type LintTier,\n parseRecommendedConfigSource as parseFlatRecommendedConfigSource,\n recommendedConfig as flatRecommendedConfig,\n type RecommendedConfigOptions,\n resolveRecommendedConfigOptions,\n} from '@ariestools/eslint-config-flat'\nimport type { Linter } from 'eslint'\n\nimport {\n reactBestPracticesConfig,\n reactBestPracticesTypeCheckedConfig,\n} from '../react/index.ts'\n\nexport type { LintTier, RecommendedConfigOptions } from '@ariestools/eslint-config-flat'\nexport {\n DEFAULT_RECOMMENDED_CONFIG_OPTIONS,\n formatRecommendedConfigCall,\n resolveRecommendedConfigOptions,\n} from '@ariestools/eslint-config-flat'\n\nfunction mergeTierConfigs(...parts: readonly Linter.Config[][]): Linter.Config[] {\n return parts.flat()\n}\n\nfunction reactLayersForTier(tier: LintTier, isTypeChecked: boolean): Linter.Config[] {\n if (tier <= 1) return []\n return isTypeChecked\n ? [...reactBestPracticesTypeCheckedConfig]\n : [...reactBestPracticesConfig]\n}\n\nexport function recommendedConfig(options?: RecommendedConfigOptions): Linter.Config[] {\n const resolved = resolveRecommendedConfigOptions(options)\n return mergeTierConfigs(\n flatRecommendedConfig(resolved),\n reactLayersForTier(resolved.tier, resolved.isTypeChecked),\n )\n}\n\nexport function parseRecommendedConfigSource(\n source: string,\n): { configKind: 'custom' | 'preset'; options: Required<RecommendedConfigOptions> } | undefined {\n return parseFlatRecommendedConfigSource(source)\n}\n\nexport function applyRecommendedConfigTypeChecked(source: string, isEnabled: boolean): string {\n return applyFlatRecommendedConfigTypeChecked(source, isEnabled)\n}\n", "import tsParser from '@typescript-eslint/parser'\nimport type { ESLint, Linter } from 'eslint'\nimport reactDomPlugin from 'eslint-plugin-react-dom'\nimport reactHooksPlugin from 'eslint-plugin-react-hooks'\nimport reactNamingConventionPlugin from 'eslint-plugin-react-naming-convention'\nimport eslintReactRefreshPlugin from 'eslint-plugin-react-refresh'\nimport reactWebApiPlugin from 'eslint-plugin-react-web-api'\nimport reactPlugin from 'eslint-plugin-react-x'\nimport globals from 'globals'\n\nconst reactFiles = ['**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}']\n\nfunction currentWorkingDirectory(): string | undefined {\n return (globalThis as { process?: { cwd?: () => string } }).process?.cwd?.()\n}\n\nfunction typeCheckedParserOptions(isTypeChecked: boolean): Record<string, unknown> {\n if (!isTypeChecked) return {}\n const tsconfigRootDir = currentWorkingDirectory()\n const parserOptions: Record<string, unknown> = { projectService: true }\n if (tsconfigRootDir !== undefined) {\n parserOptions.tsconfigRootDir = tsconfigRootDir\n }\n return parserOptions\n}\n\nfunction scopeReactConfigs(\n configs: Linter.Config | Linter.Config[],\n isTypeChecked = false,\n): Linter.Config[] {\n return (Array.isArray(configs) ? configs : [configs]).map(config => ({\n ...config,\n files: reactFiles,\n languageOptions: {\n parser: tsParser,\n ...config.languageOptions,\n globals: {\n ...(globals.browser as Record<string, boolean>),\n ...(config.languageOptions?.globals as Record<string, unknown> | undefined),\n },\n parserOptions: {\n ecmaFeatures: { jsx: true },\n ...(config.languageOptions?.parserOptions as Record<string, unknown> | undefined),\n ...typeCheckedParserOptions(isTypeChecked),\n },\n },\n }))\n}\n\nfunction createReactOverride(isTypeChecked = false): Linter.Config {\n return {\n files: reactFiles,\n languageOptions: {\n parser: tsParser,\n parserOptions: {\n ecmaFeatures: { jsx: true },\n ...typeCheckedParserOptions(isTypeChecked),\n },\n globals: { ...globals.browser },\n },\n plugins: {\n 'react-dom': reactDomPlugin,\n 'react-web-api': reactWebApiPlugin,\n 'react-refresh': eslintReactRefreshPlugin,\n 'react-hooks': reactHooksPlugin as unknown as ESLint.Plugin,\n 'react-naming-convention': reactNamingConventionPlugin,\n },\n rules: {\n ...reactDomPlugin.configs.strict.rules,\n ...reactWebApiPlugin.configs.recommended.rules,\n ...reactHooksPlugin.configs.flat.recommended.rules,\n ...reactNamingConventionPlugin.configs.recommended.rules,\n ...eslintReactRefreshPlugin.configs.recommended.rules,\n 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],\n 'react-hooks/use-memo': 'warn',\n 'react-hooks/set-state-in-effect': 'warn',\n },\n }\n}\n\nexport const reactBestPracticesConfig: Linter.Config[] = [\n ...scopeReactConfigs(reactPlugin.configs['strict-typescript']),\n createReactOverride(),\n]\n\nexport const reactBestPracticesTypeCheckedConfig: Linter.Config[] = [\n ...scopeReactConfigs(reactPlugin.configs['strict-type-checked'], true),\n createReactOverride(true),\n]\n\nexport const reactConfig: Linter.Config[] = reactBestPracticesTypeCheckedConfig\n", "import type { Linter } from 'eslint'\n\nexport {\n applyRecommendedConfigTypeChecked,\n DEFAULT_RECOMMENDED_CONFIG_OPTIONS,\n formatRecommendedConfigCall,\n type LintTier,\n parseRecommendedConfigSource,\n recommendedConfig,\n type RecommendedConfigOptions,\n resolveRecommendedConfigOptions,\n} from './recommendedConfig.ts'\n\nimport { storybookConfig } from '../storybook/index.ts'\nimport { recommendedConfig } from './recommendedConfig.ts'\n\nfunction mergeTierConfigs(...parts: readonly Linter.Config[][]): Linter.Config[] {\n return parts.flat()\n}\n\nexport const configReactStorybook: Linter.Config[] = [...storybookConfig]\n\n/** @deprecated Use `recommendedConfig({ tier: 0, isTypeChecked: false })` instead. */\nexport const configReactTier0Correctness: Linter.Config[] = recommendedConfig({ tier: 0, isTypeChecked: false })\n\n/** @deprecated Use `recommendedConfig({ tier: 0, isTypeChecked: true })` instead. */\nexport const configReactTier0CorrectnessTypeChecked: Linter.Config[] = recommendedConfig({ tier: 0, isTypeChecked: true })\n\n/** @deprecated Use `recommendedConfig({ tier: 1, isTypeChecked: false })` instead. */\nexport const configReactTier1Consistency: Linter.Config[] = recommendedConfig({ tier: 1, isTypeChecked: false })\n\n/** @deprecated Use `recommendedConfig({ tier: 1, isTypeChecked: true })` instead. */\nexport const configReactTier1ConsistencyTypeChecked: Linter.Config[] = recommendedConfig({ tier: 1, isTypeChecked: true })\n\n/** @deprecated Use `recommendedConfig({ tier: 2, isTypeChecked: false })` instead. */\nexport const configReactTier2BestPractices: Linter.Config[] = recommendedConfig({ tier: 2, isTypeChecked: false })\n\n/** @deprecated Use `recommendedConfig({ tier: 2, isTypeChecked: true })` instead. */\nexport const configReactTier2BestPracticesTypeChecked: Linter.Config[] = recommendedConfig({ tier: 2, isTypeChecked: true })\n\n/** @deprecated Use `recommendedConfig({ tier: 3, isTypeChecked: false })` instead. */\nexport const configReactTier3Opinionated: Linter.Config[] = recommendedConfig({ tier: 3, isTypeChecked: false })\n\n/** @deprecated Use `recommendedConfig({ tier: 3, isTypeChecked: true })` instead. */\nexport const configReactTier3OpinionatedTypeChecked: Linter.Config[] = recommendedConfig({ tier: 3, isTypeChecked: true })\n\n/** @deprecated Use `recommendedConfig({ tier: 4, isTypeChecked: false })` instead. */\nexport const configReactTier4Experimental: Linter.Config[] = recommendedConfig({ tier: 4, isTypeChecked: false })\n\n/** @deprecated Use `recommendedConfig({ tier: 4, isTypeChecked: true })` instead. */\nexport const configReactTier4ExperimentalTypeChecked: Linter.Config[] = recommendedConfig({ tier: 4, isTypeChecked: true })\n\n/** @deprecated Use `recommendedConfig({ tier: 2, isTypeChecked: true })` instead. */\nexport const recommendedTypeCheckedConfig: Linter.Config[] = recommendedConfig({ tier: 2, isTypeChecked: true })\n\nexport const recommendedTypeCheckedWithStorybookConfig: Linter.Config[] = mergeTierConfigs(\n recommendedConfig({ tier: 2, isTypeChecked: true }),\n configReactStorybook,\n)\n\n/** @deprecated Use `recommendedConfig({ tier: 3, isTypeChecked: true })` plus `configReactStorybook` if needed. */\nexport const config: Linter.Config[] = recommendedTypeCheckedWithStorybookConfig\n"],
5
+ "mappings": ";AACA,OAAO,eAAe;AAEf,IAAM,kBAAmC,UAAU,QAAQ,kBAAkB;;;ACHpF;AAAA,EACE,qCAAqC;AAAA,EAErC,gCAAgC;AAAA,EAChC,qBAAqB;AAAA,EAErB;AAAA,OACK;;;ACPP,OAAO,cAAc;AAErB,OAAO,oBAAoB;AAC3B,OAAO,sBAAsB;AAC7B,OAAO,iCAA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Ae;AAGjE,IAAM,8BAA+C,kBAAkB,EAAE,MAAM,GAAG,eAAe,MAAM,CAAC;AAGxG,IAAM,yCAA0D,kBAAkB,EAAE,MAAM,GAAG,eAAe,KAAK,CAAC;AAGlH,IAAM,8BAA+C,kBAAkB,EAAE,MAAM,GAAG,eAAe,MAAM,CAAC;AAGxG,IAAM,yCAA0D,kBAAkB,EAAE,MAAM,GAAG,eAAe,KAAK,CAAC;AAGlH,IAAM,gCAAiD,kBAAkB,EAAE,MAAM,GAAG,eAAe,MAAM,CAAC;AAG1G,IAAM,2CAA4D,kBAAkB,EAAE,MAAM,GAAG,eAAe,KAAK,CAAC;AAGpH,IAAM,8BAA+C,kBAAkB,EAAE,MAAM,GAAG,eAAe,MAAM,CAAC;AAGxG,IAAM,yCAA0D,kBAAkB,EAAE,MAAM,GAAG,eAAe,KAAK,CAAC;AAGlH,IAAM,+BAAgD,kBAAkB,EAAE,MAAM,GAAG,eAAe,MAAM,CAAC;AAGzG,IAAM,0CAA2D,kBAAkB,EAAE,MAAM,GAAG,eAAe,KAAK,CAAC;AAGnH,IAAM,+BAAgD,kBAAkB,EAAE,MAAM,GAAG,eAAe,KAAK,CAAC;AAExG,IAAM,4CAA6DA;AAAA,EACxE,kBAAkB,EAAE,MAAM,GAAG,eAAe,KAAK,CAAC;AAAA,EAClD;AACF;AAGO,IAAM,SAA0B;",
6
+ "names": ["config", "resolveRecommendedConfigOptions", "mergeTierConfigs"]
7
+ }
@@ -0,0 +1,5 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const reactBestPracticesConfig: Linter.Config[];
3
+ export declare const reactBestPracticesTypeCheckedConfig: Linter.Config[];
4
+ export declare const reactConfig: Linter.Config[];
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AA+E5C,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAGnD,CAAA;AAED,eAAO,MAAM,mCAAmC,EAAE,MAAM,CAAC,MAAM,EAG9D,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAwC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const storybookConfig: Linter.Config[];
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storybook/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAGpC,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAA6D,CAAA"}
@@ -0,0 +1,29 @@
1
+ import type { Linter } from 'eslint';
2
+ export { applyRecommendedConfigTypeChecked, DEFAULT_RECOMMENDED_CONFIG_OPTIONS, formatRecommendedConfigCall, type LintTier, parseRecommendedConfigSource, recommendedConfig, type RecommendedConfigOptions, resolveRecommendedConfigOptions, } from './recommendedConfig.ts';
3
+ export declare const configReactStorybook: Linter.Config[];
4
+ /** @deprecated Use `recommendedConfig({ tier: 0, isTypeChecked: false })` instead. */
5
+ export declare const configReactTier0Correctness: Linter.Config[];
6
+ /** @deprecated Use `recommendedConfig({ tier: 0, isTypeChecked: true })` instead. */
7
+ export declare const configReactTier0CorrectnessTypeChecked: Linter.Config[];
8
+ /** @deprecated Use `recommendedConfig({ tier: 1, isTypeChecked: false })` instead. */
9
+ export declare const configReactTier1Consistency: Linter.Config[];
10
+ /** @deprecated Use `recommendedConfig({ tier: 1, isTypeChecked: true })` instead. */
11
+ export declare const configReactTier1ConsistencyTypeChecked: Linter.Config[];
12
+ /** @deprecated Use `recommendedConfig({ tier: 2, isTypeChecked: false })` instead. */
13
+ export declare const configReactTier2BestPractices: Linter.Config[];
14
+ /** @deprecated Use `recommendedConfig({ tier: 2, isTypeChecked: true })` instead. */
15
+ export declare const configReactTier2BestPracticesTypeChecked: Linter.Config[];
16
+ /** @deprecated Use `recommendedConfig({ tier: 3, isTypeChecked: false })` instead. */
17
+ export declare const configReactTier3Opinionated: Linter.Config[];
18
+ /** @deprecated Use `recommendedConfig({ tier: 3, isTypeChecked: true })` instead. */
19
+ export declare const configReactTier3OpinionatedTypeChecked: Linter.Config[];
20
+ /** @deprecated Use `recommendedConfig({ tier: 4, isTypeChecked: false })` instead. */
21
+ export declare const configReactTier4Experimental: Linter.Config[];
22
+ /** @deprecated Use `recommendedConfig({ tier: 4, isTypeChecked: true })` instead. */
23
+ export declare const configReactTier4ExperimentalTypeChecked: Linter.Config[];
24
+ /** @deprecated Use `recommendedConfig({ tier: 2, isTypeChecked: true })` instead. */
25
+ export declare const recommendedTypeCheckedConfig: Linter.Config[];
26
+ export declare const recommendedTypeCheckedWithStorybookConfig: Linter.Config[];
27
+ /** @deprecated Use `recommendedConfig({ tier: 3, isTypeChecked: true })` plus `configReactStorybook` if needed. */
28
+ export declare const config: Linter.Config[];
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tiers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,2BAA2B,EAC3B,KAAK,QAAQ,EACb,4BAA4B,EAC5B,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,+BAA+B,GAChC,MAAM,wBAAwB,CAAA;AAS/B,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAyB,CAAA;AAEzE,sFAAsF;AACtF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAyD,CAAA;AAEhH,qFAAqF;AACrF,eAAO,MAAM,sCAAsC,EAAE,MAAM,CAAC,MAAM,EAAwD,CAAA;AAE1H,sFAAsF;AACtF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAyD,CAAA;AAEhH,qFAAqF;AACrF,eAAO,MAAM,sCAAsC,EAAE,MAAM,CAAC,MAAM,EAAwD,CAAA;AAE1H,sFAAsF;AACtF,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAyD,CAAA;AAElH,qFAAqF;AACrF,eAAO,MAAM,wCAAwC,EAAE,MAAM,CAAC,MAAM,EAAwD,CAAA;AAE5H,sFAAsF;AACtF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAyD,CAAA;AAEhH,qFAAqF;AACrF,eAAO,MAAM,sCAAsC,EAAE,MAAM,CAAC,MAAM,EAAwD,CAAA;AAE1H,sFAAsF;AACtF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAyD,CAAA;AAEjH,qFAAqF;AACrF,eAAO,MAAM,uCAAuC,EAAE,MAAM,CAAC,MAAM,EAAwD,CAAA;AAE3H,qFAAqF;AACrF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAwD,CAAA;AAEhH,eAAO,MAAM,yCAAyC,EAAE,MAAM,CAAC,MAAM,EAGpE,CAAA;AAED,mHAAmH;AACnH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAA8C,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { type RecommendedConfigOptions } from '@ariestools/eslint-config-flat';
2
+ import type { Linter } from 'eslint';
3
+ export type { LintTier, RecommendedConfigOptions } from '@ariestools/eslint-config-flat';
4
+ export { DEFAULT_RECOMMENDED_CONFIG_OPTIONS, formatRecommendedConfigCall, resolveRecommendedConfigOptions, } from '@ariestools/eslint-config-flat';
5
+ export declare function recommendedConfig(options?: RecommendedConfigOptions): Linter.Config[];
6
+ export declare function parseRecommendedConfigSource(source: string): {
7
+ configKind: 'custom' | 'preset';
8
+ options: Required<RecommendedConfigOptions>;
9
+ } | undefined;
10
+ export declare function applyRecommendedConfigTypeChecked(source: string, isEnabled: boolean): string;
11
+ //# sourceMappingURL=recommendedConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recommendedConfig.d.ts","sourceRoot":"","sources":["../../../src/tiers/recommendedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,wBAAwB,EAE9B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAOpC,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AACxF,OAAO,EACL,kCAAkC,EAClC,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,gCAAgC,CAAA;AAavC,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,CAMrF;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,MAAM,GACb;IAAE,UAAU,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAC,wBAAwB,CAAC,CAAA;CAAE,GAAG,SAAS,CAE9F;AAED,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAE5F"}
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "@ariestools/eslint-config-react-flat",
3
+ "version": "8.6.11",
4
+ "description": "ESLint Config used throughout XY Labs TypeScript/JavaScript libraries and react projects",
5
+ "keywords": [
6
+ "xylabs",
7
+ "utility",
8
+ "typescript",
9
+ "eslint"
10
+ ],
11
+ "homepage": "https://github.com/xylabs/eslint-config.git",
12
+ "bugs": {
13
+ "url": "git+https://github.com/xylabs/eslint-config/issues",
14
+ "email": "support@xylabs.com"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/xylabs/config.git"
19
+ },
20
+ "license": "LGPL-3.0-only",
21
+ "author": {
22
+ "name": "XY Labs Development Team",
23
+ "email": "support@xylabs.com",
24
+ "url": "https://xylabs.com"
25
+ },
26
+ "sideEffects": false,
27
+ "type": "module",
28
+ "exports": {
29
+ ".": {
30
+ "node": {
31
+ "types": "./dist/node/index.d.ts",
32
+ "default": "./dist/node/index.mjs"
33
+ },
34
+ "default": {
35
+ "types": "./dist/neutral/index.d.ts",
36
+ "default": "./dist/neutral/index.mjs"
37
+ }
38
+ }
39
+ },
40
+ "files": [
41
+ "dist",
42
+ "README.md",
43
+ "LICENSE"
44
+ ],
45
+ "dependencies": {
46
+ "@typescript-eslint/parser": "~8.63.0",
47
+ "eslint-plugin-react-dom": "~5.11.2",
48
+ "eslint-plugin-react-hooks": "~7.1.1",
49
+ "eslint-plugin-react-naming-convention": "~5.11.2",
50
+ "eslint-plugin-react-refresh": "~0.5.3",
51
+ "eslint-plugin-react-web-api": "~5.11.2",
52
+ "eslint-plugin-react-x": "~5.11.2",
53
+ "eslint-plugin-storybook": "~10.4.6",
54
+ "globals": "~17.7.0",
55
+ "@ariestools/eslint-config-flat": "~8.6.11"
56
+ },
57
+ "devDependencies": {
58
+ "@types/node": "~26.1.0",
59
+ "@vitest/coverage-v8": "~4.1.10",
60
+ "cosmiconfig": "~9.0.2",
61
+ "eslint": "~10.6.0",
62
+ "eslint-import-resolver-typescript": "~4.4.5",
63
+ "storybook": "~10.4.6",
64
+ "typescript": "~6.0.3",
65
+ "vite": "~8.1.3",
66
+ "vitest": "~4.1.10",
67
+ "@ariestools/toolchain": "~8.6.11",
68
+ "@ariestools/tsconfig": "~8.6.11"
69
+ },
70
+ "peerDependencies": {
71
+ "eslint": "^10.3",
72
+ "eslint-import-resolver-typescript": "^4.4",
73
+ "storybook": "^10.3",
74
+ "typescript": "^5.9 || ^6.0"
75
+ },
76
+ "engines": {
77
+ "node": ">=22"
78
+ },
79
+ "publishConfig": {
80
+ "access": "public"
81
+ }
82
+ }