@santi020k/eslint-config-lite 2.1.1 → 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 +38 -0
- package/README.md +7 -1
- package/dist/index.d.ts +1 -19
- package/dist/index.js +1 -488
- package/package.json +7 -116
- package/dist/frameworks.d.ts +0 -58
- package/dist/frameworks.js +0 -109
- package/dist/integrations.d.ts +0 -12
- package/dist/integrations.js +0 -42
- package/dist/resolvers.d.ts +0 -15
- package/dist/resolvers.js +0 -96
- package/dist/tailwind.d.ts +0 -6
- package/dist/tailwind.js +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
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
|
+
|
|
32
|
+
## 3.0.0
|
|
33
|
+
|
|
34
|
+
### Major Changes
|
|
35
|
+
|
|
36
|
+
- Enter compatibility mode. The main `@santi020k/eslint-config-basic` package
|
|
37
|
+
now uses the modular dependency model introduced by `lite`.
|
|
38
|
+
- New projects should migrate to `basic`; existing composer options remain
|
|
39
|
+
available during the transition.
|
|
40
|
+
|
|
3
41
|
## 2.1.1
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# @santi020k/eslint-config-lite
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
2
|
-
export { DetectedFrameworkName, DetectionOptions, EslintConfigOptions, Extension, ExtensionName, ExtensionOption, FlatConfigArray, Format, FormatName, FormatOption, ImportedFramework, Library, LibraryName, LibraryOption, NextMode, NextModeName, NextModeOption, OptionalConfigMap, OptionalConfigName, Preset, PresetName, PresetOption, 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,488 +1 @@
|
|
|
1
|
-
|
|
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
|
-
NextMode,
|
|
19
|
-
patchImportGroups,
|
|
20
|
-
Preset,
|
|
21
|
-
resolveTsconfigRootDir,
|
|
22
|
-
resolveTypescriptOptions,
|
|
23
|
-
Runtime,
|
|
24
|
-
scopeConfigToProject,
|
|
25
|
-
Setting
|
|
26
|
-
} from "@santi020k/eslint-config-core";
|
|
27
|
-
import { createTypescriptConfig } from "@santi020k/eslint-config-typescript";
|
|
28
|
-
import { createDetectedFrameworkFlags } from "./frameworks.js";
|
|
29
|
-
import { getIntegrationConfigs, getPrettierConfig } from "./integrations.js";
|
|
30
|
-
import { resolveFramework, resolvePreset } from "./resolvers.js";
|
|
31
|
-
import { buildTailwindSettingsConfig } from "./tailwind.js";
|
|
32
|
-
import {
|
|
33
|
-
angular,
|
|
34
|
-
angularConfig,
|
|
35
|
-
astro,
|
|
36
|
-
expo,
|
|
37
|
-
expoConfig,
|
|
38
|
-
hono,
|
|
39
|
-
lit,
|
|
40
|
-
nest,
|
|
41
|
-
nestConfig,
|
|
42
|
-
next,
|
|
43
|
-
nextConfig,
|
|
44
|
-
nuxt,
|
|
45
|
-
preact,
|
|
46
|
-
preactConfig,
|
|
47
|
-
qwik,
|
|
48
|
-
react,
|
|
49
|
-
reactConfig,
|
|
50
|
-
reactRouter,
|
|
51
|
-
remix,
|
|
52
|
-
slidev,
|
|
53
|
-
solid,
|
|
54
|
-
solidConfig,
|
|
55
|
-
svelte,
|
|
56
|
-
svelteConfig,
|
|
57
|
-
tanstackStart,
|
|
58
|
-
vite,
|
|
59
|
-
vue,
|
|
60
|
-
vueConfig
|
|
61
|
-
} from "./frameworks.js";
|
|
62
|
-
import {
|
|
63
|
-
coreConfig as coreConfig2,
|
|
64
|
-
createCoreConfig as createCoreConfig2,
|
|
65
|
-
createImportGroups,
|
|
66
|
-
detectProjectOptions as detectProjectOptions2,
|
|
67
|
-
Extension as Extension2,
|
|
68
|
-
Format,
|
|
69
|
-
getGlobalsForRuntime,
|
|
70
|
-
gitignore as gitignore2,
|
|
71
|
-
hasReactConfig,
|
|
72
|
-
jsConfig,
|
|
73
|
-
Library as Library2,
|
|
74
|
-
NextMode as NextMode2,
|
|
75
|
-
Preset as Preset2,
|
|
76
|
-
ReactConfigKeys,
|
|
77
|
-
Runtime as Runtime2,
|
|
78
|
-
Setting as Setting2,
|
|
79
|
-
Testing,
|
|
80
|
-
Tool
|
|
81
|
-
} from "@santi020k/eslint-config-core";
|
|
82
|
-
import { tsConfig, typescriptConfig } from "@santi020k/eslint-config-typescript";
|
|
83
|
-
const resolveLiteSetup = (options) => ({
|
|
84
|
-
autoFrameworks: options?.autoFrameworks ?? true,
|
|
85
|
-
detectRootDir: options?.detectRootDir ?? options?.tsconfigRootDir,
|
|
86
|
-
optionMergeStrategy: options?.optionMergeStrategy ?? "merge",
|
|
87
|
-
requestedPreset: options?.preset
|
|
88
|
-
});
|
|
89
|
-
const resolveLitePresetMeta = (requestedPreset, detected, autoFrameworks, optProjects) => {
|
|
90
|
-
const preset = requestedPreset ?? detected.preset;
|
|
91
|
-
const presetDefaults = preset ? resolvePreset(preset) : {};
|
|
92
|
-
const frameworkDefaults = autoFrameworks ? createDetectedFrameworkFlags(detected.detectedFrameworks ?? []) : {};
|
|
93
|
-
const configuredProjects = { ...detected.projects ?? {}, ...optProjects ?? {} };
|
|
94
|
-
return { configuredProjects, frameworkDefaults, preset, presetDefaults };
|
|
95
|
-
};
|
|
96
|
-
const resolveLiteBucketDefaults = (detected) => ({
|
|
97
|
-
detectedExtensions: detected.extensions ?? [],
|
|
98
|
-
detectedFormats: detected.formats ?? [],
|
|
99
|
-
detectedLibraries: detected.libraries ?? [],
|
|
100
|
-
detectedTesting: detected.testing ?? [],
|
|
101
|
-
detectedTools: detected.tools ?? []
|
|
102
|
-
});
|
|
103
|
-
const resolveLiteNextMode = (optNextMode, presetNextMode, detectedNextMode) => optNextMode ?? presetNextMode ?? detectedNextMode ?? NextMode.Pages;
|
|
104
|
-
const resolveLiteRuntime = (optRuntime, presetRuntime, detectedRuntime) => optRuntime ?? presetRuntime ?? detectedRuntime ?? Runtime.Universal;
|
|
105
|
-
const resolveLiteTypescript = (optTypescript, presetTypescript, detectedTypescript) => optTypescript ?? presetTypescript ?? detectedTypescript ?? false;
|
|
106
|
-
const resolveLiteScalars = (opts, presetDefaults, detected) => ({
|
|
107
|
-
nextMode: resolveLiteNextMode(opts.nextMode, presetDefaults.nextMode, detected.nextMode),
|
|
108
|
-
runtime: resolveLiteRuntime(opts.runtime, presetDefaults.runtime, detected.runtime),
|
|
109
|
-
settings: opts.settings ?? detected.settings ?? [],
|
|
110
|
-
strict: getStrictMode(opts.strict, presetDefaults.strict),
|
|
111
|
-
typescript: resolveLiteTypescript(opts.typescript, presetDefaults.typescript, detected.typescript)
|
|
112
|
-
});
|
|
113
|
-
const hasReactImplyingFramework = (result) => Boolean(
|
|
114
|
-
result.next ?? result.expo ?? result.remix ?? result["react-router"] ?? (result["tanstack-start"] && !result.solid)
|
|
115
|
-
);
|
|
116
|
-
const applyLiteFrameworkImpliedDeps = (frameworks) => {
|
|
117
|
-
const result = { ...frameworks };
|
|
118
|
-
if (hasReactImplyingFramework(result) && !result.react) result.react = true;
|
|
119
|
-
if (result.slidev && !result.vue) result.vue = true;
|
|
120
|
-
if (result.nuxt && !result.vue) result.vue = true;
|
|
121
|
-
return result;
|
|
122
|
-
};
|
|
123
|
-
const buildLiteTailwindResult = (options, entryPoint) => {
|
|
124
|
-
const result = {
|
|
125
|
-
detectComponentClasses: options.detectComponentClasses ?? true
|
|
126
|
-
};
|
|
127
|
-
if (entryPoint) result.entryPoint = entryPoint;
|
|
128
|
-
if (options.ignore?.length) result.ignore = options.ignore;
|
|
129
|
-
if (options.noUnknownClasses !== void 0) result.noUnknownClasses = options.noUnknownClasses;
|
|
130
|
-
return result;
|
|
131
|
-
};
|
|
132
|
-
const hasLiteTailwindSettings = (options, entryPoint) => {
|
|
133
|
-
if (entryPoint) return true;
|
|
134
|
-
if (options.detectComponentClasses !== void 0) return true;
|
|
135
|
-
if (options.ignore?.length) return true;
|
|
136
|
-
return options.noUnknownClasses !== void 0;
|
|
137
|
-
};
|
|
138
|
-
const resolveLiteTailwindOptions = (rootDir, tailwind, uniqueLibraries) => {
|
|
139
|
-
if (!uniqueLibraries.includes(Library.Tailwind)) return void 0;
|
|
140
|
-
const options = typeof tailwind === "object" ? tailwind : {};
|
|
141
|
-
const entryPoint = options.entryPoint ?? findTailwindEntryPoint(rootDir);
|
|
142
|
-
if (!hasLiteTailwindSettings(options, entryPoint)) return void 0;
|
|
143
|
-
return buildLiteTailwindResult(options, entryPoint);
|
|
144
|
-
};
|
|
145
|
-
const buildLiteIgnoresConfig = (useDefaultIgnores, useGeneratedCodeIgnores, useGitignore, optIgnores) => ({
|
|
146
|
-
defaultIgnores: useDefaultIgnores ? [{
|
|
147
|
-
ignores: [...DEFAULT_IGNORES, ...useGeneratedCodeIgnores ? GENERATED_CODE_IGNORES : []],
|
|
148
|
-
name: "eslint-config-lite/default-ignores"
|
|
149
|
-
}] : [],
|
|
150
|
-
gitignoreConfig: useGitignore ? gitignore : [],
|
|
151
|
-
userIgnores: optIgnores?.length ? [{
|
|
152
|
-
ignores: optIgnores,
|
|
153
|
-
name: "eslint-config-lite/ignores"
|
|
154
|
-
}] : []
|
|
155
|
-
});
|
|
156
|
-
const logLiteDebug = ({
|
|
157
|
-
autoFrameworks,
|
|
158
|
-
detectRootDir,
|
|
159
|
-
nextMode,
|
|
160
|
-
optionMergeStrategy,
|
|
161
|
-
preset,
|
|
162
|
-
resolvedFrameworks,
|
|
163
|
-
resolvedTypescript,
|
|
164
|
-
runtime,
|
|
165
|
-
tsconfigRootDir,
|
|
166
|
-
uniqueExtensions,
|
|
167
|
-
uniqueFormats,
|
|
168
|
-
uniqueLibraries,
|
|
169
|
-
uniqueTesting,
|
|
170
|
-
uniqueTools
|
|
171
|
-
}) => {
|
|
172
|
-
if (!process.env.ESLINT_CONFIG_LITE_DEBUG && !process.env.ESLINT_BASIC_DEBUG) return;
|
|
173
|
-
process.stdout.write(`[ESLint Config Lite] Resolved options: ${JSON.stringify({
|
|
174
|
-
autoFrameworks,
|
|
175
|
-
detectRootDir: detectRootDir ?? process.cwd(),
|
|
176
|
-
extensions: uniqueExtensions,
|
|
177
|
-
formats: uniqueFormats,
|
|
178
|
-
frameworks: Object.entries(resolvedFrameworks).filter(([, value]) => Boolean(value)).map(([key]) => key),
|
|
179
|
-
libraries: uniqueLibraries,
|
|
180
|
-
nextMode,
|
|
181
|
-
optionMergeStrategy,
|
|
182
|
-
preset,
|
|
183
|
-
runtime,
|
|
184
|
-
testing: uniqueTesting,
|
|
185
|
-
tools: uniqueTools,
|
|
186
|
-
tsconfigRootDir,
|
|
187
|
-
typescript: resolvedTypescript ? resolvedTypescript.mode : false
|
|
188
|
-
}, null, 2)}
|
|
189
|
-
`);
|
|
190
|
-
};
|
|
191
|
-
const FRAMEWORK_EXTRA_OPTS = {
|
|
192
|
-
astro: (ctx) => ({ hasReact: ctx.hasReact, hasSolid: ctx.hasSolid, hasSvelte: ctx.hasSvelte, hasVue: ctx.hasVue }),
|
|
193
|
-
hono: (ctx) => ({ runtime: ctx.runtime }),
|
|
194
|
-
slidev: (ctx) => ({ runtime: ctx.runtime }),
|
|
195
|
-
vite: (ctx) => ({ runtime: ctx.runtime })
|
|
196
|
-
};
|
|
197
|
-
const resolveEnabledFrameworks = async (frameworks, ctx) => {
|
|
198
|
-
const entries = await Promise.all(
|
|
199
|
-
Object.entries(frameworks).filter((entry) => Boolean(entry[1])).map(
|
|
200
|
-
([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
|
-
);
|
|
206
|
-
return Object.fromEntries(entries);
|
|
207
|
-
};
|
|
208
|
-
const buildLiteEslintConfigs = async (params) => {
|
|
209
|
-
const {
|
|
210
|
-
defaultIgnores,
|
|
211
|
-
frameworkConfigs,
|
|
212
|
-
gitignoreConfig,
|
|
213
|
-
hasReact,
|
|
214
|
-
nextMode,
|
|
215
|
-
resolvedFrameworks,
|
|
216
|
-
resolvedTypescript,
|
|
217
|
-
runtimeCoreConfig,
|
|
218
|
-
tailwindOptions,
|
|
219
|
-
tsconfigRootDir,
|
|
220
|
-
uniqueExtensions,
|
|
221
|
-
uniqueFormats,
|
|
222
|
-
uniqueLibraries,
|
|
223
|
-
uniqueTesting,
|
|
224
|
-
uniqueTools,
|
|
225
|
-
userIgnores
|
|
226
|
-
} = params;
|
|
227
|
-
const get = (name) => {
|
|
228
|
-
const entry = Object.entries(frameworkConfigs).find(([k]) => k === name);
|
|
229
|
-
return entry ? entry[1] : [];
|
|
230
|
-
};
|
|
231
|
-
const tailwindSettingsConfig = buildTailwindSettingsConfig(tailwindOptions);
|
|
232
|
-
return [
|
|
233
|
-
...defaultIgnores,
|
|
234
|
-
...userIgnores,
|
|
235
|
-
...gitignoreConfig,
|
|
236
|
-
...tsconfigRootDir ? [{
|
|
237
|
-
languageOptions: { parserOptions: { tsconfigRootDir } },
|
|
238
|
-
name: "eslint-config-lite/tsconfig-root-dir"
|
|
239
|
-
}] : [],
|
|
240
|
-
{
|
|
241
|
-
files: ["**/*.cjs", "**/*.cts"],
|
|
242
|
-
languageOptions: {
|
|
243
|
-
globals: {
|
|
244
|
-
__dirname: "readonly",
|
|
245
|
-
__filename: "readonly",
|
|
246
|
-
exports: "readonly",
|
|
247
|
-
module: "readonly",
|
|
248
|
-
require: "readonly"
|
|
249
|
-
},
|
|
250
|
-
sourceType: "commonjs"
|
|
251
|
-
},
|
|
252
|
-
name: "eslint-config-lite/commonjs"
|
|
253
|
-
},
|
|
254
|
-
...runtimeCoreConfig,
|
|
255
|
-
...hasReact ? get("react") : [],
|
|
256
|
-
...get("next"),
|
|
257
|
-
...get("expo"),
|
|
258
|
-
...get("nest"),
|
|
259
|
-
...get("hono"),
|
|
260
|
-
...get("vue"),
|
|
261
|
-
...get("svelte"),
|
|
262
|
-
...get("solid"),
|
|
263
|
-
...get("angular"),
|
|
264
|
-
...get("qwik"),
|
|
265
|
-
...get("remix"),
|
|
266
|
-
...get("react-router"),
|
|
267
|
-
...get("tanstack-start"),
|
|
268
|
-
...get("nuxt"),
|
|
269
|
-
...get("preact"),
|
|
270
|
-
...get("lit"),
|
|
271
|
-
...get("slidev"),
|
|
272
|
-
...get("vite"),
|
|
273
|
-
...resolvedTypescript ? createTypescriptConfig({
|
|
274
|
-
...resolvedTypescript,
|
|
275
|
-
tsconfigRootDir: resolvedTypescript.tsconfigRootDir ?? tsconfigRootDir
|
|
276
|
-
}) : [],
|
|
277
|
-
// Astro runs after TypeScript so its parser wins for .astro files and embedded expressions.
|
|
278
|
-
...get("astro"),
|
|
279
|
-
...resolvedFrameworks.next && nextMode === NextMode.AppRouter ? [{
|
|
280
|
-
files: ["app/**/*.{ts,tsx}", "src/**/*.{ts,tsx}"],
|
|
281
|
-
name: "eslint-config-next/app-router-overrides",
|
|
282
|
-
rules: { "@next/next/no-html-link-for-pages": "off" }
|
|
283
|
-
}] : [],
|
|
284
|
-
...await getIntegrationConfigs(uniqueLibraries, uniqueTools, uniqueTesting, uniqueFormats, uniqueExtensions),
|
|
285
|
-
{
|
|
286
|
-
files: ["**/scripts/**/*.{js,mjs,cjs,ts,mts,cts}"],
|
|
287
|
-
name: "eslint-config-lite/scripts-overrides",
|
|
288
|
-
rules: {
|
|
289
|
-
"n/no-unpublished-import": "off",
|
|
290
|
-
...uniqueExtensions.includes(Extension.Security) ? { "security/detect-non-literal-fs-filename": "off" } : {}
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
...tailwindSettingsConfig ? [tailwindSettingsConfig] : [],
|
|
294
|
-
...await getPrettierConfig(uniqueTools)
|
|
295
|
-
];
|
|
296
|
-
};
|
|
297
|
-
const emitLiteWarnings = (options) => {
|
|
298
|
-
if (options?.frameworks && "remix" in options.frameworks) {
|
|
299
|
-
process.emitWarning('`frameworks.remix` is deprecated and will be removed in the next major. Please use `frameworks["react-router"]` instead.', "eslint-config-lite");
|
|
300
|
-
}
|
|
301
|
-
if (options?.typescript && typeof options.typescript === "object" && "project" in options.typescript) {
|
|
302
|
-
process.emitWarning("`typescript.project` is ignored in v2. Type-aware linting now relies on typescript-eslint projectService.", "eslint-config-lite");
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
const eslintConfig = async (options) => {
|
|
306
|
-
emitLiteWarnings(options);
|
|
307
|
-
const {
|
|
308
|
-
detection,
|
|
309
|
-
extensions: optExtensions,
|
|
310
|
-
formats: optFormats,
|
|
311
|
-
frameworks: optFrameworks,
|
|
312
|
-
ignores: optIgnores,
|
|
313
|
-
libraries: optLibraries,
|
|
314
|
-
nextMode: optNextMode,
|
|
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 scopedConfigs = await eslintConfig({
|
|
424
|
-
...projectOptions,
|
|
425
|
-
detectRootDir: projectOptions.detectRootDir ?? projectRoot,
|
|
426
|
-
projects: void 0,
|
|
427
|
-
tsconfigRootDir: projectOptions.tsconfigRootDir ?? projectRoot
|
|
428
|
-
});
|
|
429
|
-
return scopedConfigs.map((config) => scopeConfigToProject(config, projectPath));
|
|
430
|
-
})
|
|
431
|
-
);
|
|
432
|
-
const allConfigs = [...configs, ...projectConfigs.flat()];
|
|
433
|
-
const patchedConfigs = workspacePrefixes?.length ? patchImportGroups(allConfigs, workspacePrefixes) : allConfigs;
|
|
434
|
-
return applyStrictMode(patchedConfigs, strict);
|
|
435
|
-
};
|
|
436
|
-
const defineConfig = eslintConfig;
|
|
437
|
-
export {
|
|
438
|
-
Extension2 as Extension,
|
|
439
|
-
Format,
|
|
440
|
-
Library2 as Library,
|
|
441
|
-
NextMode2 as NextMode,
|
|
442
|
-
Preset2 as Preset,
|
|
443
|
-
ReactConfigKeys,
|
|
444
|
-
Runtime2 as Runtime,
|
|
445
|
-
Setting2 as Setting,
|
|
446
|
-
Testing,
|
|
447
|
-
Tool,
|
|
448
|
-
angular,
|
|
449
|
-
angularConfig,
|
|
450
|
-
astro,
|
|
451
|
-
coreConfig2 as coreConfig,
|
|
452
|
-
createCoreConfig2 as createCoreConfig,
|
|
453
|
-
createImportGroups,
|
|
454
|
-
defineConfig,
|
|
455
|
-
detectProjectOptions2 as detectProjectOptions,
|
|
456
|
-
eslintConfig,
|
|
457
|
-
expo,
|
|
458
|
-
expoConfig,
|
|
459
|
-
getGlobalsForRuntime,
|
|
460
|
-
gitignore2 as gitignore,
|
|
461
|
-
hasReactConfig,
|
|
462
|
-
hono,
|
|
463
|
-
jsConfig,
|
|
464
|
-
lit,
|
|
465
|
-
nest,
|
|
466
|
-
nestConfig,
|
|
467
|
-
next,
|
|
468
|
-
nextConfig,
|
|
469
|
-
nuxt,
|
|
470
|
-
preact,
|
|
471
|
-
preactConfig,
|
|
472
|
-
qwik,
|
|
473
|
-
react,
|
|
474
|
-
reactConfig,
|
|
475
|
-
reactRouter,
|
|
476
|
-
remix,
|
|
477
|
-
slidev,
|
|
478
|
-
solid,
|
|
479
|
-
solidConfig,
|
|
480
|
-
svelte,
|
|
481
|
-
svelteConfig,
|
|
482
|
-
tanstackStart,
|
|
483
|
-
tsConfig,
|
|
484
|
-
typescriptConfig,
|
|
485
|
-
vite,
|
|
486
|
-
vue,
|
|
487
|
-
vueConfig
|
|
488
|
-
};
|
|
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
|
+
"version": "3.1.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
7
7
|
},
|
|
8
|
-
"description": "
|
|
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
|
-
"@
|
|
27
|
-
"@santi020k/eslint-config-core": "^2.1.1",
|
|
28
|
-
"@santi020k/eslint-config-typescript": "^2.1.1"
|
|
26
|
+
"@santi020k/eslint-config-basic": "^3.1.0"
|
|
29
27
|
},
|
|
30
28
|
"devDependencies": {
|
|
31
|
-
"
|
|
32
|
-
"publint": "^0.3.21",
|
|
29
|
+
"publint": "^0.3.22",
|
|
33
30
|
"tsup": "^8.5.1",
|
|
34
|
-
"typescript": "^6.0.3"
|
|
35
|
-
"@santi020k/eslint-config-angular": "^2.1.1",
|
|
36
|
-
"@santi020k/eslint-config-astro": "^2.1.1",
|
|
37
|
-
"@santi020k/eslint-config-expo": "^2.1.1",
|
|
38
|
-
"@santi020k/eslint-config-hono": "^2.1.1",
|
|
39
|
-
"@santi020k/eslint-config-integrations": "^2.1.1",
|
|
40
|
-
"@santi020k/eslint-config-lit": "^2.1.1",
|
|
41
|
-
"@santi020k/eslint-config-nest": "^2.1.1",
|
|
42
|
-
"@santi020k/eslint-config-next": "^2.1.1",
|
|
43
|
-
"@santi020k/eslint-config-nuxt": "^2.1.1",
|
|
44
|
-
"@santi020k/eslint-config-preact": "^2.1.1",
|
|
45
|
-
"@santi020k/eslint-config-react": "^2.1.1",
|
|
46
|
-
"@santi020k/eslint-config-qwik": "^2.1.1",
|
|
47
|
-
"@santi020k/eslint-config-react-router": "^2.1.1",
|
|
48
|
-
"@santi020k/eslint-config-remix": "^2.1.1",
|
|
49
|
-
"@santi020k/eslint-config-slidev": "^2.1.1",
|
|
50
|
-
"@santi020k/eslint-config-solid": "^2.1.1",
|
|
51
|
-
"@santi020k/eslint-config-svelte": "^2.1.1",
|
|
52
|
-
"@santi020k/eslint-config-tanstack-start": "^2.1.1",
|
|
53
|
-
"@santi020k/eslint-config-vite": "^2.1.1",
|
|
54
|
-
"@santi020k/eslint-config-vue": "^2.1.1"
|
|
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": "^2.1.1",
|
|
60
|
-
"@santi020k/eslint-config-astro": "^2.1.1",
|
|
61
|
-
"@santi020k/eslint-config-expo": "^2.1.1",
|
|
62
|
-
"@santi020k/eslint-config-hono": "^2.1.1",
|
|
63
|
-
"@santi020k/eslint-config-integrations": "^2.1.1",
|
|
64
|
-
"@santi020k/eslint-config-lit": "^2.1.1",
|
|
65
|
-
"@santi020k/eslint-config-next": "^2.1.1",
|
|
66
|
-
"@santi020k/eslint-config-nest": "^2.1.1",
|
|
67
|
-
"@santi020k/eslint-config-nuxt": "^2.1.1",
|
|
68
|
-
"@santi020k/eslint-config-preact": "^2.1.1",
|
|
69
|
-
"@santi020k/eslint-config-qwik": "^2.1.1",
|
|
70
|
-
"@santi020k/eslint-config-react": "^2.1.1",
|
|
71
|
-
"@santi020k/eslint-config-react-router": "^2.1.1",
|
|
72
|
-
"@santi020k/eslint-config-remix": "^2.1.1",
|
|
73
|
-
"@santi020k/eslint-config-slidev": "^2.1.1",
|
|
74
|
-
"@santi020k/eslint-config-solid": "^2.1.1",
|
|
75
|
-
"@santi020k/eslint-config-svelte": "^2.1.1",
|
|
76
|
-
"@santi020k/eslint-config-tanstack-start": "^2.1.1",
|
|
77
|
-
"@santi020k/eslint-config-vite": "^2.1.1",
|
|
78
|
-
"@santi020k/eslint-config-vue": "^2.1.1"
|
|
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": "
|
|
37
|
+
"node": ">=22.19.0"
|
|
147
38
|
},
|
|
148
39
|
"repository": {
|
|
149
40
|
"type": "git",
|
package/dist/frameworks.d.ts
DELETED
|
@@ -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 };
|
package/dist/frameworks.js
DELETED
|
@@ -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
|
-
};
|
package/dist/integrations.d.ts
DELETED
|
@@ -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 };
|
package/dist/integrations.js
DELETED
|
@@ -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
|
-
};
|
package/dist/resolvers.d.ts
DELETED
|
@@ -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
|
-
};
|
package/dist/tailwind.d.ts
DELETED
|
@@ -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
|
-
};
|