@santi020k/eslint-config-lite 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @santi020k/eslint-config-lite
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#99](https://github.com/santi020k/eslint-config-basic/pull/99) [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967) Thanks [@santi020k](https://github.com/santi020k)! - Complete the v3 lean dependency boundary and one-line recommended entry point. Framework and feature-pack packages are now optional, dynamically loaded peers with actionable installation errors. Feature factories move from the basic root export to granular extensions, formats, libraries, testing, and tools packages; `@santi020k/eslint-config-integrations` remains as a compatibility aggregate, while the new `@santi020k/eslint-config-full` package provides the batteries-included installation path. Core no longer owns JSX accessibility rules, the CLI writes the one-line configuration, and release checks enforce dependency budgets, packed-consumer compatibility, and lean production-audit boundaries.
8
+
9
+ Remove the v1 compatibility exports (`*Config`, `jsConfig`, `tsConfig`,
10
+ `astroConfig`, `rules`, `loadModule`, and `eslintConfig`) from the aggregate
11
+ v3 API. Remove the deprecated Remix package and `frameworks.remix` option;
12
+ Remix dependencies now resolve through the React Router v7 configuration.
13
+ The Lite package is now a thin compatibility re-export of Basic.
14
+
15
+ - [#99](https://github.com/santi020k/eslint-config-basic/pull/99) [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967) Thanks [@santi020k](https://github.com/santi020k)! - Polish real-world consumer configuration: add one `root` option for detection,
16
+ TypeScript, Tailwind, projects, and `.gitignore`; auto-detect and scope workspace
17
+ packages without leaking root framework dependencies; accept native project
18
+ service options; and syntax-lint TypeScript config files plus explicit
19
+ `untypedFiles` without consumer-side `typescript-eslint` imports.
20
+
21
+ ### Patch Changes
22
+
23
+ - [#99](https://github.com/santi020k/eslint-config-basic/pull/99) [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967) Thanks [@santi020k](https://github.com/santi020k)! - Resolve package-scoped Tailwind and Astro configuration roots, keep lazy framework imports anchored to their declaring package, add shared `projectDefaults` inheritance for monorepos, and move integration host libraries to optional peers.
24
+
25
+ - [#99](https://github.com/santi020k/eslint-config-basic/pull/99) [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967) Thanks [@santi020k](https://github.com/santi020k)! - Deprecate the Lite and Integrations compatibility packages during v3 and
26
+ schedule their removal for v4. Add TypeScript deprecation annotations,
27
+ migration guidance, and post-publish npm registry warnings. Also deprecate the
28
+ `integrations` option alias and `doctor --lite-install` compatibility workflow.
29
+ - Updated dependencies [[`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967), [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967), [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967), [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967), [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967), [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967), [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967), [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967), [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967), [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967), [`0f89b89`](https://github.com/santi020k/eslint-config-basic/commit/0f89b89b466732ea582650b4e0baee0c47b0c967)]:
30
+ - @santi020k/eslint-config-basic@3.1.0
31
+
3
32
  ## 3.0.0
4
33
 
5
34
  ### Major Changes
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # @santi020k/eslint-config-lite
2
2
 
3
- Lite composer for projects that install framework and integration config packages manually.
3
+ > [!WARNING]
4
+ > Deprecated in v3 and scheduled for removal in v4. Replace this package with
5
+ > `@santi020k/eslint-config-basic`.
6
+
7
+ Compatibility wrapper for projects migrating from the v2 Lite composer.
8
+ Version 3 re-exports the lean `@santi020k/eslint-config-basic` API; new projects
9
+ should install and import the Basic package directly.
4
10
 
5
11
  This package is part of the [`@santi020k/eslint-config-basic`](https://github.com/santi020k/eslint-config-basic) monorepo.
6
12
 
package/dist/index.d.ts CHANGED
@@ -1,19 +1 @@
1
- import { EslintConfigOptions, FlatConfigArray } from '@santi020k/eslint-config-core';
2
- export { DetectedFrameworkName, DetectionOptions, EslintConfigOptions, Extension, ExtensionName, ExtensionOption, FlatConfigArray, Format, FormatName, FormatOption, ImportedFramework, Library, LibraryName, LibraryOption, NextMode, NextModeName, NextModeOption, OptionalConfigMap, OptionalConfigName, Preset, PresetName, PresetOption, ProjectConfigOptions, ReactConfigKeys, Runtime, RuntimeName, RuntimeOption, Setting, SettingName, SettingOption, StrictMode, Testing, TestingName, TestingOption, Tool, ToolName, ToolOption, TypeScriptMode, TypeScriptOptions, coreConfig, createCoreConfig, createImportGroups, detectProjectOptions, getGlobalsForRuntime, gitignore, hasReactConfig, jsConfig } from '@santi020k/eslint-config-core';
3
- export { angular, angularConfig, astro, expo, expoConfig, hono, lit, nest, nestConfig, next, nextConfig, nuxt, preact, preactConfig, qwik, react, reactConfig, reactRouter, remix, slidev, solid, solidConfig, svelte, svelteConfig, tanstackStart, vite, vue, vueConfig } from './frameworks.js';
4
- export { tsConfig, typescriptConfig } from '@santi020k/eslint-config-typescript';
5
-
6
- /**
7
- * Generates the ESLint configuration array, applying configurations
8
- * and integration settings based on the input configuration.
9
- *
10
- * @param {EslintConfigOptions} options - Configuration and integration settings
11
- * @returns {FlatConfigArray} The final ESLint configuration array
12
- */
13
- declare const eslintConfig: (options?: EslintConfigOptions) => Promise<FlatConfigArray>;
14
- /**
15
- * Alias for `eslintConfig()` that reads naturally in `eslint.config.*` files.
16
- */
17
- declare const defineConfig: (options?: EslintConfigOptions) => Promise<FlatConfigArray>;
18
-
19
- export { defineConfig, eslintConfig };
1
+ export * from '@santi020k/eslint-config-basic';
package/dist/index.js CHANGED
@@ -1,490 +1 @@
1
- import { join } from "node:path";
2
- import {
3
- applyDetectionControls,
4
- applyStrictMode,
5
- applyStrictProfileDefaults,
6
- coreConfig,
7
- createCoreConfig,
8
- DEFAULT_IGNORES,
9
- detectProjectOptions,
10
- Extension,
11
- findTailwindEntryPoint,
12
- GENERATED_CODE_IGNORES,
13
- getStrictMode,
14
- gitignore,
15
- Library,
16
- mergeFrameworkOption,
17
- mergeOptionalBucket,
18
- mergeProjectOptions,
19
- NextMode,
20
- patchImportGroups,
21
- Preset,
22
- resolveTsconfigRootDir,
23
- resolveTypescriptOptions,
24
- Runtime,
25
- scopeConfigToProject,
26
- Setting
27
- } from "@santi020k/eslint-config-core";
28
- import { createTypescriptConfig } from "@santi020k/eslint-config-typescript";
29
- import { createDetectedFrameworkFlags } from "./frameworks.js";
30
- import { getIntegrationConfigs, getPrettierConfig } from "./integrations.js";
31
- import { resolveFramework, resolvePreset } from "./resolvers.js";
32
- import { buildTailwindSettingsConfig } from "./tailwind.js";
33
- import {
34
- angular,
35
- angularConfig,
36
- astro,
37
- expo,
38
- expoConfig,
39
- hono,
40
- lit,
41
- nest,
42
- nestConfig,
43
- next,
44
- nextConfig,
45
- nuxt,
46
- preact,
47
- preactConfig,
48
- qwik,
49
- react,
50
- reactConfig,
51
- reactRouter,
52
- remix,
53
- slidev,
54
- solid,
55
- solidConfig,
56
- svelte,
57
- svelteConfig,
58
- tanstackStart,
59
- vite,
60
- vue,
61
- vueConfig
62
- } from "./frameworks.js";
63
- import {
64
- coreConfig as coreConfig2,
65
- createCoreConfig as createCoreConfig2,
66
- createImportGroups,
67
- detectProjectOptions as detectProjectOptions2,
68
- Extension as Extension2,
69
- Format,
70
- getGlobalsForRuntime,
71
- gitignore as gitignore2,
72
- hasReactConfig,
73
- jsConfig,
74
- Library as Library2,
75
- NextMode as NextMode2,
76
- Preset as Preset2,
77
- ReactConfigKeys,
78
- Runtime as Runtime2,
79
- Setting as Setting2,
80
- Testing,
81
- Tool
82
- } from "@santi020k/eslint-config-core";
83
- import { tsConfig, typescriptConfig } from "@santi020k/eslint-config-typescript";
84
- const resolveLiteSetup = (options) => ({
85
- autoFrameworks: options?.autoFrameworks ?? true,
86
- detectRootDir: options?.detectRootDir ?? options?.tsconfigRootDir,
87
- optionMergeStrategy: options?.optionMergeStrategy ?? "merge",
88
- requestedPreset: options?.preset
89
- });
90
- const resolveLitePresetMeta = (requestedPreset, detected, autoFrameworks, optProjects) => {
91
- const preset = requestedPreset ?? detected.preset;
92
- const presetDefaults = preset ? resolvePreset(preset) : {};
93
- const frameworkDefaults = autoFrameworks ? createDetectedFrameworkFlags(detected.detectedFrameworks ?? []) : {};
94
- const configuredProjects = { ...detected.projects ?? {}, ...optProjects ?? {} };
95
- return { configuredProjects, frameworkDefaults, preset, presetDefaults };
96
- };
97
- const resolveLiteBucketDefaults = (detected) => ({
98
- detectedExtensions: detected.extensions ?? [],
99
- detectedFormats: detected.formats ?? [],
100
- detectedLibraries: detected.libraries ?? [],
101
- detectedTesting: detected.testing ?? [],
102
- detectedTools: detected.tools ?? []
103
- });
104
- const resolveLiteNextMode = (optNextMode, presetNextMode, detectedNextMode) => optNextMode ?? presetNextMode ?? detectedNextMode ?? NextMode.Pages;
105
- const resolveLiteRuntime = (optRuntime, presetRuntime, detectedRuntime) => optRuntime ?? presetRuntime ?? detectedRuntime ?? Runtime.Universal;
106
- const resolveLiteTypescript = (optTypescript, presetTypescript, detectedTypescript) => optTypescript ?? presetTypescript ?? detectedTypescript ?? false;
107
- const resolveLiteScalars = (opts, presetDefaults, detected) => ({
108
- nextMode: resolveLiteNextMode(opts.nextMode, presetDefaults.nextMode, detected.nextMode),
109
- runtime: resolveLiteRuntime(opts.runtime, presetDefaults.runtime, detected.runtime),
110
- settings: opts.settings ?? detected.settings ?? [],
111
- strict: getStrictMode(opts.strict, presetDefaults.strict),
112
- typescript: resolveLiteTypescript(opts.typescript, presetDefaults.typescript, detected.typescript)
113
- });
114
- const hasReactImplyingFramework = (result) => Boolean(
115
- result.next ?? result.expo ?? result.remix ?? result["react-router"] ?? (result["tanstack-start"] && !result.solid)
116
- );
117
- const applyLiteFrameworkImpliedDeps = (frameworks) => {
118
- const result = { ...frameworks };
119
- if (hasReactImplyingFramework(result) && !result.react) result.react = true;
120
- if (result.slidev && !result.vue) result.vue = true;
121
- if (result.nuxt && !result.vue) result.vue = true;
122
- return result;
123
- };
124
- const buildLiteTailwindResult = (options, entryPoint) => {
125
- const result = {
126
- detectComponentClasses: options.detectComponentClasses ?? true
127
- };
128
- if (entryPoint) result.entryPoint = entryPoint;
129
- if (options.ignore?.length) result.ignore = options.ignore;
130
- if (options.noUnknownClasses !== void 0) result.noUnknownClasses = options.noUnknownClasses;
131
- return result;
132
- };
133
- const hasLiteTailwindSettings = (options, entryPoint) => {
134
- if (entryPoint) return true;
135
- if (options.detectComponentClasses !== void 0) return true;
136
- if (options.ignore?.length) return true;
137
- return options.noUnknownClasses !== void 0;
138
- };
139
- const resolveLiteTailwindOptions = (rootDir, tailwind, uniqueLibraries) => {
140
- if (!uniqueLibraries.includes(Library.Tailwind)) return void 0;
141
- const options = typeof tailwind === "object" ? tailwind : {};
142
- const entryPoint = options.entryPoint ?? findTailwindEntryPoint(rootDir);
143
- if (!hasLiteTailwindSettings(options, entryPoint)) return void 0;
144
- return buildLiteTailwindResult(options, entryPoint);
145
- };
146
- const buildLiteIgnoresConfig = (useDefaultIgnores, useGeneratedCodeIgnores, useGitignore, optIgnores) => ({
147
- defaultIgnores: useDefaultIgnores ? [{
148
- ignores: [...DEFAULT_IGNORES, ...useGeneratedCodeIgnores ? GENERATED_CODE_IGNORES : []],
149
- name: "eslint-config-lite/default-ignores"
150
- }] : [],
151
- gitignoreConfig: useGitignore ? gitignore : [],
152
- userIgnores: optIgnores?.length ? [{
153
- ignores: optIgnores,
154
- name: "eslint-config-lite/ignores"
155
- }] : []
156
- });
157
- const logLiteDebug = ({
158
- autoFrameworks,
159
- detectRootDir,
160
- nextMode,
161
- optionMergeStrategy,
162
- preset,
163
- resolvedFrameworks,
164
- resolvedTypescript,
165
- runtime,
166
- tsconfigRootDir,
167
- uniqueExtensions,
168
- uniqueFormats,
169
- uniqueLibraries,
170
- uniqueTesting,
171
- uniqueTools
172
- }) => {
173
- if (!process.env.ESLINT_CONFIG_LITE_DEBUG && !process.env.ESLINT_BASIC_DEBUG) return;
174
- process.stdout.write(`[ESLint Config Lite] Resolved options: ${JSON.stringify({
175
- autoFrameworks,
176
- detectRootDir: detectRootDir ?? process.cwd(),
177
- extensions: uniqueExtensions,
178
- formats: uniqueFormats,
179
- frameworks: Object.entries(resolvedFrameworks).filter(([, value]) => Boolean(value)).map(([key]) => key),
180
- libraries: uniqueLibraries,
181
- nextMode,
182
- optionMergeStrategy,
183
- preset,
184
- runtime,
185
- testing: uniqueTesting,
186
- tools: uniqueTools,
187
- tsconfigRootDir,
188
- typescript: resolvedTypescript ? resolvedTypescript.mode : false
189
- }, null, 2)}
190
- `);
191
- };
192
- const FRAMEWORK_EXTRA_OPTS = {
193
- astro: (ctx) => ({ hasReact: ctx.hasReact, hasSolid: ctx.hasSolid, hasSvelte: ctx.hasSvelte, hasVue: ctx.hasVue }),
194
- hono: (ctx) => ({ runtime: ctx.runtime }),
195
- slidev: (ctx) => ({ runtime: ctx.runtime }),
196
- vite: (ctx) => ({ runtime: ctx.runtime })
197
- };
198
- const resolveEnabledFrameworks = async (frameworks, ctx) => {
199
- const entries = await Promise.all(
200
- Object.entries(frameworks).filter((entry) => Boolean(entry[1])).map(([name, value]) => (
201
- // eslint-disable-next-line security/detect-object-injection
202
- resolveFramework(name, value, FRAMEWORK_EXTRA_OPTS[name]?.(ctx)).then((config) => [name, config])
203
- ))
204
- );
205
- return Object.fromEntries(entries);
206
- };
207
- const buildLiteEslintConfigs = async (params) => {
208
- const {
209
- defaultIgnores,
210
- frameworkConfigs,
211
- gitignoreConfig,
212
- hasReact,
213
- nextMode,
214
- resolvedFrameworks,
215
- resolvedTypescript,
216
- runtimeCoreConfig,
217
- tailwindOptions,
218
- tsconfigRootDir,
219
- uniqueExtensions,
220
- uniqueFormats,
221
- uniqueLibraries,
222
- uniqueTesting,
223
- uniqueTools,
224
- userIgnores
225
- } = params;
226
- const get = (name) => {
227
- const entry = Object.entries(frameworkConfigs).find(([k]) => k === name);
228
- return entry ? entry[1] : [];
229
- };
230
- const tailwindSettingsConfig = buildTailwindSettingsConfig(tailwindOptions);
231
- return [
232
- ...defaultIgnores,
233
- ...userIgnores,
234
- ...gitignoreConfig,
235
- ...tsconfigRootDir ? [{
236
- languageOptions: { parserOptions: { tsconfigRootDir } },
237
- name: "eslint-config-lite/tsconfig-root-dir"
238
- }] : [],
239
- {
240
- files: ["**/*.cjs", "**/*.cts"],
241
- languageOptions: {
242
- globals: {
243
- __dirname: "readonly",
244
- __filename: "readonly",
245
- exports: "readonly",
246
- module: "readonly",
247
- require: "readonly"
248
- },
249
- sourceType: "commonjs"
250
- },
251
- name: "eslint-config-lite/commonjs"
252
- },
253
- ...runtimeCoreConfig,
254
- ...hasReact ? get("react") : [],
255
- ...get("next"),
256
- ...get("expo"),
257
- ...get("nest"),
258
- ...get("hono"),
259
- ...get("vue"),
260
- ...get("svelte"),
261
- ...get("solid"),
262
- ...get("angular"),
263
- ...get("qwik"),
264
- ...get("remix"),
265
- ...get("react-router"),
266
- ...get("tanstack-start"),
267
- ...get("nuxt"),
268
- ...get("preact"),
269
- ...get("lit"),
270
- ...get("slidev"),
271
- ...get("vite"),
272
- ...resolvedTypescript ? createTypescriptConfig({
273
- ...resolvedTypescript,
274
- tsconfigRootDir: resolvedTypescript.tsconfigRootDir ?? tsconfigRootDir
275
- }) : [],
276
- // Astro runs after TypeScript so its parser wins for .astro files and embedded expressions.
277
- ...get("astro"),
278
- ...resolvedFrameworks.next && nextMode === NextMode.AppRouter ? [{
279
- files: ["app/**/*.{ts,tsx}", "src/**/*.{ts,tsx}"],
280
- name: "eslint-config-next/app-router-overrides",
281
- rules: { "@next/next/no-html-link-for-pages": "off" }
282
- }] : [],
283
- ...await getIntegrationConfigs(uniqueLibraries, uniqueTools, uniqueTesting, uniqueFormats, uniqueExtensions),
284
- {
285
- files: ["**/scripts/**/*.{js,mjs,cjs,ts,mts,cts}"],
286
- name: "eslint-config-lite/scripts-overrides",
287
- rules: {
288
- "n/no-unpublished-import": "off",
289
- ...uniqueExtensions.includes(Extension.Security) ? { "security/detect-non-literal-fs-filename": "off" } : {}
290
- }
291
- },
292
- ...tailwindSettingsConfig ? [tailwindSettingsConfig] : [],
293
- ...await getPrettierConfig(uniqueTools)
294
- ];
295
- };
296
- const emitLiteWarnings = (options) => {
297
- if (options?.frameworks && "remix" in options.frameworks) {
298
- process.emitWarning('`frameworks.remix` is deprecated and will be removed in the next major. Please use `frameworks["react-router"]` instead.', "eslint-config-lite");
299
- }
300
- if (options?.typescript && typeof options.typescript === "object" && "project" in options.typescript) {
301
- process.emitWarning("`typescript.project` is ignored in v2. Type-aware linting now relies on typescript-eslint projectService.", "eslint-config-lite");
302
- }
303
- };
304
- const eslintConfig = async (options) => {
305
- emitLiteWarnings(options);
306
- const {
307
- detection,
308
- extensions: optExtensions,
309
- formats: optFormats,
310
- frameworks: optFrameworks,
311
- ignores: optIgnores,
312
- libraries: optLibraries,
313
- nextMode: optNextMode,
314
- projectDefaults,
315
- projects: optProjects,
316
- runtime: optRuntime,
317
- settings: optSettings,
318
- strict: optStrict,
319
- tailwind: optTailwind,
320
- testing: optTesting,
321
- tools: optTools,
322
- tsconfigRootDir: optTsconfigRootDir,
323
- typescript: optTypescript,
324
- workspacePrefixes
325
- } = options ?? {};
326
- const { autoFrameworks, detectRootDir, optionMergeStrategy, requestedPreset } = resolveLiteSetup(options);
327
- const shouldDefaultProjectDetection = requestedPreset === Preset.Monorepo;
328
- const detected = applyDetectionControls(
329
- detectProjectOptions(detectRootDir),
330
- detection,
331
- { projects: shouldDefaultProjectDetection }
332
- );
333
- const { configuredProjects, frameworkDefaults, preset, presetDefaults } = resolveLitePresetMeta(
334
- requestedPreset,
335
- detected,
336
- autoFrameworks,
337
- optProjects
338
- );
339
- const { detectedExtensions, detectedFormats, detectedLibraries, detectedTesting, detectedTools } = resolveLiteBucketDefaults(detected);
340
- const { nextMode, runtime, settings, strict, typescript } = resolveLiteScalars(
341
- { nextMode: optNextMode, runtime: optRuntime, settings: optSettings, strict: optStrict, typescript: optTypescript },
342
- presetDefaults,
343
- detected
344
- );
345
- const configuredExtensions = mergeOptionalBucket("extensions", detectedExtensions, presetDefaults.extensions, optExtensions, options, optionMergeStrategy);
346
- const formats = mergeOptionalBucket("formats", detectedFormats, presetDefaults.formats, optFormats, options, optionMergeStrategy);
347
- const frameworks = mergeFrameworkOption(frameworkDefaults, presetDefaults.frameworks, optFrameworks, optionMergeStrategy);
348
- const libraries = mergeOptionalBucket("libraries", detectedLibraries, presetDefaults.libraries, optLibraries, options, optionMergeStrategy);
349
- const testing = mergeOptionalBucket("testing", detectedTesting, presetDefaults.testing, optTesting, options, optionMergeStrategy);
350
- const tools = mergeOptionalBucket("tools", detectedTools, presetDefaults.tools, optTools, options, optionMergeStrategy);
351
- const resolvedTypescript = resolveTypescriptOptions(typescript);
352
- const rootDir = detectRootDir ?? process.cwd();
353
- const tsconfigRootDir = resolveTsconfigRootDir(rootDir, typescript, optTsconfigRootDir);
354
- const extensions = applyStrictProfileDefaults(configuredExtensions, strict);
355
- const resolvedFrameworks = applyLiteFrameworkImpliedDeps({ ...frameworks });
356
- const uniqueLibraries = (() => {
357
- const libs = [...new Set(libraries)];
358
- if (optTailwind === false) return libs.filter((l) => l !== Library.Tailwind);
359
- if (!optTailwind) return libs;
360
- return [.../* @__PURE__ */ new Set([...libs, Library.Tailwind])];
361
- })();
362
- const uniqueTesting = [...new Set(testing)];
363
- const uniqueFormats = [...new Set(formats)];
364
- const uniqueTools = [...new Set(tools)];
365
- const uniqueExtensions = [...new Set(extensions)];
366
- const uniqueSettings = [...new Set(settings)];
367
- const hasReact = !!resolvedFrameworks.react;
368
- const hasVue = !!resolvedFrameworks.vue;
369
- const hasSvelte = !!resolvedFrameworks.svelte;
370
- const hasSolid = !!resolvedFrameworks.solid;
371
- const useGitignore = !uniqueSettings.includes(Setting.NoGitignore);
372
- const useDefaultIgnores = !uniqueSettings.includes(Setting.NoDefaultIgnores);
373
- const useGeneratedCodeIgnores = !uniqueSettings.includes(Setting.NoGeneratedCodeIgnores);
374
- const tailwindOptions = resolveLiteTailwindOptions(rootDir, optTailwind, uniqueLibraries);
375
- const runtimeCoreConfig = runtime === Runtime.Universal ? coreConfig : createCoreConfig(runtime);
376
- const { defaultIgnores, gitignoreConfig, userIgnores } = buildLiteIgnoresConfig(
377
- useDefaultIgnores,
378
- useGeneratedCodeIgnores,
379
- useGitignore,
380
- optIgnores
381
- );
382
- const frameworkConfigs = await resolveEnabledFrameworks(
383
- resolvedFrameworks,
384
- { hasReact, hasSolid, hasSvelte, hasVue, runtime }
385
- );
386
- const configs = await buildLiteEslintConfigs({
387
- defaultIgnores,
388
- frameworkConfigs,
389
- gitignoreConfig,
390
- hasReact,
391
- nextMode,
392
- resolvedFrameworks,
393
- resolvedTypescript,
394
- runtimeCoreConfig,
395
- tailwindOptions,
396
- tsconfigRootDir,
397
- uniqueExtensions,
398
- uniqueFormats,
399
- uniqueLibraries,
400
- uniqueTesting,
401
- uniqueTools,
402
- userIgnores
403
- });
404
- logLiteDebug({
405
- autoFrameworks,
406
- detectRootDir,
407
- nextMode,
408
- optionMergeStrategy,
409
- preset,
410
- resolvedFrameworks,
411
- resolvedTypescript,
412
- runtime,
413
- tsconfigRootDir,
414
- uniqueExtensions,
415
- uniqueFormats,
416
- uniqueLibraries,
417
- uniqueTesting,
418
- uniqueTools
419
- });
420
- const projectConfigs = await Promise.all(
421
- Object.entries(configuredProjects).map(async ([projectPath, projectOptions]) => {
422
- const projectRoot = join(detectRootDir ?? process.cwd(), projectPath);
423
- const inheritedOptions = mergeProjectOptions(projectDefaults ?? {}, projectOptions);
424
- const scopedConfigs = await eslintConfig({
425
- ...inheritedOptions,
426
- detectRootDir: inheritedOptions.detectRootDir ?? projectRoot,
427
- projectDefaults: void 0,
428
- projects: void 0,
429
- tsconfigRootDir: inheritedOptions.tsconfigRootDir ?? projectRoot
430
- });
431
- return scopedConfigs.map((config) => scopeConfigToProject(config, projectPath));
432
- })
433
- );
434
- const allConfigs = [...configs, ...projectConfigs.flat()];
435
- const patchedConfigs = workspacePrefixes?.length ? patchImportGroups(allConfigs, workspacePrefixes) : allConfigs;
436
- return applyStrictMode(patchedConfigs, strict);
437
- };
438
- const defineConfig = eslintConfig;
439
- export {
440
- Extension2 as Extension,
441
- Format,
442
- Library2 as Library,
443
- NextMode2 as NextMode,
444
- Preset2 as Preset,
445
- ReactConfigKeys,
446
- Runtime2 as Runtime,
447
- Setting2 as Setting,
448
- Testing,
449
- Tool,
450
- angular,
451
- angularConfig,
452
- astro,
453
- coreConfig2 as coreConfig,
454
- createCoreConfig2 as createCoreConfig,
455
- createImportGroups,
456
- defineConfig,
457
- detectProjectOptions2 as detectProjectOptions,
458
- eslintConfig,
459
- expo,
460
- expoConfig,
461
- getGlobalsForRuntime,
462
- gitignore2 as gitignore,
463
- hasReactConfig,
464
- hono,
465
- jsConfig,
466
- lit,
467
- nest,
468
- nestConfig,
469
- next,
470
- nextConfig,
471
- nuxt,
472
- preact,
473
- preactConfig,
474
- qwik,
475
- react,
476
- reactConfig,
477
- reactRouter,
478
- remix,
479
- slidev,
480
- solid,
481
- solidConfig,
482
- svelte,
483
- svelteConfig,
484
- tanstackStart,
485
- tsConfig,
486
- typescriptConfig,
487
- vite,
488
- vue,
489
- vueConfig
490
- };
1
+ export * from "@santi020k/eslint-config-basic";
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@santi020k/eslint-config-lite",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
7
7
  },
8
- "description": "Lite ESLint flat-config composer with manual framework and integration package installs.",
8
+ "description": "Deprecated v3 compatibility wrapper; use @santi020k/eslint-config-basic.",
9
9
  "type": "module",
10
10
  "main": "./dist/index.js",
11
11
  "module": "./dist/index.js",
@@ -23,127 +23,18 @@
23
23
  "CHANGELOG.md"
24
24
  ],
25
25
  "dependencies": {
26
- "@typescript-eslint/utils": "^8.65.0",
27
- "@santi020k/eslint-config-core": "^3.0.0",
28
- "@santi020k/eslint-config-typescript": "^3.0.0"
26
+ "@santi020k/eslint-config-basic": "^3.1.0"
29
27
  },
30
28
  "devDependencies": {
31
- "@types/node": "^26.1.1",
32
29
  "publint": "^0.3.22",
33
30
  "tsup": "^8.5.1",
34
- "typescript": "^6.0.2",
35
- "@santi020k/eslint-config-angular": "^3.0.0",
36
- "@santi020k/eslint-config-astro": "^3.0.0",
37
- "@santi020k/eslint-config-expo": "^3.0.0",
38
- "@santi020k/eslint-config-hono": "^3.0.0",
39
- "@santi020k/eslint-config-integrations": "^3.0.0",
40
- "@santi020k/eslint-config-lit": "^3.0.0",
41
- "@santi020k/eslint-config-nest": "^3.0.0",
42
- "@santi020k/eslint-config-next": "^3.0.0",
43
- "@santi020k/eslint-config-nuxt": "^3.0.0",
44
- "@santi020k/eslint-config-preact": "^3.0.0",
45
- "@santi020k/eslint-config-qwik": "^3.0.0",
46
- "@santi020k/eslint-config-react": "^3.0.0",
47
- "@santi020k/eslint-config-react-router": "^3.0.0",
48
- "@santi020k/eslint-config-remix": "^3.0.0",
49
- "@santi020k/eslint-config-slidev": "^3.0.0",
50
- "@santi020k/eslint-config-solid": "^3.0.0",
51
- "@santi020k/eslint-config-svelte": "^3.0.0",
52
- "@santi020k/eslint-config-tanstack-start": "^3.0.0",
53
- "@santi020k/eslint-config-vite": "^3.0.0",
54
- "@santi020k/eslint-config-vue": "^3.0.0"
31
+ "typescript": "^6.0.3"
55
32
  },
56
33
  "peerDependencies": {
57
- "eslint": "^10.0.0",
58
- "typescript": ">=5.0.0",
59
- "@santi020k/eslint-config-angular": "^3.0.0",
60
- "@santi020k/eslint-config-astro": "^3.0.0",
61
- "@santi020k/eslint-config-expo": "^3.0.0",
62
- "@santi020k/eslint-config-hono": "^3.0.0",
63
- "@santi020k/eslint-config-integrations": "^3.0.0",
64
- "@santi020k/eslint-config-lit": "^3.0.0",
65
- "@santi020k/eslint-config-nest": "^3.0.0",
66
- "@santi020k/eslint-config-next": "^3.0.0",
67
- "@santi020k/eslint-config-nuxt": "^3.0.0",
68
- "@santi020k/eslint-config-preact": "^3.0.0",
69
- "@santi020k/eslint-config-qwik": "^3.0.0",
70
- "@santi020k/eslint-config-react": "^3.0.0",
71
- "@santi020k/eslint-config-react-router": "^3.0.0",
72
- "@santi020k/eslint-config-remix": "^3.0.0",
73
- "@santi020k/eslint-config-slidev": "^3.0.0",
74
- "@santi020k/eslint-config-solid": "^3.0.0",
75
- "@santi020k/eslint-config-svelte": "^3.0.0",
76
- "@santi020k/eslint-config-tanstack-start": "^3.0.0",
77
- "@santi020k/eslint-config-vite": "^3.0.0",
78
- "@santi020k/eslint-config-vue": "^3.0.0"
79
- },
80
- "peerDependenciesMeta": {
81
- "@santi020k/eslint-config-angular": {
82
- "optional": true
83
- },
84
- "@santi020k/eslint-config-astro": {
85
- "optional": true
86
- },
87
- "@santi020k/eslint-config-expo": {
88
- "optional": true
89
- },
90
- "@santi020k/eslint-config-hono": {
91
- "optional": true
92
- },
93
- "@santi020k/eslint-config-integrations": {
94
- "optional": true
95
- },
96
- "@santi020k/eslint-config-lit": {
97
- "optional": true
98
- },
99
- "@santi020k/eslint-config-nest": {
100
- "optional": true
101
- },
102
- "@santi020k/eslint-config-next": {
103
- "optional": true
104
- },
105
- "@santi020k/eslint-config-nuxt": {
106
- "optional": true
107
- },
108
- "@santi020k/eslint-config-preact": {
109
- "optional": true
110
- },
111
- "@santi020k/eslint-config-qwik": {
112
- "optional": true
113
- },
114
- "@santi020k/eslint-config-react": {
115
- "optional": true
116
- },
117
- "@santi020k/eslint-config-react-router": {
118
- "optional": true
119
- },
120
- "@santi020k/eslint-config-remix": {
121
- "optional": true
122
- },
123
- "@santi020k/eslint-config-slidev": {
124
- "optional": true
125
- },
126
- "@santi020k/eslint-config-solid": {
127
- "optional": true
128
- },
129
- "@santi020k/eslint-config-svelte": {
130
- "optional": true
131
- },
132
- "@santi020k/eslint-config-tanstack-start": {
133
- "optional": true
134
- },
135
- "@santi020k/eslint-config-vite": {
136
- "optional": true
137
- },
138
- "@santi020k/eslint-config-vue": {
139
- "optional": true
140
- },
141
- "typescript": {
142
- "optional": true
143
- }
34
+ "eslint": "^10.0.0"
144
35
  },
145
36
  "engines": {
146
- "node": "^20.19.0 || >=22.18.0"
37
+ "node": ">=22.19.0"
147
38
  },
148
39
  "repository": {
149
40
  "type": "git",
@@ -1,58 +0,0 @@
1
- import { DetectedFrameworkName, Runtime, FlatConfigArray } from '@santi020k/eslint-config-core';
2
-
3
- type FrameworkFlags = Partial<Record<FrameworkName, true>>;
4
- type FrameworkName = DetectedFrameworkName;
5
- interface FrameworkOptions {
6
- [key: string]: unknown;
7
- hasReact?: boolean;
8
- hasSolid?: boolean;
9
- hasSvelte?: boolean;
10
- hasVue?: boolean;
11
- runtime?: Runtime;
12
- }
13
- declare const createDetectedFrameworkFlags: (detectedFrameworks?: DetectedFrameworkName[]) => FrameworkFlags;
14
- declare const getBundledFrameworkConfig: (frameworkName: FrameworkName, options?: FrameworkOptions) => Promise<FlatConfigArray>;
15
- declare const angular: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
16
- declare const astro: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
17
- declare const expo: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
18
- declare const hono: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
19
- declare const lit: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
20
- declare const nest: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
21
- declare const next: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
22
- declare const nuxt: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
23
- declare const preact: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
24
- declare const qwik: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
25
- declare const react: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
26
- declare const reactRouter: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
27
- declare const slidev: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
28
- declare const solid: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
29
- declare const svelte: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
30
- declare const tanstackStart: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
31
- declare const vite: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
32
- declare const vue: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
33
- /**
34
- * @deprecated Remix merged into React Router v7. Use `reactRouter` (the
35
- * `react-router` framework key) instead. This alias loads the legacy Remix
36
- * config and will be removed in the next major version.
37
- */
38
- declare const remix: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
39
- /** @deprecated Use `angular` instead. */
40
- declare const angularConfig: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
41
- /** @deprecated Use `expo` instead. */
42
- declare const expoConfig: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
43
- /** @deprecated Use `nest` instead. */
44
- declare const nestConfig: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
45
- /** @deprecated Use `next` instead. */
46
- declare const nextConfig: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
47
- /** @deprecated Use `preact` instead. */
48
- declare const preactConfig: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
49
- /** @deprecated Use `react` instead. */
50
- declare const reactConfig: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
51
- /** @deprecated Use `solid` instead. */
52
- declare const solidConfig: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
53
- /** @deprecated Use `svelte` instead. */
54
- declare const svelteConfig: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
55
- /** @deprecated Use `vue` instead. */
56
- declare const vueConfig: (options?: FrameworkOptions) => Promise<FlatConfigArray>;
57
-
58
- export { type FrameworkFlags, type FrameworkName, type FrameworkOptions, angular, angularConfig, astro, createDetectedFrameworkFlags, expo, expoConfig, getBundledFrameworkConfig, hono, lit, nest, nestConfig, next, nextConfig, nuxt, preact, preactConfig, qwik, react, reactConfig, reactRouter, remix, slidev, solid, solidConfig, svelte, svelteConfig, tanstackStart, vite, vue, vueConfig };
@@ -1,109 +0,0 @@
1
- import {
2
- createModuleLoader
3
- } from "@santi020k/eslint-config-core";
4
- const loadModule = createModuleLoader((specifier) => import.meta.resolve(specifier));
5
- const createDetectedFrameworkFlags = (detectedFrameworks = []) => Object.fromEntries(
6
- detectedFrameworks.map((framework) => [framework, true])
7
- );
8
- const frameworkLoaders = /* @__PURE__ */ new Map([
9
- ["angular", async () => (await loadModule("@santi020k/eslint-config-angular")).angularConfig],
10
- ["astro", async () => (await loadModule("@santi020k/eslint-config-astro")).default],
11
- ["expo", async () => (await loadModule("@santi020k/eslint-config-expo")).expoConfig],
12
- ["hono", async () => (await loadModule("@santi020k/eslint-config-hono")).hono],
13
- ["lit", async () => (await loadModule("@santi020k/eslint-config-lit")).lit],
14
- ["nest", async () => (await loadModule("@santi020k/eslint-config-nest")).nestConfig],
15
- ["next", async () => (await loadModule("@santi020k/eslint-config-next")).nextConfig],
16
- ["nuxt", async () => (await loadModule("@santi020k/eslint-config-nuxt")).nuxt],
17
- ["preact", async () => (await loadModule("@santi020k/eslint-config-preact")).preactConfig],
18
- ["qwik", async () => (await loadModule("@santi020k/eslint-config-qwik")).qwik],
19
- ["react", async () => (await loadModule("@santi020k/eslint-config-react")).reactConfig],
20
- ["react-router", async () => (await loadModule("@santi020k/eslint-config-react-router")).reactRouter],
21
- ["remix", async () => (await loadModule("@santi020k/eslint-config-remix")).default],
22
- ["slidev", async () => (await loadModule("@santi020k/eslint-config-slidev")).slidev],
23
- ["solid", async () => (await loadModule("@santi020k/eslint-config-solid")).solidConfig],
24
- ["svelte", async () => (await loadModule("@santi020k/eslint-config-svelte")).svelteConfig],
25
- ["tanstack-start", async () => (await loadModule("@santi020k/eslint-config-tanstack-start")).tanstackStart],
26
- ["vite", async () => (await loadModule("@santi020k/eslint-config-vite")).vite],
27
- ["vue", async () => (await loadModule("@santi020k/eslint-config-vue")).vueConfig]
28
- ]);
29
- const frameworkConfigCache = /* @__PURE__ */ new Map();
30
- const loadFrameworkConfigInput = (frameworkName) => {
31
- const cached = frameworkConfigCache.get(frameworkName);
32
- if (cached) return cached;
33
- const loader = frameworkLoaders.get(frameworkName);
34
- if (!loader) return Promise.resolve([]);
35
- const pending = loader().catch((error) => {
36
- frameworkConfigCache.delete(frameworkName);
37
- throw new Error(
38
- `Unable to load optional framework config "${frameworkName}". Install "@santi020k/eslint-config-${frameworkName}" when using @santi020k/eslint-config-lite, or remove that framework from your eslintConfig options.`,
39
- { cause: error }
40
- );
41
- });
42
- frameworkConfigCache.set(frameworkName, pending);
43
- return pending;
44
- };
45
- const getBundledFrameworkConfig = async (frameworkName, options) => {
46
- const input = await loadFrameworkConfigInput(frameworkName);
47
- return typeof input === "function" ? input(options) : input;
48
- };
49
- const createBundledFramework = (frameworkName) => async (options) => getBundledFrameworkConfig(frameworkName, options);
50
- const angular = createBundledFramework("angular");
51
- const astro = createBundledFramework("astro");
52
- const expo = createBundledFramework("expo");
53
- const hono = createBundledFramework("hono");
54
- const lit = createBundledFramework("lit");
55
- const nest = createBundledFramework("nest");
56
- const next = createBundledFramework("next");
57
- const nuxt = createBundledFramework("nuxt");
58
- const preact = createBundledFramework("preact");
59
- const qwik = createBundledFramework("qwik");
60
- const react = createBundledFramework("react");
61
- const reactRouter = createBundledFramework("react-router");
62
- const slidev = createBundledFramework("slidev");
63
- const solid = createBundledFramework("solid");
64
- const svelte = createBundledFramework("svelte");
65
- const tanstackStart = createBundledFramework("tanstack-start");
66
- const vite = createBundledFramework("vite");
67
- const vue = createBundledFramework("vue");
68
- const remix = createBundledFramework("remix");
69
- const angularConfig = angular;
70
- const expoConfig = expo;
71
- const nestConfig = nest;
72
- const nextConfig = next;
73
- const preactConfig = preact;
74
- const reactConfig = react;
75
- const solidConfig = solid;
76
- const svelteConfig = svelte;
77
- const vueConfig = vue;
78
- export {
79
- angular,
80
- angularConfig,
81
- astro,
82
- createDetectedFrameworkFlags,
83
- expo,
84
- expoConfig,
85
- getBundledFrameworkConfig,
86
- hono,
87
- lit,
88
- nest,
89
- nestConfig,
90
- next,
91
- nextConfig,
92
- nuxt,
93
- preact,
94
- preactConfig,
95
- qwik,
96
- react,
97
- reactConfig,
98
- reactRouter,
99
- remix,
100
- slidev,
101
- solid,
102
- solidConfig,
103
- svelte,
104
- svelteConfig,
105
- tanstackStart,
106
- vite,
107
- vue,
108
- vueConfig
109
- };
@@ -1,12 +0,0 @@
1
- import { Library, Tool, Testing, Format, Extension, FlatConfigArray } from '@santi020k/eslint-config-core';
2
-
3
- /**
4
- * Gets integration configs from the optional integrations package.
5
- */
6
- declare const getIntegrationConfigs: (libraries: Library[], tools: Tool[], testing: Testing[], formats: Format[], extensions: Extension[]) => Promise<FlatConfigArray>;
7
- /**
8
- * Returns the Prettier configuration if selected.
9
- */
10
- declare const getPrettierConfig: (tools: Tool[]) => Promise<FlatConfigArray>;
11
-
12
- export { getIntegrationConfigs, getPrettierConfig };
@@ -1,42 +0,0 @@
1
- import {
2
- createModuleLoader,
3
- Tool
4
- } from "@santi020k/eslint-config-core";
5
- const loadModule = createModuleLoader((specifier) => import.meta.resolve(specifier));
6
- const hasRequestedIntegrations = (libraries, tools, testing, formats, extensions) => libraries.length > 0 || tools.length > 0 || testing.length > 0 || formats.length > 0 || extensions.length > 0;
7
- let integrationsModule;
8
- const loadIntegrations = async () => {
9
- integrationsModule ?? (integrationsModule = loadModule("@santi020k/eslint-config-integrations"));
10
- try {
11
- return await integrationsModule;
12
- } catch (error) {
13
- throw new Error(
14
- 'Unable to load optional package "@santi020k/eslint-config-integrations". Install it when using lite package integrations, or remove the selected integrations from your eslintConfig options.',
15
- { cause: error }
16
- );
17
- }
18
- };
19
- const getIntegrationConfigs = async (libraries, tools, testing, formats, extensions) => {
20
- if (!hasRequestedIntegrations(libraries, tools, testing, formats, extensions)) return [];
21
- const module = await loadIntegrations();
22
- if (!module.getIntegrationConfigs) {
23
- throw new Error(
24
- 'Installed "@santi020k/eslint-config-integrations" does not export getIntegrationConfigs. Update it to a compatible version.'
25
- );
26
- }
27
- return module.getIntegrationConfigs(libraries, tools, testing, formats, extensions);
28
- };
29
- const getPrettierConfig = async (tools) => {
30
- if (!tools.includes(Tool.Prettier)) return [];
31
- const module = await loadIntegrations();
32
- if (!module.getPrettierConfig) {
33
- throw new Error(
34
- 'Installed "@santi020k/eslint-config-integrations" does not export getPrettierConfig. Update it to a compatible version.'
35
- );
36
- }
37
- return module.getPrettierConfig(tools);
38
- };
39
- export {
40
- getIntegrationConfigs,
41
- getPrettierConfig
42
- };
@@ -1,15 +0,0 @@
1
- import { DetectedFrameworkName, ImportedFramework, FlatConfigArray, Preset, EslintConfigOptions } from '@santi020k/eslint-config-core';
2
- import { FrameworkOptions } from './frameworks.js';
3
-
4
- /**
5
- * Resolves an imported framework (either array, object with default, or factory function) into a config array.
6
- * Bundled configs (`true`) and async factories are loaded lazily, so framework
7
- * packages are only imported when actually enabled.
8
- */
9
- declare const resolveFramework: (frameworkName: DetectedFrameworkName, framework?: ImportedFramework, options?: FrameworkOptions) => Promise<FlatConfigArray>;
10
- /**
11
- * Resolves a preset into options
12
- */
13
- declare const resolvePreset: (preset: Preset) => Partial<EslintConfigOptions>;
14
-
15
- export { resolveFramework, resolvePreset };
package/dist/resolvers.js DELETED
@@ -1,96 +0,0 @@
1
- import {
2
- Extension,
3
- Format,
4
- Library,
5
- Preset,
6
- Runtime,
7
- Testing,
8
- Tool
9
- } from "@santi020k/eslint-config-core";
10
- import { getBundledFrameworkConfig } from "./frameworks.js";
11
- const resolveFramework = async (frameworkName, framework, options) => {
12
- if (!framework) return [];
13
- if (framework === true) {
14
- return getBundledFrameworkConfig(frameworkName, options);
15
- }
16
- if (typeof framework === "function") {
17
- return framework(options);
18
- }
19
- if (typeof framework === "object" && "default" in framework) {
20
- if (typeof framework.default === "function") {
21
- return framework.default(options);
22
- }
23
- if (Array.isArray(framework.default)) return framework.default;
24
- }
25
- if (Array.isArray(framework)) return framework;
26
- throw new TypeError(
27
- `[ESLint Config Lite] Invalid framework config for "${frameworkName}". Use true to enable the bundled config, or pass a config array/factory/default export.`
28
- );
29
- };
30
- const resolvePreset = (preset) => {
31
- switch (preset) {
32
- case Preset.All:
33
- return {
34
- extensions: Object.values(Extension),
35
- formats: Object.values(Format),
36
- libraries: Object.values(Library),
37
- runtime: Runtime.Universal,
38
- testing: Object.values(Testing),
39
- tools: Object.values(Tool),
40
- typescript: true
41
- };
42
- case Preset.App:
43
- return {
44
- runtime: Runtime.Browser,
45
- testing: [Testing.Vitest],
46
- tools: [Tool.Prettier],
47
- typescript: true
48
- };
49
- case Preset.Basic:
50
- return { runtime: Runtime.Universal };
51
- case Preset.Browser:
52
- return {
53
- runtime: Runtime.Browser,
54
- typescript: true
55
- };
56
- case Preset.CI:
57
- return {
58
- extensions: [Extension.BestPractices],
59
- runtime: Runtime.Universal,
60
- strict: "ci",
61
- tools: [Tool.Prettier],
62
- typescript: true
63
- };
64
- case Preset.Library:
65
- return {
66
- extensions: [Extension.BestPractices],
67
- runtime: Runtime.Node,
68
- tools: [Tool.Prettier],
69
- typescript: true
70
- };
71
- case Preset.Monorepo:
72
- return {
73
- extensions: [Extension.BestPractices],
74
- runtime: Runtime.Universal,
75
- tools: [Tool.Prettier],
76
- typescript: true
77
- };
78
- case Preset.Node:
79
- return {
80
- runtime: Runtime.Node,
81
- typescript: true
82
- };
83
- case Preset.Worker:
84
- return {
85
- runtime: Runtime.Worker,
86
- typescript: true
87
- };
88
- // v8 ignore next 2 -- TypeScript exhausts all Preset values; default is unreachable
89
- default:
90
- return {};
91
- }
92
- };
93
- export {
94
- resolveFramework,
95
- resolvePreset
96
- };
@@ -1,6 +0,0 @@
1
- import { TailwindOptions } from '@santi020k/eslint-config-core';
2
- import { TSESLint } from '@typescript-eslint/utils';
3
-
4
- declare const buildTailwindSettingsConfig: (tailwindOptions: TailwindOptions | undefined) => TSESLint.FlatConfig.Config | undefined;
5
-
6
- export { buildTailwindSettingsConfig };
package/dist/tailwind.js DELETED
@@ -1,27 +0,0 @@
1
- const buildUnknownClassOptions = (tailwindOptions) => {
2
- const unknownClassOptions = {};
3
- if (tailwindOptions.entryPoint) unknownClassOptions.entryPoint = tailwindOptions.entryPoint;
4
- if (tailwindOptions.ignore?.length) unknownClassOptions.ignore = tailwindOptions.ignore;
5
- return unknownClassOptions;
6
- };
7
- const createNoUnknownClassesRule = (noUnknownClasses, unknownClassOptions) => {
8
- const hasUnknownClassOptions = Object.keys(unknownClassOptions).length > 0;
9
- if (!hasUnknownClassOptions && noUnknownClasses === void 0) return void 0;
10
- const severity = noUnknownClasses ?? "error";
11
- if (severity === false) return "off";
12
- return hasUnknownClassOptions ? [severity, unknownClassOptions] : severity;
13
- };
14
- const buildTailwindSettingsConfig = (tailwindOptions) => {
15
- if (!tailwindOptions) return void 0;
16
- const { noUnknownClasses, ...settingsOptions } = tailwindOptions;
17
- const unknownClassOptions = buildUnknownClassOptions(tailwindOptions);
18
- const noUnknownClassesRule = createNoUnknownClassesRule(noUnknownClasses, unknownClassOptions);
19
- return {
20
- name: "eslint-config-lite/tailwind-settings",
21
- ...noUnknownClassesRule === void 0 ? {} : { rules: { "better-tailwindcss/no-unknown-classes": noUnknownClassesRule } },
22
- settings: { "better-tailwindcss": settingsOptions }
23
- };
24
- };
25
- export {
26
- buildTailwindSettingsConfig
27
- };