@md-code/config 0.0.0-stage → 0.0.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/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,99 @@
1
- # Temporary Holding Version
1
+ # @md-code/config
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ ESLint, TypeScript and Stylelint presets shared by the `@md-code` packages —
4
+ installed from npm instead of being copied.
5
+
6
+ One package, three subpaths:
7
+
8
+ | Subpath | What it is |
9
+ | --------------------------------- | -------------------------------------------------------------------------------------------------- |
10
+ | `@md-code/config/eslint` | ESLint flat configs (`base`, `architecture`, `browser`, `next`, `node`, `products`, `reactNative`) |
11
+ | `@md-code/config/tsconfig/*.json` | TypeScript configs (`base`, `react`, `next`, `react-native`) |
12
+ | `@md-code/config/stylelint` | Stylelint config for `styled-components` sources (`postcss-styled-syntax`) |
13
+
14
+ `@md-code/follow-architecture`, `@md-code/utils-uniqueness`,
15
+ `@md-code/entities-uniqueness` and `@md-code/component-uniqueness` are consumed
16
+ from npm (`^0.3.0`) and are not part of this repository. They are **optional
17
+ peers**: this package is the config those tools are linted _with_, so it does not
18
+ depend on them. Installing `@md-code/config` is enough for `tsconfig`, `stylelint` and
19
+ the ESLint configs `base`, `browser`, `node`, `next` and `reactNative`; the
20
+ `architecture` and `products` configs need the tools installed in the project
21
+ that uses them.
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ pnpm add -D @md-code/config
27
+
28
+ # only for the `architecture` / `products` ESLint configs
29
+ pnpm add -D @md-code/follow-architecture @md-code/utils-uniqueness @md-code/entities-uniqueness @md-code/component-uniqueness
30
+ ```
31
+
32
+ The repository has no build step — the presets are shipped as-is.
33
+
34
+ ## eslint
35
+
36
+ CommonJS:
37
+
38
+ ```js
39
+ // eslint.config.cjs
40
+ const { base, architecture, products } = require("@md-code/config/eslint");
41
+
42
+ module.exports = [...base, ...architecture, ...products];
43
+ ```
44
+
45
+ ES modules:
46
+
47
+ ```js
48
+ // eslint.config.mjs
49
+ import { base } from "@md-code/config/eslint";
50
+
51
+ export default [...base];
52
+ ```
53
+
54
+ Names and what each one contains:
55
+
56
+ | Name | Contents |
57
+ | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
58
+ | `base` | The rules everyone gets: `eslint:recommended` + typescript-eslint `recommended-type-checked` and `stylistic-type-checked` (type-aware, `project: true`), the `anti-trojan-source` and `security` plugins, `import` ordering and type-import rules, the repo-wide `ignores` (build outputs, configs, the architecture scan scope) |
59
+ | `architecture` | The `md-code/follow-architecture` rule, reading `architecture.yaml` from the linted project root. Built lazily: reading it without `@md-code/follow-architecture` installed throws `Cannot load the architecture config: install @md-code/follow-architecture` |
60
+ | `browser` | `base` + `globals.browser` |
61
+ | `node` | `base` + `globals.node` |
62
+ | `next` | `base` + `globals.browser`, for Next.js sources |
63
+ | `reactNative` | `base`, for React Native sources (the RN preset itself is commented out) |
64
+ | `products` | The three `@md-code/*-uniqueness` rules. Exposes `products.configure({ root, utilsFolder, componentsFolder, entitiesRoots })`. Empty (`[]`, and `configure()` returns `[]`) when the three tools are not installed, and always empty when `LINT_PRODUCTS=0` |
65
+
66
+ `architecture` expects an `architecture.yaml` next to the linted project (the
67
+ rule walks up from each file). With `@md-code/follow-architecture` installed,
68
+ `base` also adds that tool's ignore paths to its `ignores`; without it the
69
+ config simply carries no extra ignores. `base` and `architecture` are unaffected
70
+ otherwise — the tool is never loaded for `tsconfig`, `stylelint` or the other
71
+ ESLint configs.
72
+
73
+ Known limitation: `base` and `architecture` load
74
+ `@md-code/follow-architecture/ignore.js`, and the published `0.3.0` of that tool
75
+ does not export it, so they need a release of `follow-architecture` that does.
76
+
77
+ ## tsconfig
78
+
79
+ ```json
80
+ // tsconfig.json
81
+ { "extends": "@md-code/config/tsconfig/react.json" }
82
+ ```
83
+
84
+ Available: `base.json`, `react.json`, `next.json`, `react-native.json`.
85
+
86
+ ## stylelint
87
+
88
+ ```json
89
+ // .stylelintrc.json
90
+ { "extends": "@md-code/config/stylelint" }
91
+ ```
92
+
93
+ ## License
94
+
95
+ Apache-2.0. See [LICENSE](./LICENSE).
96
+
97
+ ## Repository
98
+
99
+ GitHub: <https://github.com/DrBoria/md-config> · License: Apache-2.0
@@ -0,0 +1,101 @@
1
+ // The architecture rule, wired once for every package that extends this config.
2
+ // `packages/styles/README.md` is the styles contract; the repo-root
3
+ // `architecture.yaml` is its enforcement (the STYLES block). The rule scans the
4
+ // repository itself, so it carries its own skip list — ESLint's `ignores` only
5
+ // stops files from being linted, it does not feed a rule option.
6
+ //
7
+ // `@md-code/follow-architecture` is an OPTIONAL peer: this package is the config
8
+ // the tool is linted WITH, so it has to load when the tool is absent. Nothing is
9
+ // required at load time — the tool is resolved on the first access to the
10
+ // exported array, and only that access fails (with a message saying what to
11
+ // install). `require("@md-code/config/eslint")` and destructuring always work.
12
+
13
+ // `architecture.yaml` is named RELATIVE to the project root on purpose. The rule
14
+ // walks up from each linted file to find that file (its `findRepoRoot`), so the
15
+ // same config works here and in any consumer app that installs `@md-code/config` from
16
+ // the registry — there the file lives in `node_modules/@md-code/config/eslint`, and
17
+ // `__dirname` says nothing about where the consumer's architecture.yaml is.
18
+ const ARCH_CONFIG_FILE = "architecture.yaml";
19
+
20
+ const MISSING_TOOL = "Cannot load the architecture config: install @md-code/follow-architecture";
21
+
22
+ // The overview HTML is opt-in: `pnpm lint:overview`. The root script runs the
23
+ // products pass with LINT_OVERVIEW=1, and the flag is part of the turbo task
24
+ // hash, so a cached plain-lint result is never replayed for an overview run.
25
+ const overviewExportPath = () =>
26
+ process.env.LINT_OVERVIEW
27
+ ? process.env.LINT_OVERVIEW === "1"
28
+ ? "reports/architecture-overview.html"
29
+ : process.env.LINT_OVERVIEW
30
+ : false;
31
+
32
+ const loadTool = () => {
33
+ const firstLine = (message) => String(message).split("\n")[0];
34
+
35
+ let plugin;
36
+
37
+ try {
38
+ plugin = require("@md-code/follow-architecture");
39
+ } catch (error) {
40
+ throw new Error(`${MISSING_TOOL} (${firstLine(error.message)})`);
41
+ }
42
+
43
+ // Scan scope for the architecture rule: the folders the tool never scans. The
44
+ // list is FA's own, so the rule and the CLI look at the same files — a second
45
+ // copy here would be a second scan scope, and a lint run paid for files a scan
46
+ // run skips. The rule ADDS `ignoreDirs` to that list, so this option states the
47
+ // contract instead of restating it.
48
+ try {
49
+ return { plugin, ignore: require("@md-code/follow-architecture/ignore.js") };
50
+ } catch (error) {
51
+ throw new Error(
52
+ `Cannot load the architecture config: @md-code/follow-architecture must expose "ignore.js" (${firstLine(error.message)})`,
53
+ );
54
+ }
55
+ };
56
+
57
+ let built;
58
+
59
+ const config = () => {
60
+ if (built) return built;
61
+
62
+ const { plugin, ignore } = loadTool();
63
+
64
+ built = [
65
+ {
66
+ files: ["**/*.ts", "**/*.tsx"],
67
+ plugins: { "md-code": plugin },
68
+ rules: {
69
+ "md-code/follow-architecture": [
70
+ "error",
71
+ {
72
+ config: ARCH_CONFIG_FILE,
73
+ ignoreDirs: ignore.IGNORE_DIRS,
74
+ // The same list, for paths: the apps, the platform packages and the
75
+ // tooling scripts are outside the contract, so the rule stays silent
76
+ // on them even where ESLint still hands those files over.
77
+ ignores: ignore.IGNORE_PATHS,
78
+ exportPath: overviewExportPath(),
79
+ },
80
+ ],
81
+ },
82
+ },
83
+ ];
84
+
85
+ return built;
86
+ };
87
+
88
+ // A Proxy over an empty array, so `Array.isArray()` and a spread keep working
89
+ // while the real config is only built on the first read. Reading anything — even
90
+ // `Symbol.iterator` in `...architecture` — is where a missing tool surfaces.
91
+ module.exports = new Proxy([], {
92
+ get(target, property) {
93
+ const real = config();
94
+ const value = Reflect.get(real, property, real);
95
+
96
+ return typeof value === "function" ? value.bind(real) : value;
97
+ },
98
+ has: (target, property) => Reflect.has(config(), property),
99
+ ownKeys: () => Reflect.ownKeys(config()),
100
+ getOwnPropertyDescriptor: (target, property) => Reflect.getOwnPropertyDescriptor(config(), property),
101
+ });
package/eslint/base.js ADDED
@@ -0,0 +1,194 @@
1
+ const { FlatCompat } = require("@eslint/eslintrc");
2
+ const js = require("@eslint/js");
3
+ const typescriptEslint = require("@typescript-eslint/eslint-plugin");
4
+ const tsParser = require("@typescript-eslint/parser");
5
+ const _import = require("eslint-plugin-import");
6
+ const pluginSecurity = require("eslint-plugin-security");
7
+ const path = require("node:path");
8
+
9
+ // The architecture contract's scope, from the one place that states it: the CLI,
10
+ // the ESLint rule and this config must ignore the same files, or a lint run pays
11
+ // for files a scan run skips. `@md-code/follow-architecture` is an OPTIONAL peer
12
+ // (see `README.md`): without it there is no contract to honour, so the extra
13
+ // ignores are simply absent — everything else in this config still loads.
14
+ const SCAN_SCOPE_PATHS = (() => {
15
+ try {
16
+ return require("@md-code/follow-architecture/ignore.js").IGNORE_PATHS ?? [];
17
+ } catch {
18
+ return [];
19
+ }
20
+ })();
21
+
22
+ // In CommonJS, __dirname is already available, so no need to import fileURLToPath or define __filename
23
+ const compat = new FlatCompat({
24
+ baseDirectory: __dirname,
25
+ recommendedConfig: js.configs.recommended,
26
+ allConfig: js.configs.all,
27
+ });
28
+
29
+ module.exports = [
30
+ {
31
+ // The patterns below are repo-root-relative, so the global ignore resolves
32
+ // them from the root, not from the package whose config required this file
33
+ // (`eslint .` runs with the package as cwd). Three levels above this file is
34
+ // the project root: correct here and as
35
+ // `node_modules/@md-code/config/eslint/base.js` in a consumer.
36
+ basePath: path.resolve(__dirname, "..", "..", ".."),
37
+ // Ignored files and directories
38
+ ignores: [
39
+ "**/hubspot/**/*.js",
40
+ "**/*.config.js",
41
+ "**/*.config.cjs",
42
+ "**/.eslintrc.cjs",
43
+ "**/.next",
44
+ "**/.keystone",
45
+ "**/dist",
46
+ "**/yanm-lock.yaml",
47
+ "**/*.js",
48
+ // Everything outside the architecture contract: the apps, the platform
49
+ // packages only they consume, the tooling scripts and every JS file.
50
+ ...SCAN_SCOPE_PATHS,
51
+ ],
52
+ },
53
+ // Extend recommended configurations
54
+ ...compat
55
+ .extends(
56
+ "eslint:recommended",
57
+ "plugin:@typescript-eslint/recommended-type-checked",
58
+ "plugin:anti-trojan-source/recommended",
59
+ "plugin:@typescript-eslint/stylistic-type-checked",
60
+ )
61
+ .map((config) => ({
62
+ ...config,
63
+ files: ["**/*.ts", "**/*.tsx"],
64
+ })),
65
+ {
66
+ ...pluginSecurity.configs.recommended,
67
+ // The repo treats every security rule as an `error` on purpose — a finding
68
+ // here is a defect, not advice. Derived from the plugin's own rule list so
69
+ // a plugin upgrade cannot leave a new rule behind at the default severity.
70
+ rules: Object.fromEntries(Object.keys(pluginSecurity.rules).map((name) => [`security/${name}`, "error"])),
71
+ },
72
+ {
73
+ files: ["**/*.ts", "**/*.tsx"],
74
+ plugins: {
75
+ "@typescript-eslint": typescriptEslint,
76
+ import: _import,
77
+ },
78
+ linterOptions: {
79
+ reportUnusedDisableDirectives: false,
80
+ noInlineConfig: true,
81
+ },
82
+ languageOptions: {
83
+ parser: tsParser,
84
+ ecmaVersion: 2022,
85
+ sourceType: "module",
86
+ parserOptions: {
87
+ project: true, // Enable type checking via tsconfig
88
+ },
89
+ },
90
+ rules: {
91
+ "security/detect-object-injection": "off",
92
+ "no-constant-condition": "off",
93
+ "@typescript-eslint/consistent-type-definitions": "off",
94
+ "@typescript-eslint/dot-notation": "off",
95
+ "@typescript-eslint/prefer-nullish-coalescing": "off",
96
+ "@typescript-eslint/no-base-to-string": "off",
97
+ "@typescript-eslint/no-empty-function": "off",
98
+ "@typescript-eslint/array-type": "off",
99
+ "@typescript-eslint/no-unsafe-argument": "off",
100
+ "@typescript-eslint/no-unsafe-member-access": "off",
101
+ "@typescript-eslint/no-unnecessary-type-assertion": "off",
102
+ "@typescript-eslint/no-unsafe-call": "off",
103
+ "@typescript-eslint/unbound-method": "off",
104
+ "@typescript-eslint/non-nullable-type-assertion-style": "off",
105
+ "@typescript-eslint/ban-ts-comment": "off",
106
+ "@typescript-eslint/restrict-template-expressions": "off",
107
+ "@typescript-eslint/no-unused-vars": [
108
+ "error",
109
+ {
110
+ argsIgnorePattern: "^_",
111
+ varsIgnorePattern: "^_",
112
+ },
113
+ ],
114
+ "@typescript-eslint/no-misused-promises": [
115
+ "error",
116
+ {
117
+ checksVoidReturn: false,
118
+ },
119
+ ],
120
+ "@typescript-eslint/consistent-type-imports": [
121
+ "warn",
122
+ {
123
+ prefer: "type-imports",
124
+ fixStyle: "separate-type-imports",
125
+ },
126
+ ],
127
+ "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
128
+ "@typescript-eslint/no-unsafe-assignment": "off",
129
+ "@typescript-eslint/no-unsafe-return": "off",
130
+ "@typescript-eslint/no-redundant-type-constituents": "off",
131
+ "@typescript-eslint/no-explicit-any": "error",
132
+ "@typescript-eslint/ban-ts-comment": [
133
+ "error",
134
+ {
135
+ "ts-expect-error": true,
136
+ "ts-ignore": true,
137
+ "ts-nocheck": true,
138
+ "ts-check": true,
139
+ minimumDescriptionLength: 3,
140
+ },
141
+ ],
142
+ "no-restricted-imports": [
143
+ "error",
144
+ {
145
+ patterns: [
146
+ {
147
+ group: ["../*"],
148
+ message:
149
+ "Relative imports from parent directories are forbidden. Please use absolute imports (e.g. @md/...) or sibling imports (./).",
150
+ },
151
+ ],
152
+ },
153
+ ],
154
+ "no-restricted-syntax": [
155
+ "error",
156
+ {
157
+ selector:
158
+ "TSAsExpression[typeAnnotation.type='TSTypeReference'][typeAnnotation.typeName.name='unknown'], TSAsExpression[typeAnnotation.type='TSUnknownKeyword']",
159
+ message: "Do not use `as unknown`. It is strictly forbidden.",
160
+ },
161
+ {
162
+ selector:
163
+ "VariableDeclarator[id.name=/^[A-Z][A-Z0-9_]*$/][init.type='Literal'][init.value=/^#([0-9a-fA-F]{3}){1,2}$/]",
164
+ message: "Do not define hex color constants. Use theme variables instead.",
165
+ },
166
+ {
167
+ selector:
168
+ "VariableDeclarator[id.name=/^[A-Z][A-Z0-9_]*$/][init.type='Literal'][init.value=/^-?\\d+(\\.\\d+)?(px|rem|em|vh|vw|%)$/]",
169
+ message: "Do not define CSS unit constants. Use theme variables instead.",
170
+ },
171
+ ],
172
+ "no-warning-comments": [
173
+ "error",
174
+ {
175
+ terms: [
176
+ "eslint-disable",
177
+ "eslint-disable-next-line",
178
+ "eslint-disable-line",
179
+ "eslint-enable",
180
+ "stylelint-disable",
181
+ "stylelint-disable-next-line",
182
+ "stylelint-disable-line",
183
+ "prettier-ignore",
184
+ "ts-ignore",
185
+ "ts-nocheck",
186
+ "ts-check",
187
+ "ts-expect-error",
188
+ ],
189
+ location: "anywhere",
190
+ },
191
+ ],
192
+ },
193
+ },
194
+ ];
@@ -0,0 +1,19 @@
1
+ const baseConfig = require("./base.js");
2
+ const globals = require("globals");
3
+
4
+ module.exports = [
5
+ ...baseConfig,
6
+ {
7
+ files: ["**/*.ts", "**/*.tsx"],
8
+ languageOptions: {
9
+ globals: {
10
+ ...globals.browser,
11
+ React: "readonly",
12
+ JSX: "readonly",
13
+ },
14
+ env: {
15
+ browser: true,
16
+ },
17
+ },
18
+ },
19
+ ];
@@ -0,0 +1,22 @@
1
+ // The single entry point for every ESLint flat config this package ships.
2
+ //
3
+ // Consumers destructure what they need — `const { base, products } =
4
+ // require("@md-code/config/eslint")` — so the config file names are never part of the
5
+ // public API. Each value is the module's own array, unchanged: spreading it into
6
+ // a config file behaves exactly like requiring the file did before.
7
+ //
8
+ // A module is loaded on first `require` of this file, so importing `base` also
9
+ // pulls in the architecture rule and the product rules' dependencies. That is a
10
+ // few hundred kilobytes in a devDependency, and it keeps the entry point a plain
11
+ // object instead of a getter dance.
12
+ "use strict";
13
+
14
+ module.exports = {
15
+ base: require("./base.js"),
16
+ architecture: require("./architecture.js"),
17
+ browser: require("./browser.js"),
18
+ next: require("./next.js"),
19
+ node: require("./node.js"),
20
+ products: require("./products.js"),
21
+ reactNative: require("./react-native.js"),
22
+ };
package/eslint/next.js ADDED
@@ -0,0 +1,14 @@
1
+ const baseConfig = require("./base.js");
2
+ const globals = require("globals");
3
+
4
+ module.exports = [
5
+ ...baseConfig,
6
+ {
7
+ files: ["**/*.ts", "**/*.tsx"],
8
+ languageOptions: {
9
+ globals: {
10
+ ...globals.browser,
11
+ },
12
+ },
13
+ },
14
+ ];
package/eslint/node.js ADDED
@@ -0,0 +1,17 @@
1
+ const baseConfig = require("./base.js");
2
+ const globals = require("globals");
3
+
4
+ module.exports = [
5
+ ...baseConfig,
6
+ {
7
+ files: ["**/*.ts", "**/*.tsx"],
8
+ languageOptions: {
9
+ globals: {
10
+ ...globals.node,
11
+ },
12
+ env: {
13
+ node: true,
14
+ },
15
+ },
16
+ },
17
+ ];
@@ -0,0 +1,179 @@
1
+ // The three UNIQUENESS products, wired as ESLint rules for one package.
2
+ //
3
+ // Why these three and not the architecture rule: `follow-architecture` builds a
4
+ // repo-wide ts-morph state per PROCESS, so wiring it here would scan the whole
5
+ // workspace once per package (that is why it lives in
6
+ // `packages/follow-architecture/eslint.products.config.mjs`, run once from the
7
+ // root `lint` / `lint:overview` scripts). The uniqueness rules build their
8
+ // catalogues once per process too, but the catalogue itself is the shared file
9
+ // index, so a warm index makes the per-package cost a stat walk.
10
+ //
11
+ // Imported through the package entry point (`const { products } =
12
+ // require("@md-code/config/eslint")`), so a package config gets it from its
13
+ // devDependency, with no dependency edge inside a workspace.
14
+ //
15
+ // NO `root` IS PASSED. Each rule anchors the repository root on the file it is
16
+ // linting (`options.root || findRepoRoot(dirname(filename)) || findRepoRoot(cwd)`),
17
+ // which is the only value that is right in both worlds: the editor starts the
18
+ // eslint server in a package directory, the CLI may run anywhere, and the same
19
+ // `products.js` is consumed from `node_modules/@md-code/config/eslint/`. Deriving the
20
+ // root from THIS file worked only inside our monorepo: installed as
21
+ // `node_modules/@md-code/config/eslint/products.js` three levels up is the consumer's
22
+ // project root, not ours.
23
+ "use strict";
24
+
25
+ // The editor runs with the rules ON: a package config that spreads this file is
26
+ // what makes `@md-code/*-uniqueness` show up in VS Code out of the box.
27
+ //
28
+ // CI turns them OFF for the per-package phase (`LINT_PRODUCTS=0`, set by the
29
+ // root `lint` script and declared in `turbo.json`): in a fresh process every
30
+ // package would rebuild the catalogue from the 582 MB file index and parse the
31
+ // canon again — measured +30…72 s per package, +3.5 min for `pnpm lint`. The
32
+ // repo-wide products pass (`lint:products`) covers the same rules once, over the
33
+ // whole workspace, and writes the shared `reports/*-catalog.json`/HTML.
34
+ if (process.env.LINT_PRODUCTS === "0") {
35
+ module.exports = [];
36
+ module.exports.configure = () => [];
37
+ return;
38
+ }
39
+
40
+ const fs = require("node:fs");
41
+ const path = require("node:path");
42
+
43
+ const tsParser = require("@typescript-eslint/parser");
44
+
45
+ // The three uniqueness tools are OPTIONAL peers (see `README.md`): this package is
46
+ // the config those tools are linted WITH, so it loads without them. With any of
47
+ // them missing there is nothing to wire, so `products` is an empty array and
48
+ // `configure()` returns one — a consumer that does not use these rules never has
49
+ // to install the tools.
50
+ const loadTools = () => {
51
+ try {
52
+ return {
53
+ utilsUniqueness: require("@md-code/utils-uniqueness"),
54
+ entitiesUniqueness: require("@md-code/entities-uniqueness"),
55
+ componentUniqueness: require("@md-code/component-uniqueness"),
56
+ };
57
+ } catch {
58
+ return null;
59
+ }
60
+ };
61
+
62
+ const TOOLS = loadTools();
63
+
64
+ // `node_modules/@md-code/config/eslint/products.js` → three levels up is the consumer's
65
+ // project root. Used only to
66
+ // RECOGNISE the monorepo: `packages/utils` next to it exists here and nowhere
67
+ // else, so it tells "our workspace" apart from "installed into somebody's
68
+ // node_modules" without guessing from cwd.
69
+ const PACKAGE_ROOT = path.resolve(__dirname, "..", "..", "..");
70
+ const IN_MONOREPO = fs.existsSync(path.join(PACKAGE_ROOT, "packages", "utils"));
71
+
72
+ // One writer per artifact. The catalogues are repo-wide whatever package is being
73
+ // linted, so every package lint would write the SAME `reports/*-catalog.json` —
74
+ // and turbo runs the packages in parallel. The reports belong to the full-repo
75
+ // products pass; here each package gets a private file it may overwrite at will.
76
+ const packageName = () => {
77
+ const rel = path.relative(PACKAGE_ROOT, process.cwd());
78
+ const outside = rel === "" || rel.startsWith("..") || path.isAbsolute(rel);
79
+
80
+ return outside ? "workspace" : rel.split(path.sep).join("-");
81
+ };
82
+
83
+ // Fixtures are INPUT to these rules, not product code: a deliberately duplicated
84
+ // sample in `tests/` must never be reported as a finding. Scoped to this fragment
85
+ // (`ignores` next to `files`), so the package's own rules still lint `tests/`.
86
+ // The consumer list is shorter on purpose: it must not silence the consumer's own
87
+ // test suites, and `reports/`/`.turbo/` are ours.
88
+ const MONOREPO = {
89
+ ignores: [
90
+ "**/node_modules/**",
91
+ "**/dist/**",
92
+ "**/build/**",
93
+ "**/out/**",
94
+ "**/coverage/**",
95
+ "**/.turbo/**",
96
+ "**/reports/**",
97
+ "**/tests/**",
98
+ ],
99
+ // The scan scope of the products config, verbatim: utils live in
100
+ // `packages/utils`, components in the three UI layers, entities anywhere.
101
+ utilsFolder: ["packages/utils"],
102
+ componentsFolder: ["packages/components/atoms", "packages/components/molecules", "packages/sections"],
103
+ entitiesRoots: ["."],
104
+ // A per-package directory: the shared `reports/` belong to the full-repo pass.
105
+ exportDir: `.turbo/lint/${packageName()}`,
106
+ };
107
+
108
+ // Installed as a dependency there is no `packages/utils` and no `.turbo/lint`:
109
+ // the catalogues go to a cache directory that every consumer ignores by default,
110
+ // and the canon folders are only a starting point — a real consumer names its own
111
+ // through `configure()` below, because no generic guess can be right.
112
+ const CONSUMER = {
113
+ ignores: ["**/node_modules/**", "**/dist/**", "**/build/**", "**/out/**", "**/coverage/**", "**/.next/**"],
114
+ utilsFolder: ["packages/utils"],
115
+ componentsFolder: ["packages/components"],
116
+ entitiesRoots: ["."],
117
+ exportDir: "node_modules/.cache/@md-code/config",
118
+ };
119
+
120
+ const DEFAULTS = IN_MONOREPO ? MONOREPO : CONSUMER;
121
+
122
+ // `configure()` is the seam for an outside consumer: everything repo-shaped
123
+ // (folders, where the catalogues go, an explicit `root`) is passed in, and the
124
+ // rest of the wiring — parser, plugin names, severities, one fragment — stays
125
+ // ours. `root` stays optional: the rules find it from the linted file.
126
+ const build = (overrides = {}) => {
127
+ const opts = { ...DEFAULTS, ...overrides };
128
+ const catalog = (name) => (opts.exportDir === false ? null : `${opts.exportDir}/${name}`);
129
+ const ruleOptions = (extra, name) => {
130
+ const options = { ...extra, overviewPath: false };
131
+
132
+ if (opts.root) options.root = opts.root;
133
+ const exportPath = catalog(name);
134
+
135
+ if (exportPath) options.exportPath = exportPath;
136
+
137
+ return ["error", options];
138
+ };
139
+
140
+ return [
141
+ {
142
+ files: ["**/*.ts", "**/*.tsx"],
143
+ ignores: opts.ignores,
144
+ // No type-aware parserOptions on purpose: these rules read the sources
145
+ // themselves, so ESLint only has to PARSE the file in front of it.
146
+ languageOptions: {
147
+ parser: tsParser,
148
+ parserOptions: { ecmaVersion: "latest", sourceType: "module" },
149
+ },
150
+ plugins: {
151
+ "md-code-utils": TOOLS.utilsUniqueness,
152
+ "md-code-entities": TOOLS.entitiesUniqueness,
153
+ "md-code-components": TOOLS.componentUniqueness,
154
+ },
155
+ rules: {
156
+ "md-code-utils/utils-uniqueness": ruleOptions(
157
+ { ...opts.utilsOptions, utilsFolder: opts.utilsFolder },
158
+ "utils-catalog.json",
159
+ ),
160
+ "md-code-entities/entities-uniqueness": ruleOptions(
161
+ { ...opts.entitiesOptions, roots: opts.entitiesRoots, exclude: [] },
162
+ "entities-catalog.json",
163
+ ),
164
+ "md-code-components/component-uniqueness": ruleOptions(
165
+ { ...opts.componentsOptions, componentsFolder: opts.componentsFolder },
166
+ "component-catalog.json",
167
+ ),
168
+ },
169
+ },
170
+ ];
171
+ };
172
+
173
+ const products = TOOLS ? build() : [];
174
+
175
+ // `products.configure({ root, utilsFolder, componentsFolder, exportDir, ... })`
176
+ // returns a new flat-config array; the plain array export is the zero-config form.
177
+ products.configure = (overrides) => (TOOLS ? build(overrides) : []);
178
+
179
+ module.exports = products;
@@ -0,0 +1,18 @@
1
+ const baseConfig = require("./base.js");
2
+ // import { FlatCompat } from "@eslint/eslintrc";
3
+ // import path from "node:path";
4
+ // import { fileURLToPath } from "node:url";
5
+
6
+ // const __filename = fileURLToPath(import.meta.url);
7
+ // const __dirname = path.dirname(__filename);
8
+ // const compat = new FlatCompat({
9
+ // baseDirectory: __dirname,
10
+ // });
11
+
12
+ module.exports = [
13
+ ...baseConfig,
14
+ // ...compat.extends("@react-native-community"),
15
+ {
16
+ files: ["**/*.ts", "**/*.tsx"],
17
+ },
18
+ ];
package/package.json CHANGED
@@ -1,6 +1,77 @@
1
1
  {
2
- "name": "@md-code/config",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@md-code/config",
3
+ "version": "0.0.1",
4
+ "private": false,
5
+ "description": "Shared ESLint, Stylelint and TypeScript presets, imported by subpath.",
6
+ "license": "Apache-2.0",
7
+ "packageManager": "pnpm@10.18.3",
8
+ "engines": {
9
+ "node": ">=18"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "files": [
15
+ "eslint/",
16
+ "stylelint/",
17
+ "tsconfig/"
18
+ ],
19
+ "exports": {
20
+ "./eslint": "./eslint/index.js",
21
+ "./stylelint": "./stylelint/index.cjs",
22
+ "./tsconfig/*.json": "./tsconfig/*.json",
23
+ "./package.json": "./package.json"
24
+ },
25
+ "scripts": {
26
+ "version-packages": "changeset version",
27
+ "release": "changeset publish"
28
+ },
29
+ "author": "DrBoria <dr.boria@gmail.com>",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/DrBoria/md-config.git"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/DrBoria/md-config/issues"
36
+ },
37
+ "homepage": "https://github.com/DrBoria/md-config#readme",
38
+ "dependencies": {
39
+ "@eslint/eslintrc": "^3.1.0",
40
+ "@eslint/js": "^9.9.1",
41
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
42
+ "@typescript-eslint/parser": "^7.18.0",
43
+ "eslint": "^9.22.0",
44
+ "eslint-plugin-anti-trojan-source": "^1.1.1",
45
+ "eslint-plugin-import": "^2.29.1",
46
+ "eslint-plugin-security": "^3.0.1",
47
+ "globals": "^15.9.0",
48
+ "postcss-styled-syntax": "^0.6.4",
49
+ "stylelint": "^16.2.0",
50
+ "stylelint-config-standard": "^36.0.0",
51
+ "stylelint-declaration-strict-value": "^1.10.11",
52
+ "stylelint-order": "^6.0.4"
53
+ },
54
+ "peerDependencies": {
55
+ "@md-code/component-uniqueness": "^0.3.0",
56
+ "@md-code/entities-uniqueness": "^0.3.0",
57
+ "@md-code/follow-architecture": "^0.3.0",
58
+ "@md-code/utils-uniqueness": "^0.3.0"
59
+ },
60
+ "peerDependenciesMeta": {
61
+ "@md-code/component-uniqueness": {
62
+ "optional": true
63
+ },
64
+ "@md-code/entities-uniqueness": {
65
+ "optional": true
66
+ },
67
+ "@md-code/follow-architecture": {
68
+ "optional": true
69
+ },
70
+ "@md-code/utils-uniqueness": {
71
+ "optional": true
72
+ }
73
+ },
74
+ "devDependencies": {
75
+ "@changesets/cli": "^2.27.0"
76
+ }
77
+ }
@@ -0,0 +1,121 @@
1
+ module.exports = {
2
+ extends: ["stylelint-config-standard"],
3
+ customSyntax: "postcss-styled-syntax",
4
+ plugins: ["stylelint-order", "stylelint-declaration-strict-value"],
5
+ rules: {
6
+ "scale-unlimited/declaration-strict-value": [
7
+ [
8
+ "/color/",
9
+ "fill",
10
+ "stroke",
11
+ "/^margin/",
12
+ "/^padding/",
13
+ "gap",
14
+ "/^border/",
15
+ "/^background/",
16
+ "font-size",
17
+ "line-height",
18
+ "letter-spacing",
19
+ "width",
20
+ "height",
21
+ "/^min-/",
22
+ "/^max-/",
23
+ "top",
24
+ "left",
25
+ "right",
26
+ "bottom",
27
+ "box-shadow",
28
+ "text-shadow",
29
+ "z-index",
30
+ "flex-basis",
31
+ "border-radius",
32
+ "opacity",
33
+ ],
34
+ {
35
+ ignoreValues: [
36
+ "0",
37
+ "1px",
38
+ "1rem",
39
+ "50%",
40
+ "100%",
41
+ "auto",
42
+ "none",
43
+ "transparent",
44
+ "currentColor",
45
+ "inherit",
46
+ "initial",
47
+ "unset",
48
+ "solid",
49
+ "dashed",
50
+ "dotted",
51
+ "collapse",
52
+ "separate",
53
+ "visible",
54
+ "hidden",
55
+ "scroll",
56
+ "cover",
57
+ "contain",
58
+ "no-repeat",
59
+ "repeat",
60
+ "center",
61
+ "row",
62
+ "column",
63
+ "flex-start",
64
+ "flex-end",
65
+ "baseline",
66
+ "stretch",
67
+ "/^calc\\((?:(?!\\d+(?:px|em|rem|%|vw|vh|vmin|vmax)).)*\\)$/",
68
+ "/fr$/",
69
+ "100vh",
70
+ "100vw",
71
+ "50vh",
72
+ "50vw",
73
+ "/^(?!.*(\\d+(px|em|rem|%|vw|vh)|#|['\"])).*$/",
74
+ "/^-?\\d+(\\.5)?$/",
75
+ "1",
76
+ ],
77
+ ignoreVariables: false,
78
+ ignoreFunctions: false,
79
+ expandShorthand: true,
80
+ disableFix: true,
81
+ message: "Use theme variables or allowed exceptions (0, 1px, 100%, ${({ theme }) => theme....ETC})",
82
+ },
83
+ ],
84
+ "function-disallowed-list": ["rgb", "rgba", "hsl", "hsla", "hwb", "lab", "lch"],
85
+ "color-no-hex": true,
86
+ "color-named": "never",
87
+ "property-no-unknown": [
88
+ true,
89
+ {
90
+ ignoreProperties: ["/^\\$/"],
91
+ },
92
+ ],
93
+ "selector-type-no-unknown": [
94
+ true,
95
+ {
96
+ ignoreTypes: ["/^\\$/"],
97
+ },
98
+ ],
99
+ "media-query-no-invalid": null,
100
+ "comment-pattern": [
101
+ "^((?!stylelint-disable)[\\s\\S])*$",
102
+ {
103
+ message: "stylelint-disable comments are not allowed.",
104
+ },
105
+ ],
106
+ },
107
+ overrides: [
108
+ {
109
+ files: ["**/*.{js,jsx,ts,tsx}"],
110
+ },
111
+ ],
112
+ ignoreFiles: [
113
+ "dist/**/*",
114
+ "coverage/**/*",
115
+ "node_modules/**/*",
116
+ "**/*.d.ts",
117
+ "packages/styles/themes/**/*",
118
+ ".next/**/*",
119
+ ".turbo/**/*",
120
+ ],
121
+ };
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Default",
4
+ "compilerOptions": {
5
+ "composite": false,
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "esModuleInterop": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "inlineSources": false,
11
+ "isolatedModules": true,
12
+ "module": "commonjs",
13
+ "moduleResolution": "node10",
14
+ "noUnusedLocals": false,
15
+ "noUnusedParameters": false,
16
+ "preserveWatchOutput": true,
17
+ "skipLibCheck": true,
18
+ "strict": true,
19
+ "noImplicitAny": true,
20
+ "strictNullChecks": true,
21
+ "resolveJsonModule": true
22
+ },
23
+ "exclude": ["node_modules"]
24
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./base.json",
4
+ "compilerOptions": {
5
+ "target": "es5",
6
+ "lib": ["dom", "dom.iterable", "esnext"],
7
+ "allowJs": true,
8
+ "skipLibCheck": true,
9
+ "strict": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "noEmit": true,
12
+ "incremental": true,
13
+ "esModuleInterop": true,
14
+ "module": "esnext",
15
+ "moduleResolution": "bundler",
16
+ "resolveJsonModule": true,
17
+ "isolatedModules": true,
18
+ "jsx": "preserve"
19
+ }
20
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./base.json",
4
+ "compilerOptions": {
5
+ "jsx": "react-native",
6
+ "lib": ["dom", "esnext"],
7
+ "allowSyntheticDefaultImports": true,
8
+ "module": "esnext",
9
+ "moduleResolution": "bundler"
10
+ }
11
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./base.json",
4
+ "compilerOptions": {
5
+ "jsx": "react-jsx",
6
+ "lib": ["dom", "dom.iterable", "esnext"],
7
+ "module": "esnext",
8
+ "moduleResolution": "bundler"
9
+ }
10
+ }