@santi020k/eslint-config-basic 0.7.0 → 0.8.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/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # @santi020k/eslint-config-basic
2
2
 
3
+ ## 0.8.1
4
+
5
+ ### Minor Changes
6
+
7
+ - 13e8e5a: # Release 0.8.0
8
+
9
+ - **Snippet Fixes**: Resolved ESLint parsing errors in virtual TypeScript files within Markdown, Astro, and VitePress code blocks by disabling type-aware rules for those snippets.
10
+ - **Standalone TS Support**: Restored `disableTypeChecked` configuration in the TypeScript package, ensuring it remains fully functional and parsing-error-free when used without the main composer.
11
+ - **Documentation Reorganization**: Significantly expanded and restructured the documentation site, adding new pages for the Inspector, CLI Tooling, Extensions, and better framework-specific guides.
12
+ - **Branding Update**: Updated the author link label from "Website" to "Author" across all documentation files for improved brand identity.
13
+ - **Composition Improvements**: Refactored the configuration composer to be more robust when handling virtual snippets and framework contracts.
14
+
15
+ ### Patch Changes
16
+
17
+ - # CI & Workflow Stabilization
18
+
19
+ - Fixed invalid `actions/setup-node` version from `@v6` to `@v4` in Release and Docs workflows.
20
+ - Improved CLI test performance and reliability by refactoring integration tests into fast in-memory unit tests.
21
+ - Enabled Turborepo caching in GitHub Actions to significantly reduce PR build times.
22
+
23
+ - Updated dependencies
24
+ - Updated dependencies [13e8e5a]
25
+ - @santi020k/eslint-config-...@0.8.1
26
+ - @santi020k/eslint-config-...@0.8.1
27
+ - @santi020k/eslint-config-...@0.8.1
28
+ - @santi020k/eslint-config-...@0.8.1
29
+ - @santi020k/eslint-config-...@0.8.1
30
+ - @santi020k/eslint-config-...@0.8.1
31
+ - @santi020k/eslint-config-...@0.8.1
32
+ - @santi020k/eslint-config-...@0.8.1
33
+ - @santi020k/eslint-config-...@0.8.1
34
+ - @santi020k/eslint-config-...@0.8.1
35
+ - @santi020k/eslint-config-...@0.8.1
36
+ - @santi020k/eslint-config-...@0.8.1
37
+
38
+ ## 0.7.1
39
+
40
+ ### Patch Changes
41
+
42
+ - [#43](https://github.com/santi020k/eslint-config-basic/pull/43) [`6ceaa37`](https://github.com/santi020k/eslint-config-basic/commit/6ceaa370b9d5f4dfc3819760367bceb5cfd0ba38) Thanks [@santi020k](https://github.com/santi020k)! - Sync README documentation with implemented features (Vue, Playwright).
43
+
44
+ - Updated dependencies []:
45
+ - @santi020k/eslint-config-astro@0.7.1
46
+ - @santi020k/eslint-config-core@0.7.1
47
+ - @santi020k/eslint-config-expo@0.7.1
48
+ - @santi020k/eslint-config-nest@0.7.1
49
+ - @santi020k/eslint-config-next@0.7.1
50
+ - @santi020k/eslint-config-optionals@0.7.1
51
+ - @santi020k/eslint-config-react@0.7.1
52
+ - @santi020k/eslint-config-typescript@0.7.1
53
+ - @santi020k/eslint-config-vue@0.7.1
54
+
3
55
  ## 0.7.0
4
56
 
5
57
  ### Minor Changes
package/README.md CHANGED
@@ -3,321 +3,49 @@
3
3
  [![CI](https://github.com/santi020k/eslint-config-basic/actions/workflows/build.yml/badge.svg)](https://github.com/santi020k/eslint-config-basic/actions/workflows/build.yml)
4
4
  [![npm version](https://img.shields.io/npm/v/@santi020k/eslint-config-basic.svg)](https://www.npmjs.com/package/@santi020k/eslint-config-basic)
5
5
  [![npm downloads](https://img.shields.io/npm/dm/@santi020k/eslint-config-basic.svg)](https://www.npmjs.com/package/@santi020k/eslint-config-basic)
6
- [![Docs](https://img.shields.io/badge/docs-TypeDoc-blue.svg)](https://santi020k.github.io/eslint-config-basic/)
7
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![Docs](https://img.shields.io/badge/docs-VitePress-114d66.svg)](https://santi020k.github.io/eslint-config-basic/)
7
+ [![license](https://img.shields.io/npm/l/@santi020k/eslint-config-basic.svg)](https://github.com/santi020k/eslint-config-basic/blob/main/LICENSE)
8
8
 
9
- Welcome to **@santi020k/eslint-config-basic**, a comprehensive and opinionated ESLint configuration package for JavaScript, TypeScript, React, and other frameworks. Born from a desire to eliminate bad practices and ensure high-quality code, this configuration automates code quality checks and reduces cognitive load during code reviews by enforcing a consistent coding style across your projects.
9
+ Composable ESLint 10+ flat-config tooling for JavaScript and TypeScript projects, with optional framework packages for React, Next.js, Astro, Vue, Svelte, Solid, Angular, NestJS, and Expo.
10
10
 
11
- ## Why Use This Configuration?
11
+ ## Canonical Docs
12
12
 
13
- - **Consistency:** Enforces a uniform coding style, reducing code discrepancies and easing collaboration.
14
- - **Quality:** Promotes best practices and helps avoid common pitfalls in JavaScript, TypeScript, Frameworks, Libraries, Tools and more.
15
- - **Automation:** Catches issues early in the development process, minimizing manual code review effort.
16
- - **Customization:** While it comes with strong opinions, you can tailor it to suit your project's specific needs.
13
+ - Docs site: [santi020k.github.io/eslint-config-basic](https://santi020k.github.io/eslint-config-basic/)
14
+ - Repository: [github.com/santi020k/eslint-config-basic](https://github.com/santi020k/eslint-config-basic)
15
+ - Author: [santi020k](https://santi020k.me)
17
16
 
18
- ## Installation
17
+ > [!NOTE]
18
+ > The docs site is built with VitePress. The planned production hostname is `eslint.santi020k.me`.
19
19
 
20
- Before installing, make sure you have ESLint (version 9.0.0 or 10.0.0 or later) installed:
20
+ ## Quick Start
21
21
 
22
22
  ```bash
23
- npm install eslint --save-dev
23
+ npm install -D eslint @santi020k/eslint-config-basic
24
24
  ```
25
25
 
26
- Then, install the configuration package. **Important:** I recommend using a fixed version (do not use `^` or `~`), as any new functionality or change may introduce new linter errors that require manual updates.
27
-
28
- ```bash
29
- npm install @santi020k/eslint-config-basic --save-dev
30
- ```
31
-
32
- ## Usage
33
-
34
- Create an `eslint.config.js` file (or update your existing one) and extend **@santi020k/eslint-config-basic** based on your project type.
35
-
36
- ### Basic Usage
37
-
38
- For a basic JavaScript/Node.js project:
39
-
40
26
  ```js
41
27
  import { eslintConfig } from '@santi020k/eslint-config-basic'
42
28
 
43
- export default [
44
- ...eslintConfig()
45
- // Your custom config
46
- ]
29
+ export default eslintConfig()
47
30
  ```
48
31
 
49
- ### Advanced Usage
50
-
51
- For projects that require specific configurations (e.g., TypeScript, React, Next.js, ...Etc), use the appropriate options:
52
-
53
- ```js
54
- import { ConfigOption, eslintConfig } from '@santi020k/eslint-config-basic'
32
+ ## Framework packages
55
33
 
56
- // TypeScript project
57
- export default [
58
- ...eslintConfig({ config: [ConfigOption.Ts] })
59
- // Your custom config
60
- ]
61
-
62
- // React project
63
- export default [
64
- ...eslintConfig({ config: [ConfigOption.React] })
65
- // Your custom config
66
- ]
67
-
68
- // TypeScript and React project
69
- export default [
70
- ...eslintConfig({ config: [ConfigOption.React, ConfigOption.Ts] })
71
- // Your custom config
72
- ]
73
-
74
- // Next.js project
75
- export default [
76
- ...eslintConfig({ config: [ConfigOption.Next] })
77
- // Your custom config
78
- ]
79
-
80
- // Expo project
81
- export default [
82
- ...eslintConfig({ config: [ConfigOption.Expo] })
83
- // Your custom config
84
- ]
85
-
86
- // Astro project (supports Astro with React)
87
- export default [
88
- ...eslintConfig({ config: [ConfigOption.Astro] })
89
- // Your custom config
90
- ]
91
-
92
- // NestJS project
93
- export default [
94
- ...eslintConfig({ config: [ConfigOption.Nest] })
95
- // Your custom config
96
- ]
97
- ```
98
-
99
- ### Optional Usage
100
-
101
- There are additional optional parameters to add support for other front-end/back-end technologies. This enables you to extend support as needed:
102
-
103
- ```js
104
- import { ConfigOption, eslintConfig, OptionalOption } from '@santi020k/eslint-config-basic'
105
-
106
- export default [
107
- ...eslintConfig({
108
- config: [ConfigOption.Next, ConfigOption.Ts],
109
- optionals: [
110
- // Spell checker
111
- OptionalOption.Cspell,
112
- // TailwindCss
113
- OptionalOption.Tailwind,
114
- // Vitest and testing-library
115
- OptionalOption.Vitest,
116
- // I18next
117
- OptionalOption.I18next,
118
- // Mdx
119
- OptionalOption.Mdx,
120
- // Markdown
121
- OptionalOption.Markdown,
122
- // Stencil
123
- OptionalOption.Stencil,
124
- // SonarJS
125
- OptionalOption.Sonarjs,
126
- // Prettier
127
- OptionalOption.Prettier
128
- ]
129
- })
130
- // Your custom config
131
- ]
132
- ```
133
-
134
- ### Settings Usage (Experimental)
135
-
136
- This experimental option allows ESLint to honor your `.gitignore` file:
137
-
138
- ```js
139
- import { eslintConfig, SettingOption } from '@santi020k/eslint-config-basic'
140
-
141
- export default [
142
- ...eslintConfig({
143
- // ESLint will ignore files specified in .gitignore
144
- settings: [SettingOption.Gitignore]
145
- })
146
- // Your custom config
147
- ]
148
- ```
149
-
150
- ## AI Agent Capabilities
151
-
152
- This project is optimized for AI agents and LLM-based tools. It includes an `.agent/skills/` directory containing specialized workflows, guidelines, and context specific to this monorepo. Agents can automatically use these skills to assist with development, testing, and release processes.
153
-
154
- ## Monorepo Structure
155
-
156
- This project is a monorepo managed with **Turbo** and **npm Workspaces**.
157
-
158
- - `packages/basic`: Main package entry point.
159
- - `packages/core`: Core logic and shared types.
160
- - `packages/typescript`: TypeScript specific rules.
161
- - `packages/react`: React and Hooks rules.
162
- - `packages/next`: Next.js rules.
163
- - `packages/astro`: Astro rules.
164
- - `packages/expo`: Expo/React Native rules.
165
- - `packages/optionals`: Optional configurations (Tailwind, Vitest, etc.).
166
- - `packages/tests`: Integration tests.
167
- - `packages/playground`: Testing playground for local development.
34
+ - TypeScript: [`@santi020k/eslint-config-typescript`](https://santi020k.github.io/eslint-config-basic/frameworks/typescript.html)
35
+ - React: [`@santi020k/eslint-config-react`](https://santi020k.github.io/eslint-config-basic/frameworks/react.html)
36
+ - Next.js: [`@santi020k/eslint-config-next`](https://santi020k.github.io/eslint-config-basic/frameworks/next.html)
37
+ - Astro: [`@santi020k/eslint-config-astro`](https://santi020k.github.io/eslint-config-basic/frameworks/astro.html)
38
+ - Vue: [`@santi020k/eslint-config-vue`](https://santi020k.github.io/eslint-config-basic/frameworks/vue.html)
39
+ - Svelte: [`@santi020k/eslint-config-svelte`](https://santi020k.github.io/eslint-config-basic/frameworks/svelte.html)
40
+ - Solid: [`@santi020k/eslint-config-solid`](https://santi020k.github.io/eslint-config-basic/frameworks/solid.html)
41
+ - Angular: [`@santi020k/eslint-config-angular`](https://santi020k.github.io/eslint-config-basic/frameworks/angular.html)
42
+ - NestJS: [`@santi020k/eslint-config-nest`](https://santi020k.github.io/eslint-config-basic/frameworks/nest.html)
43
+ - Expo: [`@santi020k/eslint-config-expo`](https://santi020k.github.io/eslint-config-basic/frameworks/expo.html)
168
44
 
169
45
  ## Development
170
46
 
171
- If you want to contribute or modify the configurations:
172
-
173
- ### Prerequisites
174
-
175
- - Node.js (version specified in `.nvmrc`)
176
- - npm
177
-
178
- ### Setup
179
-
180
47
  ```bash
181
- npm install
48
+ npm run docs:dev
182
49
  ```
183
50
 
184
- ### Useful Commands
185
- ```bash
186
- npm run build # Build all packages using Turbo
187
- npm run lint # Lint all packages
188
- npm run test # Run integration tests
189
- npm run dev # Development mode with watch
190
- npm run inspector # Open ESLint config inspector
191
- npm run docs # Generate API documentation
192
- ```
193
-
194
- ### Publishing Workflow
195
-
196
- This repository uses **Changesets** (`@changesets/cli`) to automatically handle workspace dependency versioning and publishing to npm.
197
-
198
- To publish a new version of the packages:
199
-
200
- 1. Make sure you are authenticated with npm in your terminal (`npm login`).
201
- 2. Generate a changeset summarizing your changes:
202
- ```bash
203
- npm run changeset
204
- ```
205
- 3. Consume the changeset to bump package versions automatically:
206
- ```bash
207
- npm run version-packages
208
- ```
209
- 4. Build all packages and publish them to npm:
210
- ```bash
211
- npm run release
212
- ```
213
-
214
- ### ESLint Config Inspector
215
-
216
- You can visually inspect the generated ESLint configuration using the built-in inspector:
217
-
218
- ```bash
219
- npm run inspector
220
- ```
221
-
222
- This opens an interactive UI where you can see all active rules, plugins, and config layers. It's useful for debugging which rules are applied and understanding the final merged configuration.
223
-
224
- ### API Documentation
225
-
226
- Auto-generated API docs are available online:
227
- [**https://santi020k.github.io/eslint-config-basic/**](https://santi020k.github.io/eslint-config-basic/)
228
-
229
- You can also generate them locally:
230
-
231
- ```bash
232
- npm run docs
233
- ```
234
-
235
- This outputs markdown documentation to the `docs/` directory.
236
-
237
- ## Compatibility & Known Issues
238
-
239
- ### Astro 5+
240
-
241
- This package includes robust defaults for Astro projects, including:
242
-
243
- - Automatic detection of virtual scripts inside `.astro` files.
244
- - Disabled `react/jsx-no-undef` (Astro handles this).
245
- - Enforced `never` comma-dangle for Astro templates.
246
- - Support for JSX/TSX inside Astro components.
247
-
248
- ## Opinionated but Flexible
249
-
250
- This ESLint configuration is based on my personal preferences and practices, and it may evolve over time. **Important:** I recommend using a fixed version to avoid unexpected changes that might introduce new linter errors. To ensure stability, do not use `^` or `~` when specifying the version. If a rule feels too strict, consider changing it from an error to a warning to allow more flexibility during development.
251
-
252
- ## Scripts
253
-
254
- Add the following useful scripts to your `package.json`:
255
-
256
- ```json
257
- "scripts": {
258
- "lint": "eslint . --report-unused-disable-directives",
259
- "lint:fix": "npm run lint -- --fix"
260
- }
261
- ```
262
-
263
- ## How to Implement in an Existing Project
264
-
265
- 1. Install the Dependencies: Ensure that both ESLint and this configuration package are installed.
266
- 2. Update Your ESLint Configuration: Extend **@santi020k/eslint-config-basic** in your ESLint configuration file as shown above.
267
- 3. Run ESLint: Lint your project files and automatically fix issues if possible:
268
-
269
- ```bash
270
- npm run lint
271
- npm run lint:fix
272
- ```
273
-
274
- 4. **Adjust as Necessary:** Review and modify the linting rules based on your project's needs. Some rules might be too strict or not applicable; feel free to disable or adjust them.
275
-
276
- ## Future Features
277
-
278
- - [x] Testing
279
- - [x] Refactored rules structure (Monorepo transition)
280
- - [x] Astro and Expo support
281
- - [x] Enhanced documentation
282
- - [ ] Additional framework support (contributions welcome!):
283
- - [ ] Vue
284
- - [ ] Angular
285
- - [x] NestJS
286
-
287
- ## Contributing
288
-
289
- Contributions are welcome! Please read the [Contributing Guide](CONTRIBUTING.md) for details on setting up the project, adding new configurations, and submitting pull requests.
290
-
291
- ## Acknowledgements
292
-
293
- Special thanks to the developers and maintainers of the following libraries, which form the backbone of this ESLint configuration:
294
-
295
- - [eslint-config-standard](https://www.npmjs.com/package/eslint-config-standard)
296
- - [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import)
297
- - [eslint-plugin-n](https://www.npmjs.com/package/eslint-plugin-n)
298
- - [eslint-plugin-promise](https://www.npmjs.com/package/eslint-plugin-promise)
299
- - [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react)
300
- - [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)
301
- - [eslint-plugin-jsx-a11y](https://www.npmjs.com/package/eslint-plugin-jsx-a11y)
302
- - [eslint-plugin-simple-import-sort](https://www.npmjs.com/package/eslint-plugin-simple-import-sort)
303
- - [eslint-plugin-sonarjs](https://www.npmjs.com/package/eslint-plugin-sonarjs)
304
- - [eslint-plugin-unused-imports](https://www.npmjs.com/package/eslint-plugin-unused-imports)
305
- - [@stylistic/eslint-plugin](https://www.npmjs.com/package/@stylistic/eslint-plugin)
306
- - [@typescript-eslint](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin)
307
- - [@cspell/eslint-plugin](https://www.npmjs.com/package/@cspell/eslint-plugin)
308
- - [eslint-plugin-better-tailwindcss](https://www.npmjs.com/package/eslint-plugin-better-tailwindcss)
309
- - [eslint-plugin-vitest](https://www.npmjs.com/package/eslint-plugin-vitest)
310
- - [eslint-plugin-astro](https://www.npmjs.com/package/eslint-plugin-astro)
311
- - [eslint-plugin-next](https://www.npmjs.com/package/eslint-plugin-next)
312
- - [eslint-plugin-vue](https://www.npmjs.com/package/eslint-plugin-vue)
313
- - [eslint-plugin-unicorn](https://www.npmjs.com/package/eslint-plugin-unicorn)
314
- - [eslint-plugin-regexp](https://www.npmjs.com/package/eslint-plugin-regexp)
315
- - [eslint-plugin-i18next](https://www.npmjs.com/package/eslint-plugin-i18next)
316
- - [eslint-plugin-mdx](https://www.npmjs.com/package/eslint-plugin-mdx)
317
- - [eslint-config-prettier](https://www.npmjs.com/package/eslint-config-prettier)
318
- - [eslint-config-expo](https://www.npmjs.com/package/eslint-config-expo)
319
- - ...and many others
320
-
321
- Their ongoing contributions help maintain the high standards of code quality we all strive for.
322
-
323
- Thank you for using **@santi020k/eslint-config-basic**. Together, let's write cleaner, more maintainable code!
51
+ That command regenerates the API markdown and starts the VitePress site from [`packages/docs`](/Users/smith/Projects/santi020k/eslint-config-basic/packages/docs).
@@ -0,0 +1,67 @@
1
+ // src/compose.ts
2
+ import tsEslint from "typescript-eslint";
3
+ var promoteRuleSeverity = (value) => {
4
+ if (value === void 0) return void 0;
5
+ if (value === "warn" || value === 1) return "error";
6
+ if (Array.isArray(value) && (value[0] === "warn" || value[0] === 1)) {
7
+ return ["error", ...value.slice(1)];
8
+ }
9
+ return value;
10
+ };
11
+ var applyStrictMode = (configs, strict) => {
12
+ if (!strict) return configs;
13
+ return configs.map((config) => {
14
+ if (config.rules) {
15
+ const strictRules = Object.fromEntries(
16
+ Object.entries(config.rules).map(([key, value]) => [key, promoteRuleSeverity(value)])
17
+ );
18
+ return { ...config, rules: strictRules };
19
+ }
20
+ return config;
21
+ });
22
+ };
23
+ var getTypedRulesOverrides = () => ({
24
+ name: "eslint-config-basic/typed-rules-overrides",
25
+ files: [
26
+ "**/*.js",
27
+ "**/*.jsx",
28
+ "**/*.mjs",
29
+ "**/*.cjs",
30
+ "**/*.md",
31
+ "**/*.mdx",
32
+ "**/*.md/*.ts",
33
+ "**/*.md/*.tsx",
34
+ "**/*.mdx/*.ts",
35
+ "**/*.mdx/*.tsx",
36
+ "**/*.astro/*.js",
37
+ "**/*.astro/*.ts",
38
+ "**/*.vue/*.ts",
39
+ "**/*.vue/*.tsx",
40
+ "**/*.svelte/*.ts",
41
+ "**/*.svelte/*.tsx",
42
+ "**/.vitepress/**/*.ts",
43
+ "**/.vitepress/**/*.mts",
44
+ "**/.vitepress/**/*.tsx",
45
+ "**/.vitepress/**/*.js",
46
+ "**/.vitepress/**/*.mjs",
47
+ "**/.vitepress/**/*.jsx"
48
+ ],
49
+ languageOptions: {
50
+ parserOptions: {
51
+ project: null,
52
+ program: null,
53
+ projectService: false,
54
+ allowDefaultProject: true
55
+ }
56
+ },
57
+ rules: {
58
+ ...tsEslint.configs.disableTypeChecked.rules,
59
+ "no-unused-expressions": "off",
60
+ "@typescript-eslint/no-unused-expressions": "off"
61
+ }
62
+ });
63
+
64
+ export {
65
+ applyStrictMode,
66
+ getTypedRulesOverrides
67
+ };
@@ -0,0 +1,213 @@
1
+ import {
2
+ applyStrictMode,
3
+ getTypedRulesOverrides
4
+ } from "./chunk-2Z6LYTBS.js";
5
+ import {
6
+ getOptionalConfigs,
7
+ getPrettierConfig
8
+ } from "./chunk-WGZBHVWD.js";
9
+ import {
10
+ resolveFramework,
11
+ resolvePreset
12
+ } from "./chunk-SSGAWVVA.js";
13
+
14
+ // src/index.ts
15
+ import {
16
+ coreConfig,
17
+ createCoreConfig,
18
+ detectProjectOptions,
19
+ gitignore,
20
+ hasReactConfig,
21
+ NextMode,
22
+ Runtime,
23
+ Setting
24
+ } from "@santi020k/eslint-config-core";
25
+ import { createTypescriptConfig } from "@santi020k/eslint-config-typescript";
26
+ import {
27
+ Library,
28
+ Tool,
29
+ Extension,
30
+ Setting as Setting2,
31
+ Runtime as Runtime2,
32
+ Preset,
33
+ Testing,
34
+ Format,
35
+ NextMode as NextMode2,
36
+ ReactConfigKeys,
37
+ hasReactConfig as hasReactConfig2,
38
+ coreConfig as coreConfig2,
39
+ createCoreConfig as createCoreConfig2,
40
+ getGlobalsForRuntime,
41
+ jsConfig,
42
+ gitignore as gitignore2,
43
+ detectProjectOptions as detectProjectOptions2
44
+ } from "@santi020k/eslint-config-core";
45
+ import { typescriptConfig, tsConfig } from "@santi020k/eslint-config-typescript";
46
+ import {
47
+ cspell,
48
+ cypress,
49
+ graphql,
50
+ i18next,
51
+ jest,
52
+ jsdoc,
53
+ jsonc,
54
+ markdown,
55
+ mdx,
56
+ perfectionist,
57
+ playwright,
58
+ prettier,
59
+ regexp,
60
+ security,
61
+ sonarjs,
62
+ stencil,
63
+ storybook,
64
+ swagger,
65
+ tailwind,
66
+ tanstackQuery,
67
+ tanstackRouter,
68
+ testingLibrary,
69
+ toml,
70
+ unicorn,
71
+ vitest,
72
+ yaml
73
+ } from "@santi020k/eslint-config-optionals";
74
+ var eslintConfig = (options) => {
75
+ const detected = options === void 0 ? detectProjectOptions() : {};
76
+ const presetDefaults = options?.preset ? resolvePreset(options.preset) : {};
77
+ const {
78
+ typescript = presetDefaults.typescript ?? detected.typescript ?? false,
79
+ libraries = presetDefaults.libraries ?? detected.libraries ?? [],
80
+ testing = presetDefaults.testing ?? detected.testing ?? [],
81
+ formats = presetDefaults.formats ?? detected.formats ?? [],
82
+ tools = presetDefaults.tools ?? detected.tools ?? [],
83
+ extensions = presetDefaults.extensions ?? detected.extensions ?? [],
84
+ settings = detected.settings ?? [],
85
+ strict = options?.strict ?? false,
86
+ runtime = presetDefaults.runtime ?? detected.runtime ?? Runtime.Universal,
87
+ tsconfigRootDir = options?.tsconfigRootDir,
88
+ nextMode = presetDefaults.nextMode ?? detected.nextMode ?? NextMode.Pages,
89
+ frameworks = { ...presetDefaults.frameworks, ...options?.frameworks }
90
+ } = options ?? {};
91
+ const uniqueLibraries = [...new Set(libraries)];
92
+ const uniqueTesting = [...new Set(testing)];
93
+ const uniqueFormats = [...new Set(formats)];
94
+ const uniqueTools = [...new Set(tools)];
95
+ const uniqueExtensions = [...new Set(extensions)];
96
+ const uniqueSettings = [...new Set(settings)];
97
+ if ((frameworks.next || frameworks.expo) && !frameworks.react) {
98
+ throw new TypeError(
99
+ "Next and Expo configurations require frameworks.react. Import @santi020k/eslint-config-react and pass it via frameworks.react."
100
+ );
101
+ }
102
+ const reactParam = resolveFramework("react", frameworks.react);
103
+ const nextParam = resolveFramework("next", frameworks.next);
104
+ const astroParam = resolveFramework("astro", frameworks.astro);
105
+ const expoParam = resolveFramework("expo", frameworks.expo);
106
+ const nestParam = resolveFramework("nest", frameworks.nest);
107
+ const vueParam = resolveFramework("vue", frameworks.vue);
108
+ const svelteParam = resolveFramework("svelte", frameworks.svelte);
109
+ const solidParam = resolveFramework("solid", frameworks.solid);
110
+ const angularParam = resolveFramework("angular", frameworks.angular);
111
+ const hasReact = hasReactConfig({ frameworks });
112
+ const useGitignore = !uniqueSettings.includes(Setting.NoGitignore);
113
+ const runtimeCoreConfig = runtime !== Runtime.Universal ? createCoreConfig(runtime) : coreConfig;
114
+ const configs = [
115
+ // Settings
116
+ ...useGitignore ? gitignore : [],
117
+ // Global TSConfig Root Dir fix
118
+ ...tsconfigRootDir ? [{
119
+ name: "eslint-config-basic/tsconfig-root-dir",
120
+ languageOptions: {
121
+ parserOptions: {
122
+ tsconfigRootDir
123
+ }
124
+ }
125
+ }] : [],
126
+ // Core JS config with runtime-aware globals
127
+ ...runtimeCoreConfig,
128
+ // React config (included if any React-based framework is used/passed)
129
+ ...hasReact ? reactParam : [],
130
+ // Framework-specific configs (Modularized)
131
+ ...typescript ? createTypescriptConfig({ tsconfigRootDir }) : [],
132
+ ...nextParam,
133
+ // Next.js App Router overrides (#12)
134
+ ...frameworks.next && nextMode === NextMode.AppRouter ? [
135
+ {
136
+ name: "eslint-config-next/app-router-overrides",
137
+ files: ["app/**/*.{ts,tsx}"],
138
+ rules: {
139
+ "@next/next/no-html-link-for-pages": "off"
140
+ }
141
+ }
142
+ ] : [],
143
+ ...astroParam,
144
+ ...expoParam,
145
+ ...nestParam,
146
+ ...vueParam,
147
+ ...svelteParam,
148
+ ...solidParam,
149
+ ...angularParam,
150
+ // Optionals
151
+ ...getOptionalConfigs(
152
+ uniqueLibraries,
153
+ uniqueTools,
154
+ uniqueTesting,
155
+ uniqueFormats,
156
+ uniqueExtensions
157
+ ),
158
+ // Global overrides for non-TS files
159
+ getTypedRulesOverrides(),
160
+ // Prettier always last
161
+ ...getPrettierConfig(uniqueTools)
162
+ ];
163
+ return applyStrictMode(configs, strict);
164
+ };
165
+
166
+ export {
167
+ eslintConfig,
168
+ Library,
169
+ Tool,
170
+ Extension,
171
+ Setting2 as Setting,
172
+ Runtime2 as Runtime,
173
+ Preset,
174
+ Testing,
175
+ Format,
176
+ NextMode2 as NextMode,
177
+ ReactConfigKeys,
178
+ hasReactConfig2 as hasReactConfig,
179
+ coreConfig2 as coreConfig,
180
+ createCoreConfig2 as createCoreConfig,
181
+ getGlobalsForRuntime,
182
+ jsConfig,
183
+ gitignore2 as gitignore,
184
+ detectProjectOptions2 as detectProjectOptions,
185
+ typescriptConfig,
186
+ tsConfig,
187
+ cspell,
188
+ cypress,
189
+ graphql,
190
+ i18next,
191
+ jest,
192
+ jsdoc,
193
+ jsonc,
194
+ markdown,
195
+ mdx,
196
+ perfectionist,
197
+ playwright,
198
+ prettier,
199
+ regexp,
200
+ security,
201
+ sonarjs,
202
+ stencil,
203
+ storybook,
204
+ swagger,
205
+ tailwind,
206
+ tanstackQuery,
207
+ tanstackRouter,
208
+ testingLibrary,
209
+ toml,
210
+ unicorn,
211
+ vitest,
212
+ yaml
213
+ };
@@ -0,0 +1,52 @@
1
+ // src/resolvers.ts
2
+ import {
3
+ Extension,
4
+ Format,
5
+ Library,
6
+ Preset,
7
+ Runtime,
8
+ Testing,
9
+ Tool
10
+ } from "@santi020k/eslint-config-core";
11
+ var resolveFramework = (frameworkName, framework) => {
12
+ if (!framework) return [];
13
+ if (framework === true) {
14
+ throw new TypeError(
15
+ `Framework "${frameworkName}" requires an imported config. Install @santi020k/eslint-config-${frameworkName} and pass it via frameworks.${frameworkName}.`
16
+ );
17
+ }
18
+ return Array.isArray(framework) ? framework : framework.default;
19
+ };
20
+ var resolvePreset = (preset) => {
21
+ switch (preset) {
22
+ case Preset.Basic:
23
+ return { runtime: Runtime.Universal };
24
+ case Preset.Node:
25
+ return {
26
+ typescript: true,
27
+ runtime: Runtime.Node
28
+ };
29
+ case Preset.Browser:
30
+ return {
31
+ typescript: true,
32
+ runtime: Runtime.Browser
33
+ };
34
+ case Preset.All:
35
+ return {
36
+ typescript: true,
37
+ libraries: Object.values(Library),
38
+ tools: Object.values(Tool),
39
+ testing: Object.values(Testing),
40
+ formats: Object.values(Format),
41
+ extensions: Object.values(Extension),
42
+ runtime: Runtime.Universal
43
+ };
44
+ default:
45
+ return {};
46
+ }
47
+ };
48
+
49
+ export {
50
+ resolveFramework,
51
+ resolvePreset
52
+ };
@@ -0,0 +1,71 @@
1
+ // src/optionals.ts
2
+ import {
3
+ Extension,
4
+ Format,
5
+ Library,
6
+ Testing,
7
+ Tool
8
+ } from "@santi020k/eslint-config-core";
9
+ import {
10
+ cspell,
11
+ cypress,
12
+ graphql,
13
+ i18next,
14
+ jest,
15
+ jsdoc,
16
+ jsonc,
17
+ markdown,
18
+ mdx,
19
+ perfectionist,
20
+ playwright,
21
+ prettier,
22
+ regexp,
23
+ security,
24
+ sonarjs,
25
+ stencil,
26
+ storybook,
27
+ swagger,
28
+ tailwind,
29
+ tanstackQuery,
30
+ tanstackRouter,
31
+ testingLibrary,
32
+ toml,
33
+ unicorn,
34
+ vitest,
35
+ yaml
36
+ } from "@santi020k/eslint-config-optionals";
37
+ var getOptionalConfigs = (libraries, tools, testing, formats, extensions) => {
38
+ const configs = [];
39
+ if (tools.includes(Tool.Cspell)) configs.push(...cspell);
40
+ if (libraries.includes(Library.Tailwind)) configs.push(...tailwind);
41
+ if (libraries.includes(Library.I18next)) configs.push(...i18next);
42
+ if (libraries.includes(Library.Stencil)) configs.push(...stencil);
43
+ if (libraries.includes(Library.TanstackQuery)) configs.push(...tanstackQuery);
44
+ if (libraries.includes(Library.TanstackRouter)) configs.push(...tanstackRouter);
45
+ if (libraries.includes(Library.Storybook)) configs.push(...storybook);
46
+ if (testing.includes(Testing.Vitest)) configs.push(...vitest);
47
+ if (testing.includes(Testing.Playwright)) configs.push(...playwright);
48
+ if (testing.includes(Testing.Jest)) configs.push(...jest);
49
+ if (testing.includes(Testing.Cypress)) configs.push(...cypress);
50
+ if (testing.includes(Testing.TestingLibrary)) configs.push(...testingLibrary);
51
+ if (formats.includes(Format.Mdx)) configs.push(...mdx);
52
+ if (formats.includes(Format.Markdown)) configs.push(...markdown);
53
+ if (formats.includes(Format.Jsonc)) configs.push(...jsonc);
54
+ if (formats.includes(Format.Yaml)) configs.push(...yaml);
55
+ if (formats.includes(Format.Toml)) configs.push(...toml);
56
+ if (formats.includes(Format.Graphql)) configs.push(...graphql);
57
+ if (extensions.includes(Extension.Regexp)) configs.push(...regexp);
58
+ if (extensions.includes(Extension.Unicorn)) configs.push(...unicorn);
59
+ if (extensions.includes(Extension.Sonarjs)) configs.push(...sonarjs);
60
+ if (extensions.includes(Extension.Security)) configs.push(...security);
61
+ if (extensions.includes(Extension.Perfectionist)) configs.push(...perfectionist);
62
+ if (tools.includes(Tool.Jsdoc)) configs.push(...jsdoc);
63
+ if (tools.includes(Tool.Swagger)) configs.push(...swagger);
64
+ return configs;
65
+ };
66
+ var getPrettierConfig = (tools) => tools.includes(Tool.Prettier) ? prettier : [];
67
+
68
+ export {
69
+ getOptionalConfigs,
70
+ getPrettierConfig
71
+ };
package/dist/cli.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ declare const handleInit: (cwd?: string) => void;
3
+ declare const handleUpdate: (cwd?: string) => void;
4
+
5
+ export { handleInit, handleUpdate };
package/dist/cli.js ADDED
@@ -0,0 +1,100 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ detectProjectOptions
4
+ } from "./chunk-CH2MVUQN.js";
5
+ import "./chunk-2Z6LYTBS.js";
6
+ import "./chunk-WGZBHVWD.js";
7
+ import "./chunk-SSGAWVVA.js";
8
+
9
+ // src/cli.ts
10
+ import { existsSync, readFileSync, writeFileSync } from "fs";
11
+ import { basename, join } from "path";
12
+ import { fileURLToPath } from "url";
13
+ var getDefaultConfigFilename = (cwd) => {
14
+ const packageJsonPath = join(cwd, "package.json");
15
+ if (!existsSync(packageJsonPath)) return "eslint.config.mjs";
16
+ try {
17
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
18
+ return packageJson.type === "module" ? "eslint.config.js" : "eslint.config.mjs";
19
+ } catch {
20
+ return "eslint.config.mjs";
21
+ }
22
+ };
23
+ var resolveConfigPath = (cwd) => {
24
+ const existingConfigPath = [
25
+ "eslint.config.js",
26
+ "eslint.config.mjs"
27
+ ].map((filename) => join(cwd, filename)).find(existsSync);
28
+ return existingConfigPath ?? join(cwd, getDefaultConfigFilename(cwd));
29
+ };
30
+ var getFrameworkKeys = (frameworks) => {
31
+ const frameworkKeys = new Set(Object.keys(frameworks ?? {}));
32
+ if (frameworkKeys.has("next") || frameworkKeys.has("expo")) {
33
+ frameworkKeys.add("react");
34
+ }
35
+ return [...frameworkKeys];
36
+ };
37
+ var createConfigContent = (cwd) => {
38
+ const options = detectProjectOptions(cwd);
39
+ const frameworkKeys = getFrameworkKeys(options.frameworks);
40
+ const imports = ["import { eslintConfig } from '@santi020k/eslint-config-basic'"];
41
+ frameworkKeys.forEach((key) => {
42
+ imports.push(`import ${key} from '@santi020k/eslint-config-${key}'`);
43
+ });
44
+ const configContent = `${imports.join("\n")}
45
+
46
+ export default eslintConfig({
47
+ typescript: ${JSON.stringify(options.typescript ?? false)},
48
+ frameworks: {
49
+ ${frameworkKeys.map((key) => `${key}: ${key}`).join(",\n ")}
50
+ },
51
+ libraries: ${JSON.stringify(options.libraries ?? [], null, 2)},
52
+ testing: ${JSON.stringify(options.testing ?? [], null, 2)},
53
+ formats: ${JSON.stringify(options.formats ?? [], null, 2)},
54
+ tools: ${JSON.stringify(options.tools ?? [], null, 2)},
55
+ extensions: ${JSON.stringify(options.extensions ?? [], null, 2)},
56
+ runtime: ${JSON.stringify(options.runtime ?? "universal")},
57
+ settings: ${JSON.stringify(options.settings ?? [], null, 2)}
58
+ })
59
+ `;
60
+ return {
61
+ configPath: resolveConfigPath(cwd),
62
+ configContent
63
+ };
64
+ };
65
+ var handleInit = (cwd = process.cwd()) => {
66
+ const configPath = resolveConfigPath(cwd);
67
+ if (existsSync(configPath)) {
68
+ console.warn(`\u26A0\uFE0F ${basename(configPath)} already exists. Skipping...`);
69
+ return;
70
+ }
71
+ console.log("\u{1F50D} Detecting project settings...");
72
+ const { configContent } = createConfigContent(cwd);
73
+ writeFileSync(configPath, configContent);
74
+ console.log(`\u2705 Created ${basename(configPath)} with auto-detected settings!`);
75
+ console.log("\u{1F680} Ready to lint!");
76
+ };
77
+ var handleUpdate = (cwd = process.cwd()) => {
78
+ console.log("\u{1F50D} Detecting project settings...");
79
+ const { configPath, configContent } = createConfigContent(cwd);
80
+ writeFileSync(configPath, configContent);
81
+ console.log(`\u2705 Updated ${basename(configPath)} with auto-detected settings!`);
82
+ console.log("\u{1F680} Ready to lint!");
83
+ };
84
+ var run = () => {
85
+ const command = process.argv[2];
86
+ if (command === "init") {
87
+ handleInit();
88
+ } else if (command === "update") {
89
+ handleUpdate();
90
+ } else {
91
+ console.log("Usage: basic-eslint <init|update>");
92
+ }
93
+ };
94
+ if (process.argv[1] && (process.argv[1] === fileURLToPath(import.meta.url) || process.argv[1].endsWith("cli.js") || process.argv[1].endsWith("cli.ts"))) {
95
+ run();
96
+ }
97
+ export {
98
+ handleInit,
99
+ handleUpdate
100
+ };
@@ -0,0 +1,13 @@
1
+ import { FlatConfigArray } from '@santi020k/eslint-config-core';
2
+ import { TSESLint } from '@typescript-eslint/utils';
3
+
4
+ /**
5
+ * Applies strict mode by promoting all 'warn' rules to 'error'.
6
+ */
7
+ declare const applyStrictMode: (configs: FlatConfigArray, strict: boolean) => FlatConfigArray;
8
+ /**
9
+ * Returns global overrides for non-TS files to prevent typed rules errors (#15).
10
+ */
11
+ declare const getTypedRulesOverrides: () => TSESLint.FlatConfig.Config;
12
+
13
+ export { applyStrictMode, getTypedRulesOverrides };
@@ -0,0 +1,8 @@
1
+ import {
2
+ applyStrictMode,
3
+ getTypedRulesOverrides
4
+ } from "./chunk-2Z6LYTBS.js";
5
+ export {
6
+ applyStrictMode,
7
+ getTypedRulesOverrides
8
+ };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,7 @@
1
1
  import { EslintConfigOptions, FlatConfigArray } from '@santi020k/eslint-config-core';
2
- export { ConfigOption, EslintConfigOptions, FlatConfigArray, OptionalOption, ReactConfigs, SettingOption, applyConfigIfOptionPresent, coreConfig, gitignore, hasReactConfig, jsConfig } from '@santi020k/eslint-config-core';
2
+ export { EslintConfigOptions, Extension, FlatConfigArray, Format, ImportedFramework, Library, NextMode, Preset, ReactConfigKeys, Runtime, Setting, Testing, Tool, coreConfig, createCoreConfig, detectProjectOptions, getGlobalsForRuntime, gitignore, hasReactConfig, jsConfig } from '@santi020k/eslint-config-core';
3
3
  export { tsConfig, typescriptConfig } from '@santi020k/eslint-config-typescript';
4
- export { reactConfig } from '@santi020k/eslint-config-react';
5
- export { nextConfig } from '@santi020k/eslint-config-next';
6
- export { astroConfig } from '@santi020k/eslint-config-astro';
7
- export { expoConfig } from '@santi020k/eslint-config-expo';
8
- export { nestConfig } from '@santi020k/eslint-config-nest';
9
- export { vueConfig } from '@santi020k/eslint-config-vue';
10
- export { cspell, i18next, markdown, mdx, playwright, prettier, regexp, sonarjs, stencil, tailwind, unicorn, vitest } from '@santi020k/eslint-config-optionals';
4
+ export { cspell, cypress, graphql, i18next, jest, jsdoc, jsonc, markdown, mdx, perfectionist, playwright, prettier, regexp, security, sonarjs, stencil, storybook, swagger, tailwind, tanstackQuery, tanstackRouter, testingLibrary, toml, unicorn, vitest, yaml } from '@santi020k/eslint-config-optionals';
11
5
 
12
6
  /**
13
7
  * Generates the ESLint configuration array, applying configurations
@@ -16,6 +10,6 @@ export { cspell, i18next, markdown, mdx, playwright, prettier, regexp, sonarjs,
16
10
  * @param {EslintConfigOptions} options - Configuration and optional settings
17
11
  * @returns {FlatConfigArray} The final ESLint configuration array
18
12
  */
19
- declare const eslintConfig: ({ config, optionals, settings }?: EslintConfigOptions) => FlatConfigArray;
13
+ declare const eslintConfig: (options?: EslintConfigOptions) => FlatConfigArray;
20
14
 
21
15
  export { eslintConfig };
package/dist/index.js CHANGED
@@ -1,135 +1,99 @@
1
- // src/index.ts
2
1
  import {
3
- ConfigOption,
4
- OptionalOption,
5
- SettingOption,
6
- ReactConfigs,
7
- applyConfigIfOptionPresent,
8
- hasReactConfig,
2
+ Extension,
3
+ Format,
4
+ Library,
5
+ NextMode,
6
+ Preset,
7
+ ReactConfigKeys,
8
+ Runtime,
9
+ Setting,
10
+ Testing,
11
+ Tool,
9
12
  coreConfig,
10
- jsConfig,
11
- gitignore
12
- } from "@santi020k/eslint-config-core";
13
- import { typescriptConfig, tsConfig } from "@santi020k/eslint-config-typescript";
14
- import { reactConfig } from "@santi020k/eslint-config-react";
15
- import { nextConfig } from "@santi020k/eslint-config-next";
16
- import { astroConfig } from "@santi020k/eslint-config-astro";
17
- import { expoConfig } from "@santi020k/eslint-config-expo";
18
- import { nestConfig } from "@santi020k/eslint-config-nest";
19
- import { vueConfig } from "@santi020k/eslint-config-vue";
20
- import {
13
+ createCoreConfig,
21
14
  cspell,
15
+ cypress,
16
+ detectProjectOptions,
17
+ eslintConfig,
18
+ getGlobalsForRuntime,
19
+ gitignore,
20
+ graphql,
21
+ hasReactConfig,
22
22
  i18next,
23
+ jest,
24
+ jsConfig,
25
+ jsdoc,
26
+ jsonc,
23
27
  markdown,
24
28
  mdx,
29
+ perfectionist,
30
+ playwright,
25
31
  prettier,
26
32
  regexp,
33
+ security,
34
+ sonarjs,
27
35
  stencil,
36
+ storybook,
37
+ swagger,
28
38
  tailwind,
39
+ tanstackQuery,
40
+ tanstackRouter,
41
+ testingLibrary,
42
+ toml,
43
+ tsConfig,
44
+ typescriptConfig,
29
45
  unicorn,
30
46
  vitest,
31
- playwright,
32
- sonarjs
33
- } from "@santi020k/eslint-config-optionals";
34
- import { astroConfig as astroConfig2 } from "@santi020k/eslint-config-astro";
35
- import {
36
- applyConfigIfOptionPresent as applyConfigIfOptionPresent2,
37
- ConfigOption as ConfigOption2,
38
- coreConfig as coreConfig2,
39
- gitignore as gitignore2,
40
- hasReactConfig as hasReactConfig2,
41
- OptionalOption as OptionalOption2,
42
- SettingOption as SettingOption2
43
- } from "@santi020k/eslint-config-core";
44
- import { expoConfig as expoConfig2 } from "@santi020k/eslint-config-expo";
45
- import { nestConfig as nestConfig2 } from "@santi020k/eslint-config-nest";
46
- import { nextConfig as nextConfig2 } from "@santi020k/eslint-config-next";
47
- import {
48
- cspell as cspell2,
49
- i18next as i18next2,
50
- markdown as markdown2,
51
- mdx as mdx2,
52
- playwright as playwright2,
53
- prettier as prettier2,
54
- regexp as regexp2,
55
- sonarjs as sonarjs2,
56
- stencil as stencil2,
57
- tailwind as tailwind2,
58
- unicorn as unicorn2,
59
- vitest as vitest2
60
- } from "@santi020k/eslint-config-optionals";
61
- import { reactConfig as reactConfig2 } from "@santi020k/eslint-config-react";
62
- import { typescriptConfig as typescriptConfig2 } from "@santi020k/eslint-config-typescript";
63
- import { vueConfig as vueConfig2 } from "@santi020k/eslint-config-vue";
64
- var eslintConfig = ({
65
- config = [],
66
- optionals = [],
67
- settings = []
68
- } = {}) => {
69
- const uniqueConfig = [...new Set(config)];
70
- const uniqueOptionals = [...new Set(optionals)];
71
- const uniqueSettings = [...new Set(settings)];
72
- const hasReact = hasReactConfig2(uniqueConfig);
73
- const useGitignore = !uniqueSettings.includes(SettingOption2.NoGitignore);
74
- return [
75
- // Settings
76
- ...useGitignore ? gitignore2 : [],
77
- // Core JS config (always included)
78
- ...coreConfig2,
79
- // React config (included if any React-based framework is used)
80
- ...hasReact ? reactConfig2 : [],
81
- // Framework-specific configs
82
- ...applyConfigIfOptionPresent2(uniqueConfig, ConfigOption2.Ts, typescriptConfig2),
83
- ...applyConfigIfOptionPresent2(uniqueConfig, ConfigOption2.Next, nextConfig2),
84
- ...applyConfigIfOptionPresent2(uniqueConfig, ConfigOption2.Astro, astroConfig2),
85
- ...applyConfigIfOptionPresent2(uniqueConfig, ConfigOption2.Expo, expoConfig2),
86
- ...applyConfigIfOptionPresent2(uniqueConfig, ConfigOption2.Nest, nestConfig2),
87
- ...applyConfigIfOptionPresent2(uniqueConfig, ConfigOption2.Vue, vueConfig2),
88
- // Optionals
89
- ...uniqueOptionals.includes(OptionalOption2.Cspell) ? cspell2 : [],
90
- ...uniqueOptionals.includes(OptionalOption2.Tailwind) ? tailwind2 : [],
91
- ...uniqueOptionals.includes(OptionalOption2.Vitest) ? vitest2 : [],
92
- ...uniqueOptionals.includes(OptionalOption2.I18next) ? i18next2 : [],
93
- ...uniqueOptionals.includes(OptionalOption2.Stencil) ? stencil2 : [],
94
- ...uniqueOptionals.includes(OptionalOption2.Regexp) ? regexp2 : [],
95
- ...uniqueOptionals.includes(OptionalOption2.Mdx) ? mdx2 : [],
96
- ...uniqueOptionals.includes(OptionalOption2.Markdown) ? markdown2 : [],
97
- ...uniqueOptionals.includes(OptionalOption2.Unicorn) ? unicorn2 : [],
98
- ...uniqueOptionals.includes(OptionalOption2.Sonarjs) ? sonarjs2 : [],
99
- ...uniqueOptionals.includes(OptionalOption2.Playwright) ? playwright2 : [],
100
- // Prettier must be last to override stylistic rules
101
- ...uniqueOptionals.includes(OptionalOption2.Prettier) ? prettier2 : []
102
- ];
103
- };
47
+ yaml
48
+ } from "./chunk-CH2MVUQN.js";
49
+ import "./chunk-2Z6LYTBS.js";
50
+ import "./chunk-WGZBHVWD.js";
51
+ import "./chunk-SSGAWVVA.js";
104
52
  export {
105
- ConfigOption,
106
- OptionalOption,
107
- ReactConfigs,
108
- SettingOption,
109
- applyConfigIfOptionPresent,
110
- astroConfig,
53
+ Extension,
54
+ Format,
55
+ Library,
56
+ NextMode,
57
+ Preset,
58
+ ReactConfigKeys,
59
+ Runtime,
60
+ Setting,
61
+ Testing,
62
+ Tool,
111
63
  coreConfig,
64
+ createCoreConfig,
112
65
  cspell,
66
+ cypress,
67
+ detectProjectOptions,
113
68
  eslintConfig,
114
- expoConfig,
69
+ getGlobalsForRuntime,
115
70
  gitignore,
71
+ graphql,
116
72
  hasReactConfig,
117
73
  i18next,
74
+ jest,
118
75
  jsConfig,
76
+ jsdoc,
77
+ jsonc,
119
78
  markdown,
120
79
  mdx,
121
- nestConfig,
122
- nextConfig,
80
+ perfectionist,
123
81
  playwright,
124
82
  prettier,
125
- reactConfig,
126
83
  regexp,
84
+ security,
127
85
  sonarjs,
128
86
  stencil,
87
+ storybook,
88
+ swagger,
129
89
  tailwind,
90
+ tanstackQuery,
91
+ tanstackRouter,
92
+ testingLibrary,
93
+ toml,
130
94
  tsConfig,
131
95
  typescriptConfig,
132
96
  unicorn,
133
97
  vitest,
134
- vueConfig
98
+ yaml
135
99
  };
@@ -0,0 +1,13 @@
1
+ import { Library, Tool, Testing, Format, Extension, FlatConfigArray } from '@santi020k/eslint-config-core';
2
+
3
+ /**
4
+ * Gets the optional configurations based on selected options.
5
+ * This function maintains the recommended ordering (e.g. Prettier last).
6
+ */
7
+ declare const getOptionalConfigs: (libraries: Library[], tools: Tool[], testing: Testing[], formats: Format[], extensions: Extension[]) => FlatConfigArray;
8
+ /**
9
+ * Returns the Prettier configuration if selected.
10
+ */
11
+ declare const getPrettierConfig: (tools: Tool[]) => FlatConfigArray;
12
+
13
+ export { getOptionalConfigs, getPrettierConfig };
@@ -0,0 +1,8 @@
1
+ import {
2
+ getOptionalConfigs,
3
+ getPrettierConfig
4
+ } from "./chunk-WGZBHVWD.js";
5
+ export {
6
+ getOptionalConfigs,
7
+ getPrettierConfig
8
+ };
@@ -0,0 +1,12 @@
1
+ import { ImportedFramework, FlatConfigArray, Preset, EslintConfigOptions } from '@santi020k/eslint-config-core';
2
+
3
+ /**
4
+ * Resolves an imported framework (either array or default export) into a config array.
5
+ */
6
+ declare const resolveFramework: (frameworkName: string, framework?: ImportedFramework) => FlatConfigArray;
7
+ /**
8
+ * Resolves a preset into options
9
+ */
10
+ declare const resolvePreset: (preset: Preset) => Partial<EslintConfigOptions>;
11
+
12
+ export { resolveFramework, resolvePreset };
@@ -0,0 +1,8 @@
1
+ import {
2
+ resolveFramework,
3
+ resolvePreset
4
+ } from "./chunk-SSGAWVVA.js";
5
+ export {
6
+ resolveFramework,
7
+ resolvePreset
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@santi020k/eslint-config-basic",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "A comprehensive ESLint configuration package for JavaScript, TypeScript, and React projects.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -24,25 +24,59 @@
24
24
  "clean": "rm -rf dist",
25
25
  "check:exports": "publint",
26
26
  "prepack": "rm -f README.md && cp ../../README.md ./README.md",
27
- "postpack": "rm -f README.md && ln -s ../../README.md ./README.md"
27
+ "postpack": "rm -f README.md && ln -s ../../README.md ./README.md",
28
+ "typecheck": "tsc --noEmit"
29
+ },
30
+ "bin": {
31
+ "basic-eslint": "./dist/cli.js"
28
32
  },
29
33
  "dependencies": {
30
- "@santi020k/eslint-config-astro": "*",
31
- "@santi020k/eslint-config-core": "*",
32
- "@santi020k/eslint-config-expo": "*",
33
- "@santi020k/eslint-config-nest": "*",
34
- "@santi020k/eslint-config-next": "*",
35
- "@santi020k/eslint-config-optionals": "*",
36
- "@santi020k/eslint-config-react": "*",
37
- "@santi020k/eslint-config-typescript": "*",
38
- "@santi020k/eslint-config-vue": "*",
39
- "@eslint/compat": "^2.0.3",
40
- "@eslint/js": "^10.0.1",
41
- "@typescript-eslint/eslint-plugin": "^8.57.0",
42
- "@typescript-eslint/type-utils": "^8.57.0",
43
- "cross-dirname": "^0.1.0",
44
- "eslint": "^10.0.3",
45
- "typescript-eslint": "^8.57.0"
34
+ "@santi020k/eslint-config-core": "^0.8.1",
35
+ "@santi020k/eslint-config-optionals": "^0.8.1",
36
+ "@santi020k/eslint-config-typescript": "^0.8.1",
37
+ "eslint": "^10.1.0",
38
+ "typescript-eslint": "^8.57.1"
39
+ },
40
+ "peerDependencies": {
41
+ "@santi020k/eslint-config-angular": "^0.8.1",
42
+ "@santi020k/eslint-config-astro": "^0.8.1",
43
+ "@santi020k/eslint-config-expo": "^0.8.1",
44
+ "@santi020k/eslint-config-nest": "^0.8.1",
45
+ "@santi020k/eslint-config-next": "^0.8.1",
46
+ "@santi020k/eslint-config-react": "^0.8.1",
47
+ "@santi020k/eslint-config-solid": "^0.8.1",
48
+ "@santi020k/eslint-config-svelte": "^0.8.1",
49
+ "@santi020k/eslint-config-vue": "^0.8.1",
50
+ "eslint": "^10.1.0"
51
+ },
52
+ "peerDependenciesMeta": {
53
+ "@santi020k/eslint-config-angular": {
54
+ "optional": true
55
+ },
56
+ "@santi020k/eslint-config-astro": {
57
+ "optional": true
58
+ },
59
+ "@santi020k/eslint-config-expo": {
60
+ "optional": true
61
+ },
62
+ "@santi020k/eslint-config-nest": {
63
+ "optional": true
64
+ },
65
+ "@santi020k/eslint-config-next": {
66
+ "optional": true
67
+ },
68
+ "@santi020k/eslint-config-react": {
69
+ "optional": true
70
+ },
71
+ "@santi020k/eslint-config-solid": {
72
+ "optional": true
73
+ },
74
+ "@santi020k/eslint-config-svelte": {
75
+ "optional": true
76
+ },
77
+ "@santi020k/eslint-config-vue": {
78
+ "optional": true
79
+ }
46
80
  },
47
81
  "devDependencies": {
48
82
  "tsup": "^8.5.1",
@@ -52,6 +86,9 @@
52
86
  "publishConfig": {
53
87
  "access": "public"
54
88
  },
89
+ "engines": {
90
+ "node": ">=18.18.0"
91
+ },
55
92
  "license": "MIT",
56
93
  "author": "santi020k",
57
94
  "repository": {