@santi020k/eslint-config-basic 1.6.0 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +165 -1
- package/README.md +4 -22
- package/dist/agent-skill-generator.d.ts +42 -20
- package/dist/agent-skill-generator.js +375 -198
- package/dist/cli.d.ts +22 -0
- package/dist/cli.js +603 -38
- package/dist/compose.d.ts +4 -2
- package/dist/compose.js +19 -8
- package/dist/frameworks.d.ts +58 -0
- package/dist/frameworks.js +106 -0
- package/dist/index.d.ts +15 -7
- package/dist/index.js +755 -104
- package/dist/integrations.d.ts +1 -0
- package/dist/integrations.js +5 -0
- package/dist/lazy.d.ts +3 -0
- package/dist/lazy.js +19 -0
- package/dist/resolvers.d.ts +5 -2
- package/dist/resolvers.js +60 -23
- package/package.json +47 -64
- package/dist/optionals.d.ts +0 -13
- package/dist/optionals.js +0 -71
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getIntegrationConfigs, getPrettierConfig } from '@santi020k/eslint-config-integrations';
|
package/dist/lazy.d.ts
ADDED
package/dist/lazy.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
const isVitest = typeof process !== "undefined" && process.env.VITEST;
|
|
4
|
+
const dynamicImport = isVitest ? (specifier) => import(
|
|
5
|
+
/* @vite-ignore */
|
|
6
|
+
specifier
|
|
7
|
+
) : Reflect.construct(Function, ["specifier", "return import(specifier)"]);
|
|
8
|
+
const req = createRequire(import.meta.url);
|
|
9
|
+
const loadModule = async (specifier) => {
|
|
10
|
+
let resolved = specifier;
|
|
11
|
+
try {
|
|
12
|
+
resolved = pathToFileURL(req.resolve(specifier)).href;
|
|
13
|
+
} catch {
|
|
14
|
+
}
|
|
15
|
+
return await dynamicImport(resolved);
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
loadModule
|
|
19
|
+
};
|
package/dist/resolvers.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { ImportedFramework, FlatConfigArray, Preset, EslintConfigOptions } from '@santi020k/eslint-config-core';
|
|
1
|
+
import { DetectedFrameworkName, ImportedFramework, FlatConfigArray, Preset, EslintConfigOptions } from '@santi020k/eslint-config-core';
|
|
2
|
+
import { FrameworkOptions } from './frameworks.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
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.
|
|
5
8
|
*/
|
|
6
|
-
declare const resolveFramework: (frameworkName:
|
|
9
|
+
declare const resolveFramework: (frameworkName: DetectedFrameworkName, framework?: ImportedFramework, options?: FrameworkOptions) => Promise<FlatConfigArray>;
|
|
7
10
|
/**
|
|
8
11
|
* Resolves a preset into options
|
|
9
12
|
*/
|
package/dist/resolvers.js
CHANGED
|
@@ -7,12 +7,11 @@ import {
|
|
|
7
7
|
Testing,
|
|
8
8
|
Tool
|
|
9
9
|
} from "@santi020k/eslint-config-core";
|
|
10
|
-
|
|
10
|
+
import { getBundledFrameworkConfig } from "./frameworks.js";
|
|
11
|
+
const resolveFramework = async (frameworkName, framework, options) => {
|
|
11
12
|
if (!framework) return [];
|
|
12
13
|
if (framework === true) {
|
|
13
|
-
|
|
14
|
-
`Framework "${frameworkName}" requires an imported config. Install @santi020k/eslint-config-${frameworkName} and pass it via frameworks.${frameworkName}.`
|
|
15
|
-
);
|
|
14
|
+
return getBundledFrameworkConfig(frameworkName, options);
|
|
16
15
|
}
|
|
17
16
|
if (typeof framework === "function") {
|
|
18
17
|
return framework(options);
|
|
@@ -21,39 +20,77 @@ const resolveFramework = (frameworkName, framework, options) => {
|
|
|
21
20
|
if (typeof framework.default === "function") {
|
|
22
21
|
return framework.default(options);
|
|
23
22
|
}
|
|
24
|
-
return framework.default;
|
|
23
|
+
if (Array.isArray(framework.default)) return framework.default;
|
|
25
24
|
}
|
|
26
|
-
|
|
25
|
+
if (Array.isArray(framework)) return framework;
|
|
26
|
+
throw new TypeError(
|
|
27
|
+
`[ESLint Basic] Invalid framework config for "${frameworkName}". Use true to enable the bundled config, or pass a config array/factory/default export.`
|
|
28
|
+
);
|
|
27
29
|
};
|
|
28
30
|
const resolvePreset = (preset) => {
|
|
29
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
|
+
};
|
|
30
49
|
case Preset.Basic:
|
|
31
|
-
return { runtime: Runtime.Universal };
|
|
32
|
-
case Preset.Node:
|
|
33
50
|
return {
|
|
34
|
-
|
|
35
|
-
|
|
51
|
+
extensions: [Extension.Unicorn, Extension.Perfectionist, Extension.Security],
|
|
52
|
+
formats: [Format.Mdx, Format.Markdown, Format.Jsonc, Format.Yaml, Format.Toml],
|
|
53
|
+
runtime: Runtime.Universal,
|
|
54
|
+
tools: [Tool.Prettier]
|
|
36
55
|
};
|
|
37
56
|
case Preset.Browser:
|
|
38
57
|
return {
|
|
39
|
-
|
|
40
|
-
|
|
58
|
+
runtime: Runtime.Browser,
|
|
59
|
+
typescript: true
|
|
41
60
|
};
|
|
42
|
-
case Preset.
|
|
61
|
+
case Preset.CI:
|
|
43
62
|
return {
|
|
44
|
-
|
|
45
|
-
runtime: Runtime.
|
|
63
|
+
extensions: [Extension.BestPractices],
|
|
64
|
+
runtime: Runtime.Universal,
|
|
65
|
+
strict: "ci",
|
|
66
|
+
tools: [Tool.Prettier],
|
|
67
|
+
typescript: true
|
|
46
68
|
};
|
|
47
|
-
case Preset.
|
|
69
|
+
case Preset.Library:
|
|
48
70
|
return {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
tools:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
71
|
+
extensions: [Extension.BestPractices],
|
|
72
|
+
runtime: Runtime.Node,
|
|
73
|
+
tools: [Tool.Prettier],
|
|
74
|
+
typescript: true
|
|
75
|
+
};
|
|
76
|
+
case Preset.Monorepo:
|
|
77
|
+
return {
|
|
78
|
+
extensions: [Extension.BestPractices],
|
|
79
|
+
runtime: Runtime.Universal,
|
|
80
|
+
tools: [Tool.Prettier],
|
|
81
|
+
typescript: true
|
|
82
|
+
};
|
|
83
|
+
case Preset.Node:
|
|
84
|
+
return {
|
|
85
|
+
runtime: Runtime.Node,
|
|
86
|
+
typescript: true
|
|
87
|
+
};
|
|
88
|
+
case Preset.Worker:
|
|
89
|
+
return {
|
|
90
|
+
runtime: Runtime.Worker,
|
|
91
|
+
typescript: true
|
|
56
92
|
};
|
|
93
|
+
// v8 ignore next 2 -- TypeScript exhausts all Preset values; default is unreachable
|
|
57
94
|
default:
|
|
58
95
|
return {};
|
|
59
96
|
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@santi020k/eslint-config-basic",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "A composable ESLint 10+ Flat Config package for JavaScript, TypeScript, React, Next.js, Vue, Svelte, Solid, Angular, Astro, Expo, NestJS, Hono, Qwik, and Remix.",
|
|
5
8
|
"type": "module",
|
|
6
9
|
"main": "./dist/index.js",
|
|
7
10
|
"module": "./dist/index.js",
|
|
8
11
|
"types": "./dist/index.d.ts",
|
|
12
|
+
"sideEffects": false,
|
|
9
13
|
"exports": {
|
|
10
14
|
".": {
|
|
11
15
|
"types": "./dist/index.d.ts",
|
|
12
16
|
"import": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./dist/index.js": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
13
21
|
}
|
|
14
22
|
},
|
|
15
23
|
"files": [
|
|
@@ -21,77 +29,48 @@
|
|
|
21
29
|
"basic-eslint": "./dist/cli.js"
|
|
22
30
|
},
|
|
23
31
|
"dependencies": {
|
|
24
|
-
"@typescript-eslint/utils": "^8.
|
|
25
|
-
"eslint": "^
|
|
26
|
-
"@santi020k/eslint-config-
|
|
27
|
-
"@santi020k/eslint-config-
|
|
28
|
-
"@santi020k/eslint-config-
|
|
32
|
+
"@typescript-eslint/utils": "^8.61.1",
|
|
33
|
+
"@santi020k/eslint-config-angular": "^2.0.0-beta.1",
|
|
34
|
+
"@santi020k/eslint-config-astro": "^2.0.0-beta.1",
|
|
35
|
+
"@santi020k/eslint-config-core": "^2.0.0-beta.1",
|
|
36
|
+
"@santi020k/eslint-config-expo": "^2.0.0-beta.1",
|
|
37
|
+
"@santi020k/eslint-config-hono": "^2.0.0-beta.1",
|
|
38
|
+
"@santi020k/eslint-config-integrations": "^2.0.0-beta.1",
|
|
39
|
+
"@santi020k/eslint-config-lit": "^2.0.0-beta.1",
|
|
40
|
+
"@santi020k/eslint-config-nest": "^2.0.0-beta.1",
|
|
41
|
+
"@santi020k/eslint-config-next": "^2.0.0-beta.1",
|
|
42
|
+
"@santi020k/eslint-config-nuxt": "^2.0.0-beta.1",
|
|
43
|
+
"@santi020k/eslint-config-preact": "^2.0.0-beta.1",
|
|
44
|
+
"@santi020k/eslint-config-qwik": "^2.0.0-beta.1",
|
|
45
|
+
"@santi020k/eslint-config-react": "^2.0.0-beta.1",
|
|
46
|
+
"@santi020k/eslint-config-react-router": "^2.0.0-beta.1",
|
|
47
|
+
"@santi020k/eslint-config-remix": "^2.0.0-beta.1",
|
|
48
|
+
"@santi020k/eslint-config-slidev": "^2.0.0-beta.1",
|
|
49
|
+
"@santi020k/eslint-config-solid": "^2.0.0-beta.1",
|
|
50
|
+
"@santi020k/eslint-config-svelte": "^2.0.0-beta.1",
|
|
51
|
+
"@santi020k/eslint-config-tanstack-start": "^2.0.0-beta.1",
|
|
52
|
+
"@santi020k/eslint-config-typescript": "^2.0.0-beta.1",
|
|
53
|
+
"@santi020k/eslint-config-vite": "^2.0.0-beta.1",
|
|
54
|
+
"@santi020k/eslint-config-vue": "^2.0.0-beta.1"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/node": "^25.9.3",
|
|
58
|
+
"publint": "^0.3.21",
|
|
59
|
+
"tsup": "^8.5.1",
|
|
60
|
+
"typescript": "^6.0.3"
|
|
29
61
|
},
|
|
30
62
|
"peerDependencies": {
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"@santi020k/eslint-config-expo": "^1.6.0",
|
|
34
|
-
"@santi020k/eslint-config-hono": "^1.6.0",
|
|
35
|
-
"@santi020k/eslint-config-nest": "^1.6.0",
|
|
36
|
-
"@santi020k/eslint-config-next": "^1.6.0",
|
|
37
|
-
"@santi020k/eslint-config-qwik": "^1.6.0",
|
|
38
|
-
"@santi020k/eslint-config-react": "^1.6.0",
|
|
39
|
-
"@santi020k/eslint-config-remix": "^1.6.0",
|
|
40
|
-
"@santi020k/eslint-config-solid": "^1.6.0",
|
|
41
|
-
"@santi020k/eslint-config-svelte": "^1.6.0",
|
|
42
|
-
"@santi020k/eslint-config-vue": "^1.6.0"
|
|
63
|
+
"eslint": "^10.0.0",
|
|
64
|
+
"typescript": ">=5.0.0"
|
|
43
65
|
},
|
|
44
66
|
"peerDependenciesMeta": {
|
|
45
|
-
"
|
|
46
|
-
"optional": true
|
|
47
|
-
},
|
|
48
|
-
"@santi020k/eslint-config-astro": {
|
|
49
|
-
"optional": true
|
|
50
|
-
},
|
|
51
|
-
"@santi020k/eslint-config-expo": {
|
|
52
|
-
"optional": true
|
|
53
|
-
},
|
|
54
|
-
"@santi020k/eslint-config-hono": {
|
|
55
|
-
"optional": true
|
|
56
|
-
},
|
|
57
|
-
"@santi020k/eslint-config-nest": {
|
|
58
|
-
"optional": true
|
|
59
|
-
},
|
|
60
|
-
"@santi020k/eslint-config-next": {
|
|
61
|
-
"optional": true
|
|
62
|
-
},
|
|
63
|
-
"@santi020k/eslint-config-react": {
|
|
64
|
-
"optional": true
|
|
65
|
-
},
|
|
66
|
-
"@santi020k/eslint-config-solid": {
|
|
67
|
-
"optional": true
|
|
68
|
-
},
|
|
69
|
-
"@santi020k/eslint-config-svelte": {
|
|
70
|
-
"optional": true
|
|
71
|
-
},
|
|
72
|
-
"@santi020k/eslint-config-vue": {
|
|
73
|
-
"optional": true
|
|
74
|
-
},
|
|
75
|
-
"@santi020k/eslint-config-qwik": {
|
|
76
|
-
"optional": true
|
|
77
|
-
},
|
|
78
|
-
"@santi020k/eslint-config-remix": {
|
|
67
|
+
"typescript": {
|
|
79
68
|
"optional": true
|
|
80
69
|
}
|
|
81
70
|
},
|
|
82
|
-
"devDependencies": {
|
|
83
|
-
"publint": "^0.3.18",
|
|
84
|
-
"tsup": "^8.5.1",
|
|
85
|
-
"typescript": "^5.9.3"
|
|
86
|
-
},
|
|
87
|
-
"publishConfig": {
|
|
88
|
-
"access": "public"
|
|
89
|
-
},
|
|
90
71
|
"engines": {
|
|
91
72
|
"node": ">=22.18.0"
|
|
92
73
|
},
|
|
93
|
-
"license": "MIT",
|
|
94
|
-
"author": "santi020k",
|
|
95
74
|
"repository": {
|
|
96
75
|
"type": "git",
|
|
97
76
|
"url": "git+https://github.com/santi020k/eslint-config-basic.git",
|
|
@@ -101,12 +80,16 @@
|
|
|
101
80
|
"bugs": {
|
|
102
81
|
"url": "https://github.com/santi020k/eslint-config-basic/issues"
|
|
103
82
|
},
|
|
83
|
+
"author": "santi020k",
|
|
84
|
+
"license": "MIT",
|
|
104
85
|
"scripts": {
|
|
105
86
|
"build": "tsup",
|
|
106
87
|
"build:pack": "npm pack",
|
|
107
88
|
"dev": "tsup --watch",
|
|
108
89
|
"clean": "rm -rf dist",
|
|
109
90
|
"check:exports": "publint",
|
|
110
|
-
"typecheck": "tsc --noEmit"
|
|
91
|
+
"typecheck": "tsc --noEmit",
|
|
92
|
+
"lint": "eslint . --no-warn-ignored --pass-on-no-patterns",
|
|
93
|
+
"lint:fix": "eslint . --fix --no-warn-ignored --pass-on-no-patterns"
|
|
111
94
|
}
|
|
112
95
|
}
|
package/dist/optionals.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Library, Tool, Testing, Format, Extension, FlatConfigArray } from '@santi020k/eslint-config-core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Gets the optional configurations based on selected options.
|
|
5
|
-
* This function maintains the recommended ordering (e.g. Prettier last).
|
|
6
|
-
*/
|
|
7
|
-
declare const getOptionalConfigs: (libraries: Library[], tools: Tool[], testing: Testing[], formats: Format[], extensions: Extension[]) => FlatConfigArray;
|
|
8
|
-
/**
|
|
9
|
-
* Returns the Prettier configuration if selected.
|
|
10
|
-
*/
|
|
11
|
-
declare const getPrettierConfig: (tools: Tool[]) => FlatConfigArray;
|
|
12
|
-
|
|
13
|
-
export { getOptionalConfigs, getPrettierConfig };
|
package/dist/optionals.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Extension,
|
|
3
|
-
Format,
|
|
4
|
-
Library,
|
|
5
|
-
Testing,
|
|
6
|
-
Tool
|
|
7
|
-
} from "@santi020k/eslint-config-core";
|
|
8
|
-
import {
|
|
9
|
-
bestPractices,
|
|
10
|
-
cspell,
|
|
11
|
-
cypress,
|
|
12
|
-
graphql,
|
|
13
|
-
i18next,
|
|
14
|
-
jest,
|
|
15
|
-
jsdoc,
|
|
16
|
-
jsonc,
|
|
17
|
-
markdown,
|
|
18
|
-
mdx,
|
|
19
|
-
perfectionist,
|
|
20
|
-
playwright,
|
|
21
|
-
prettier,
|
|
22
|
-
regexp,
|
|
23
|
-
security,
|
|
24
|
-
sonarjs,
|
|
25
|
-
stencil,
|
|
26
|
-
storybook,
|
|
27
|
-
swagger,
|
|
28
|
-
tailwind,
|
|
29
|
-
tanstackQuery,
|
|
30
|
-
tanstackRouter,
|
|
31
|
-
testingLibrary,
|
|
32
|
-
toml,
|
|
33
|
-
unicorn,
|
|
34
|
-
vitest,
|
|
35
|
-
yaml
|
|
36
|
-
} from "@santi020k/eslint-config-optionals";
|
|
37
|
-
const getOptionalConfigs = (libraries, tools, testing, formats, extensions) => {
|
|
38
|
-
const configs = [];
|
|
39
|
-
if (tools.includes(Tool.Cspell)) configs.push(...cspell);
|
|
40
|
-
if (libraries.includes(Library.Tailwind)) configs.push(...tailwind);
|
|
41
|
-
if (libraries.includes(Library.I18next)) configs.push(...i18next);
|
|
42
|
-
if (libraries.includes(Library.Stencil)) configs.push(...stencil);
|
|
43
|
-
if (libraries.includes(Library.TanstackQuery)) configs.push(...tanstackQuery);
|
|
44
|
-
if (libraries.includes(Library.TanstackRouter)) configs.push(...tanstackRouter);
|
|
45
|
-
if (libraries.includes(Library.Storybook)) configs.push(...storybook);
|
|
46
|
-
if (testing.includes(Testing.Vitest)) configs.push(...vitest);
|
|
47
|
-
if (testing.includes(Testing.Playwright)) configs.push(...playwright);
|
|
48
|
-
if (testing.includes(Testing.Jest)) configs.push(...jest);
|
|
49
|
-
if (testing.includes(Testing.Cypress)) configs.push(...cypress);
|
|
50
|
-
if (testing.includes(Testing.TestingLibrary)) configs.push(...testingLibrary);
|
|
51
|
-
if (formats.includes(Format.Mdx)) configs.push(...mdx);
|
|
52
|
-
if (formats.includes(Format.Markdown)) configs.push(...markdown);
|
|
53
|
-
if (formats.includes(Format.Jsonc)) configs.push(...jsonc);
|
|
54
|
-
if (formats.includes(Format.Yaml)) configs.push(...yaml);
|
|
55
|
-
if (formats.includes(Format.Toml)) configs.push(...toml);
|
|
56
|
-
if (formats.includes(Format.Graphql)) configs.push(...graphql);
|
|
57
|
-
if (extensions.includes(Extension.BestPractices)) configs.push(...bestPractices);
|
|
58
|
-
if (extensions.includes(Extension.Regexp)) configs.push(...regexp);
|
|
59
|
-
if (extensions.includes(Extension.Unicorn)) configs.push(...unicorn);
|
|
60
|
-
if (extensions.includes(Extension.Sonarjs)) configs.push(...sonarjs);
|
|
61
|
-
if (extensions.includes(Extension.Security)) configs.push(...security);
|
|
62
|
-
if (extensions.includes(Extension.Perfectionist)) configs.push(...perfectionist);
|
|
63
|
-
if (tools.includes(Tool.Jsdoc)) configs.push(...jsdoc);
|
|
64
|
-
if (tools.includes(Tool.Swagger)) configs.push(...swagger);
|
|
65
|
-
return configs;
|
|
66
|
-
};
|
|
67
|
-
const getPrettierConfig = (tools) => tools.includes(Tool.Prettier) ? prettier : [];
|
|
68
|
-
export {
|
|
69
|
-
getOptionalConfigs,
|
|
70
|
-
getPrettierConfig
|
|
71
|
-
};
|