@santi020k/eslint-config-basic 0.1.0 → 0.4.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/dist/index.d.ts +21 -0
- package/dist/index.js +129 -0
- package/package.json +47 -50
- package/.agent/rules/context.md +0 -78
- package/.agent/rules/guidelines.md +0 -124
- package/.editorconfig +0 -13
- package/.env.example +0 -8
- package/.github/CODEOWNERS +0 -2
- package/.github/DISCUSSION_TEMPLATE/rfcs.yml +0 -21
- package/.github/DISCUSSION_TEMPLATE/technical-discussions.yml +0 -21
- package/.github/FUNDING.yml +0 -2
- package/.github/ISSUE_TEMPLATE/README.md +0 -13
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -69
- package/.github/ISSUE_TEMPLATE/config.yml +0 -8
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -43
- package/.github/ISSUE_TEMPLATE/question.yml +0 -22
- package/.github/SECURITY.md +0 -12
- package/.github/SPONSORSHIPS.md +0 -27
- package/.github/dependabot.yml +0 -45
- package/.github/labeler.yml +0 -46
- package/.github/pull_request_template.md +0 -56
- package/.github/workflows/assign-issues.yml +0 -18
- package/.github/workflows/audit.yml +0 -22
- package/.github/workflows/build.yml +0 -29
- package/.github/workflows/codeql.yml +0 -40
- package/.github/workflows/docs.yml +0 -49
- package/.github/workflows/labeler.yml +0 -18
- package/.github/workflows/publish.yml +0 -24
- package/.github/workflows/release.yml +0 -35
- package/.github/workflows/size-check.yml +0 -23
- package/.github/workflows/stale.yml +0 -31
- package/.nvmrc +0 -1
- package/.vscode/extensions.json +0 -10
- package/.vscode/settings.json +0 -55
- package/CHANGELOG.md +0 -16
- package/CONTRIBUTING.md +0 -194
- package/DEVELOPMENT.md +0 -4
- package/LICENSE +0 -21
- package/README.md +0 -275
- package/config/.husky/commit-msg +0 -9
- package/config/.husky/pre-commit +0 -1
- package/config/.husky/pre-push +0 -1
- package/config/.husky/prepare-commit-msg +0 -1
- package/cspell.config.yaml +0 -2
- package/eslint.config.js +0 -21
- package/llms.txt +0 -72
- package/packages/astro/README.md +0 -13
- package/packages/astro/package.json +0 -45
- package/packages/astro/src/ambient.d.ts +0 -10
- package/packages/astro/src/index.ts +0 -18
- package/packages/astro/src/rules.ts +0 -29
- package/packages/astro/tsconfig.json +0 -9
- package/packages/astro/tsup.config.ts +0 -11
- package/packages/basic/README.md +0 -33
- package/packages/basic/package.json +0 -55
- package/packages/basic/src/index.ts +0 -110
- package/packages/basic/tsconfig.json +0 -9
- package/packages/basic/tsup.config.ts +0 -18
- package/packages/core/README.md +0 -14
- package/packages/core/index.ts +0 -14
- package/packages/core/package.json +0 -61
- package/packages/core/src/ambient.d.ts +0 -61
- package/packages/core/src/index.ts +0 -75
- package/packages/core/src/rules.ts +0 -157
- package/packages/core/src/settings/gitignore.ts +0 -10
- package/packages/core/src/settings/index.ts +0 -1
- package/packages/core/src/types.ts +0 -57
- package/packages/core/src/utils/index.ts +0 -28
- package/packages/core/tsconfig.json +0 -9
- package/packages/core/tsup.config.ts +0 -10
- package/packages/expo/README.md +0 -13
- package/packages/expo/package.json +0 -48
- package/packages/expo/src/ambient.d.ts +0 -3
- package/packages/expo/src/index.ts +0 -39
- package/packages/expo/tsconfig.json +0 -9
- package/packages/expo/tsup.config.ts +0 -11
- package/packages/nest/package.json +0 -45
- package/packages/nest/src/ambient.d.ts +0 -14
- package/packages/nest/src/index.ts +0 -20
- package/packages/nest/src/rules.ts +0 -15
- package/packages/nest/tsconfig.json +0 -9
- package/packages/nest/tsup.config.ts +0 -11
- package/packages/next/README.md +0 -13
- package/packages/next/package.json +0 -47
- package/packages/next/src/index.ts +0 -31
- package/packages/next/src/rules.ts +0 -16
- package/packages/next/tsconfig.json +0 -9
- package/packages/next/tsup.config.ts +0 -10
- package/packages/optionals/README.md +0 -18
- package/packages/optionals/package.json +0 -55
- package/packages/optionals/src/ambient.d.ts +0 -25
- package/packages/optionals/src/cspell.ts +0 -14
- package/packages/optionals/src/i18next.ts +0 -19
- package/packages/optionals/src/index.ts +0 -8
- package/packages/optionals/src/markdown.ts +0 -66
- package/packages/optionals/src/mdx.ts +0 -40
- package/packages/optionals/src/stencil.ts +0 -48
- package/packages/optionals/src/tailwind.ts +0 -11
- package/packages/optionals/src/vitest.ts +0 -61
- package/packages/optionals/tsconfig.json +0 -9
- package/packages/optionals/tsup.config.ts +0 -11
- package/packages/playground/README.md +0 -14
- package/packages/playground/package.json +0 -17
- package/packages/playground/src/astro/eslint.config.js +0 -4
- package/packages/playground/src/js/eslint.config.js +0 -4
- package/packages/playground/src/js/index.test.js +0 -63
- package/packages/playground/src/mdx/eslint.config.js +0 -4
- package/packages/playground/src/mdx/index.mdx +0 -115
- package/packages/playground/src/react/eslint.config.js +0 -4
- package/packages/playground/src/react/index.test.jsx +0 -130
- package/packages/playground/src/ts/eslint.config.js +0 -4
- package/packages/playground/src/ts/index.test.ts +0 -61
- package/packages/playground/src/ts/tsconfig.json +0 -3
- package/packages/playground/tsconfig.json +0 -9
- package/packages/react/README.md +0 -14
- package/packages/react/index.ts +0 -26
- package/packages/react/package.json +0 -49
- package/packages/react/src/ambient.d.ts +0 -23
- package/packages/react/src/index.ts +0 -52
- package/packages/react/src/rules.ts +0 -47
- package/packages/react/tsconfig.json +0 -9
- package/packages/react/tsup.config.ts +0 -10
- package/packages/tests/README.md +0 -17
- package/packages/tests/package.json +0 -21
- package/packages/tests/src/__snapshots__/snapshots.test.ts.snap +0 -654
- package/packages/tests/src/composition.test.ts +0 -171
- package/packages/tests/src/configs.test.ts +0 -118
- package/packages/tests/src/rules.test.ts +0 -60
- package/packages/tests/src/snapshots.test.ts +0 -126
- package/packages/tests/tsconfig.json +0 -10
- package/packages/tests/vitest.config.ts +0 -8
- package/packages/typescript/README.md +0 -14
- package/packages/typescript/package.json +0 -47
- package/packages/typescript/src/index.ts +0 -32
- package/packages/typescript/src/rules.ts +0 -36
- package/packages/typescript/tsconfig.json +0 -9
- package/packages/typescript/tsup.config.ts +0 -10
- package/tsconfig.base.json +0 -20
- package/tsconfig.docs.json +0 -18
- package/turbo.json +0 -19
- package/typedoc.config.mjs +0 -25
- package/typedoc.markdown.mjs +0 -26
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EslintConfigOptions, FlatConfigArray } from '@santi020k/eslint-config-core';
|
|
2
|
+
export { ConfigOption, EslintConfigOptions, FlatConfigArray, OptionalOption, ReactConfigs, SettingOption, applyConfigIfOptionPresent, coreConfig, gitignore, hasReactConfig, jsConfig } from '@santi020k/eslint-config-core';
|
|
3
|
+
export { tsConfig, typescriptConfig } from '@santi020k/eslint-config-typescript';
|
|
4
|
+
export { reactConfig } from '@santi020k/eslint-config-react';
|
|
5
|
+
export { nextConfig } from '@santi020k/eslint-config-next';
|
|
6
|
+
export { astroConfig } from '@santi020k/eslint-config-astro';
|
|
7
|
+
export { expoConfig } from '@santi020k/eslint-config-expo';
|
|
8
|
+
export { nestConfig } from '@santi020k/eslint-config-nest';
|
|
9
|
+
export { vueConfig } from '@santi020k/eslint-config-vue';
|
|
10
|
+
export { cspell, i18next, markdown, mdx, prettier, regexp, stencil, tailwind, unicorn, vitest } from '@santi020k/eslint-config-optionals';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Generates the ESLint configuration array, applying configurations
|
|
14
|
+
* and optional settings based on the input configuration.
|
|
15
|
+
*
|
|
16
|
+
* @param {EslintConfigOptions} options - Configuration and optional settings
|
|
17
|
+
* @returns {FlatConfigArray} The final ESLint configuration array
|
|
18
|
+
*/
|
|
19
|
+
declare const eslintConfig: ({ config, optionals, settings }?: EslintConfigOptions) => FlatConfigArray;
|
|
20
|
+
|
|
21
|
+
export { eslintConfig };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import {
|
|
3
|
+
ConfigOption,
|
|
4
|
+
OptionalOption,
|
|
5
|
+
SettingOption,
|
|
6
|
+
ReactConfigs,
|
|
7
|
+
applyConfigIfOptionPresent,
|
|
8
|
+
hasReactConfig,
|
|
9
|
+
coreConfig,
|
|
10
|
+
jsConfig,
|
|
11
|
+
gitignore
|
|
12
|
+
} from "@santi020k/eslint-config-core";
|
|
13
|
+
import { typescriptConfig, tsConfig } from "@santi020k/eslint-config-typescript";
|
|
14
|
+
import { reactConfig } from "@santi020k/eslint-config-react";
|
|
15
|
+
import { nextConfig } from "@santi020k/eslint-config-next";
|
|
16
|
+
import { astroConfig } from "@santi020k/eslint-config-astro";
|
|
17
|
+
import { expoConfig } from "@santi020k/eslint-config-expo";
|
|
18
|
+
import { nestConfig } from "@santi020k/eslint-config-nest";
|
|
19
|
+
import { vueConfig } from "@santi020k/eslint-config-vue";
|
|
20
|
+
import {
|
|
21
|
+
cspell,
|
|
22
|
+
i18next,
|
|
23
|
+
markdown,
|
|
24
|
+
mdx,
|
|
25
|
+
prettier,
|
|
26
|
+
regexp,
|
|
27
|
+
stencil,
|
|
28
|
+
tailwind,
|
|
29
|
+
unicorn,
|
|
30
|
+
vitest
|
|
31
|
+
} from "@santi020k/eslint-config-optionals";
|
|
32
|
+
import { astroConfig as astroConfig2 } from "@santi020k/eslint-config-astro";
|
|
33
|
+
import {
|
|
34
|
+
applyConfigIfOptionPresent as applyConfigIfOptionPresent2,
|
|
35
|
+
ConfigOption as ConfigOption2,
|
|
36
|
+
coreConfig as coreConfig2,
|
|
37
|
+
gitignore as gitignore2,
|
|
38
|
+
hasReactConfig as hasReactConfig2,
|
|
39
|
+
OptionalOption as OptionalOption2,
|
|
40
|
+
SettingOption as SettingOption2
|
|
41
|
+
} from "@santi020k/eslint-config-core";
|
|
42
|
+
import { expoConfig as expoConfig2 } from "@santi020k/eslint-config-expo";
|
|
43
|
+
import { nestConfig as nestConfig2 } from "@santi020k/eslint-config-nest";
|
|
44
|
+
import { nextConfig as nextConfig2 } from "@santi020k/eslint-config-next";
|
|
45
|
+
import {
|
|
46
|
+
cspell as cspell2,
|
|
47
|
+
i18next as i18next2,
|
|
48
|
+
markdown as markdown2,
|
|
49
|
+
mdx as mdx2,
|
|
50
|
+
prettier as prettier2,
|
|
51
|
+
regexp as regexp2,
|
|
52
|
+
sonarjs,
|
|
53
|
+
stencil as stencil2,
|
|
54
|
+
tailwind as tailwind2,
|
|
55
|
+
unicorn as unicorn2,
|
|
56
|
+
vitest as vitest2
|
|
57
|
+
} from "@santi020k/eslint-config-optionals";
|
|
58
|
+
import { reactConfig as reactConfig2 } from "@santi020k/eslint-config-react";
|
|
59
|
+
import { typescriptConfig as typescriptConfig2 } from "@santi020k/eslint-config-typescript";
|
|
60
|
+
import { vueConfig as vueConfig2 } from "@santi020k/eslint-config-vue";
|
|
61
|
+
var eslintConfig = ({
|
|
62
|
+
config = [],
|
|
63
|
+
optionals = [],
|
|
64
|
+
settings = []
|
|
65
|
+
} = {}) => {
|
|
66
|
+
const uniqueConfig = [...new Set(config)];
|
|
67
|
+
const uniqueOptionals = [...new Set(optionals)];
|
|
68
|
+
const uniqueSettings = [...new Set(settings)];
|
|
69
|
+
const hasReact = hasReactConfig2(uniqueConfig);
|
|
70
|
+
const useGitignore = !uniqueSettings.includes(SettingOption2.NoGitignore);
|
|
71
|
+
return [
|
|
72
|
+
// Settings
|
|
73
|
+
...useGitignore ? gitignore2 : [],
|
|
74
|
+
// Core JS config (always included)
|
|
75
|
+
...coreConfig2,
|
|
76
|
+
// React config (included if any React-based framework is used)
|
|
77
|
+
...hasReact ? reactConfig2 : [],
|
|
78
|
+
// Framework-specific configs
|
|
79
|
+
...applyConfigIfOptionPresent2(uniqueConfig, ConfigOption2.Ts, typescriptConfig2),
|
|
80
|
+
...applyConfigIfOptionPresent2(uniqueConfig, ConfigOption2.Next, nextConfig2),
|
|
81
|
+
...applyConfigIfOptionPresent2(uniqueConfig, ConfigOption2.Astro, astroConfig2),
|
|
82
|
+
...applyConfigIfOptionPresent2(uniqueConfig, ConfigOption2.Expo, expoConfig2),
|
|
83
|
+
...applyConfigIfOptionPresent2(uniqueConfig, ConfigOption2.Nest, nestConfig2),
|
|
84
|
+
...applyConfigIfOptionPresent2(uniqueConfig, ConfigOption2.Vue, vueConfig2),
|
|
85
|
+
// Optionals
|
|
86
|
+
...uniqueOptionals.includes(OptionalOption2.Cspell) ? cspell2 : [],
|
|
87
|
+
...uniqueOptionals.includes(OptionalOption2.Tailwind) ? tailwind2 : [],
|
|
88
|
+
...uniqueOptionals.includes(OptionalOption2.Vitest) ? vitest2 : [],
|
|
89
|
+
...uniqueOptionals.includes(OptionalOption2.I18next) ? i18next2 : [],
|
|
90
|
+
...uniqueOptionals.includes(OptionalOption2.Stencil) ? stencil2 : [],
|
|
91
|
+
...uniqueOptionals.includes(OptionalOption2.Regexp) ? regexp2 : [],
|
|
92
|
+
...uniqueOptionals.includes(OptionalOption2.Mdx) ? mdx2 : [],
|
|
93
|
+
...uniqueOptionals.includes(OptionalOption2.Markdown) ? markdown2 : [],
|
|
94
|
+
...uniqueOptionals.includes(OptionalOption2.Unicorn) ? unicorn2 : [],
|
|
95
|
+
...uniqueOptionals.includes(OptionalOption2.Sonarjs) ? sonarjs : [],
|
|
96
|
+
// Prettier must be last to override stylistic rules
|
|
97
|
+
...uniqueOptionals.includes(OptionalOption2.Prettier) ? prettier2 : []
|
|
98
|
+
];
|
|
99
|
+
};
|
|
100
|
+
export {
|
|
101
|
+
ConfigOption,
|
|
102
|
+
OptionalOption,
|
|
103
|
+
ReactConfigs,
|
|
104
|
+
SettingOption,
|
|
105
|
+
applyConfigIfOptionPresent,
|
|
106
|
+
astroConfig,
|
|
107
|
+
coreConfig,
|
|
108
|
+
cspell,
|
|
109
|
+
eslintConfig,
|
|
110
|
+
expoConfig,
|
|
111
|
+
gitignore,
|
|
112
|
+
hasReactConfig,
|
|
113
|
+
i18next,
|
|
114
|
+
jsConfig,
|
|
115
|
+
markdown,
|
|
116
|
+
mdx,
|
|
117
|
+
nestConfig,
|
|
118
|
+
nextConfig,
|
|
119
|
+
prettier,
|
|
120
|
+
reactConfig,
|
|
121
|
+
regexp,
|
|
122
|
+
stencil,
|
|
123
|
+
tailwind,
|
|
124
|
+
tsConfig,
|
|
125
|
+
typescriptConfig,
|
|
126
|
+
unicorn,
|
|
127
|
+
vitest,
|
|
128
|
+
vueConfig
|
|
129
|
+
};
|
package/package.json
CHANGED
|
@@ -1,61 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@santi020k/eslint-config-basic",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"access": "public"
|
|
6
|
-
},
|
|
7
|
-
"homepage": "https://santi020k.github.io/eslint-config-basic/",
|
|
8
|
-
"version": "0.1.0",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "A comprehensive ESLint configuration package for JavaScript, TypeScript, and React projects.",
|
|
9
5
|
"type": "module",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
13
17
|
],
|
|
14
18
|
"scripts": {
|
|
15
|
-
"
|
|
16
|
-
"build": "
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"clean": "turbo run clean && rm -rf node_modules",
|
|
21
|
-
"prepare": "husky config/.husky",
|
|
22
|
-
"pre-commit": "lint-staged",
|
|
23
|
-
"pre-push": "npm run test && npm run lint && npm run build",
|
|
24
|
-
"docs": "typedoc",
|
|
25
|
-
"docs:md": "typedoc --options typedoc.markdown.mjs",
|
|
26
|
-
"docs:clean": "rm -rf docs docs-md"
|
|
19
|
+
"build": "tsup",
|
|
20
|
+
"build:pack": "npm pack",
|
|
21
|
+
"dev": "tsup --watch",
|
|
22
|
+
"clean": "rm -rf dist",
|
|
23
|
+
"check:exports": "publint"
|
|
27
24
|
},
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"eslint": "
|
|
32
|
-
"eslint-config-
|
|
33
|
-
"eslint-
|
|
34
|
-
"eslint-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@santi020k/eslint-config-astro": "*",
|
|
27
|
+
"@santi020k/eslint-config-core": "*",
|
|
28
|
+
"@santi020k/eslint-config-expo": "*",
|
|
29
|
+
"@santi020k/eslint-config-nest": "*",
|
|
30
|
+
"@santi020k/eslint-config-next": "*",
|
|
31
|
+
"@santi020k/eslint-config-optionals": "*",
|
|
32
|
+
"@santi020k/eslint-config-react": "*",
|
|
33
|
+
"@santi020k/eslint-config-typescript": "*",
|
|
34
|
+
"@santi020k/eslint-config-vue": "*",
|
|
35
|
+
"@eslint/compat": "^2.0.3",
|
|
36
|
+
"@eslint/js": "^10.0.1",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
38
|
+
"@typescript-eslint/type-utils": "^8.57.0",
|
|
39
|
+
"cross-dirname": "^0.1.0",
|
|
40
|
+
"eslint": "^10.0.3",
|
|
41
|
+
"typescript-eslint": "^8.57.0"
|
|
41
42
|
},
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"tsup": "^8.5.1",
|
|
45
|
+
"typescript": "^5.9.3",
|
|
46
|
+
"@typescript-eslint/utils": "^8.57.0"
|
|
46
47
|
},
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"path": "./node_modules/cz-conventional-changelog"
|
|
50
|
-
}
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
51
50
|
},
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"minimist": "^1.2.6",
|
|
59
|
-
"tmp": "^0.2.3"
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"author": "santi020k",
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/santi020k/eslint-config-basic.git",
|
|
56
|
+
"directory": "packages/basic"
|
|
60
57
|
}
|
|
61
58
|
}
|
package/.agent/rules/context.md
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
trigger: always_on
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Context
|
|
6
|
-
|
|
7
|
-
## Priority Reading Order
|
|
8
|
-
|
|
9
|
-
1. **`llms.txt`** - Project overview and architecture
|
|
10
|
-
2. **`../../src/index.ts`** - Main entry point with enums and config function
|
|
11
|
-
3. **`./guidelines.md`** - Detailed coding guidelines
|
|
12
|
-
|
|
13
|
-
## Project Summary
|
|
14
|
-
|
|
15
|
-
This is `@santi020k/eslint-config`, a composable ESLint 9 Flat Config package supporting:
|
|
16
|
-
- JavaScript, TypeScript, React, Next.js, Astro, Expo
|
|
17
|
-
- Optional integrations: Tailwind, Vitest, cspell, i18next, MDX, Markdown, Stencil
|
|
18
|
-
|
|
19
|
-
## Monorepo Architecture
|
|
20
|
-
|
|
21
|
-
This project uses **Turborepo** with **npm Workspaces** for modular package management.
|
|
22
|
-
|
|
23
|
-
### Package Structure
|
|
24
|
-
| Package | Location | Purpose |
|
|
25
|
-
|---------|----------|---------|
|
|
26
|
-
| `@santi020k/eslint-config-core` | `packages/core` | Base JS config, utilities, types |
|
|
27
|
-
| `@santi020k/eslint-config-typescript` | `packages/typescript` | TypeScript rules |
|
|
28
|
-
| `@santi020k/eslint-config-react` | `packages/react` | React + Hooks |
|
|
29
|
-
| `@santi020k/eslint-config-next` | `packages/next` | Next.js core-web-vitals |
|
|
30
|
-
|
|
31
|
-
### Dependency Graph
|
|
32
|
-
```
|
|
33
|
-
core → typescript → react → next
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Key Architecture Decisions
|
|
37
|
-
|
|
38
|
-
### Flat Config Only
|
|
39
|
-
This package only supports ESLint 9+ flat config format. No legacy `.eslintrc` support.
|
|
40
|
-
|
|
41
|
-
### Composable Design
|
|
42
|
-
Users select configs via enums rather than extending named configs:
|
|
43
|
-
```js
|
|
44
|
-
eslintConfig({ config: [ConfigOption.React, ConfigOption.Ts] })
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Dependency Alignment
|
|
48
|
-
Uses npm `overrides` with `$` references to align peer dependency versions across the plugin ecosystem.
|
|
49
|
-
|
|
50
|
-
## Validation Workflow
|
|
51
|
-
|
|
52
|
-
Always validate changes with:
|
|
53
|
-
```bash
|
|
54
|
-
npm run build && npm run lint && npm run test
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
All commands must pass before considering work complete.
|
|
58
|
-
|
|
59
|
-
## Known Issues / Gotchas
|
|
60
|
-
|
|
61
|
-
1. **FlatCompat issues**: Some legacy plugins don't resolve correctly. Use direct plugin object imports.
|
|
62
|
-
2. **TS2742 errors**: Export explicit types when inferred types reference internal modules.
|
|
63
|
-
3. **Plugin version conflicts**: Check `overrides` in package.json when adding new ESLint plugins.
|
|
64
|
-
4. **Workspace lint**: Lint runs from root only, not from individual packages.
|
|
65
|
-
|
|
66
|
-
## File Modification Patterns
|
|
67
|
-
|
|
68
|
-
### When adding a new framework config (as a package):
|
|
69
|
-
1. Create `packages/{name}/` with `package.json`, `tsconfig.json`, `tsup.config.ts`
|
|
70
|
-
2. Create `packages/{name}/src/index.ts` exporting the config
|
|
71
|
-
3. Add to `ConfigOption` enum in `packages/core/src/types.ts`
|
|
72
|
-
4. Wire into `eslintConfig()` function in `src/index.ts`
|
|
73
|
-
|
|
74
|
-
### When adding a new optional:
|
|
75
|
-
1. Create `src/optionals/{name}.ts`
|
|
76
|
-
2. Export from `src/optionals/index.ts`
|
|
77
|
-
3. Add to `OptionalOption` enum in `packages/core/src/types.ts`
|
|
78
|
-
4. Wire into `eslintConfig()` function
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
trigger: always_on
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# AI Coding Assistant Guidelines
|
|
6
|
-
|
|
7
|
-
This document provides guidance for AI coding assistants working on @santi020k/eslint-config.
|
|
8
|
-
|
|
9
|
-
## Project Overview
|
|
10
|
-
|
|
11
|
-
This is an ESLint configuration package using **ESLint 9 Flat Config** format. It exports a composable `eslintConfig()` function.
|
|
12
|
-
|
|
13
|
-
The project is a **monorepo** using Turborepo and npm Workspaces.
|
|
14
|
-
|
|
15
|
-
## Key Files to Understand
|
|
16
|
-
|
|
17
|
-
### Root Level
|
|
18
|
-
- `src/index.ts` - Main entry point, re-exports from packages + composes configs
|
|
19
|
-
- `turbo.json` - Turborepo build configuration
|
|
20
|
-
- `eslint.config.js` - ESLint config for this repo
|
|
21
|
-
- `vitest.config.ts` - Test configuration
|
|
22
|
-
|
|
23
|
-
### Packages
|
|
24
|
-
- `packages/core/src/index.ts` - Core config, types, utilities
|
|
25
|
-
- `packages/typescript/src/index.ts` - TypeScript config
|
|
26
|
-
- `packages/react/src/index.ts` - React + Hooks config
|
|
27
|
-
- `packages/next/src/index.ts` - Next.js config
|
|
28
|
-
|
|
29
|
-
### Tests
|
|
30
|
-
- `tests/configs.test.ts` - Config export tests
|
|
31
|
-
- `tests/rules.test.ts` - Rule validation tests
|
|
32
|
-
- `tests/composition.test.ts` - eslintConfig() composition tests
|
|
33
|
-
|
|
34
|
-
## Code Conventions
|
|
35
|
-
|
|
36
|
-
### TypeScript
|
|
37
|
-
- Use explicit type annotations for exports
|
|
38
|
-
- Explicit return types on exported functions
|
|
39
|
-
- Use `type` imports when importing only types (`import type { X } from 'y'`)
|
|
40
|
-
- Follow the existing enum patterns (`ConfigOption`, `OptionalOption`, `SettingOption`)
|
|
41
|
-
- Prefer `const` assertions where appropriate
|
|
42
|
-
|
|
43
|
-
### Imports
|
|
44
|
-
- Use `.js` extension for relative imports (ESM compatibility)
|
|
45
|
-
- Sort imports: external first, then internal with blank line
|
|
46
|
-
|
|
47
|
-
### Naming Conventions
|
|
48
|
-
- Config arrays: `camelCaseConfig` (e.g., `reactConfig`, `tsConfig`)
|
|
49
|
-
- Enums: `PascalCase` (e.g., `ConfigOption`, `OptionalOption`)
|
|
50
|
-
- Files: `kebab-case.ts` or `index.ts` for main exports
|
|
51
|
-
|
|
52
|
-
### ESLint Configs
|
|
53
|
-
- All configs return `TSESLint.FlatConfig.ConfigArray`
|
|
54
|
-
- Each package exports a main config array
|
|
55
|
-
- Rules are organized into separate files when complex
|
|
56
|
-
- Preferred flat config pattern:
|
|
57
|
-
```typescript
|
|
58
|
-
export const myConfig: TSESLint.FlatConfig.ConfigArray = [
|
|
59
|
-
{
|
|
60
|
-
name: 'my-config/rules',
|
|
61
|
-
rules: {
|
|
62
|
-
'rule-name': 'error'
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Package Structure
|
|
69
|
-
Each package under `packages/` follows this structure:
|
|
70
|
-
```
|
|
71
|
-
packages/{name}/
|
|
72
|
-
├── package.json
|
|
73
|
-
├── tsconfig.json
|
|
74
|
-
├── tsup.config.ts
|
|
75
|
-
└── src/
|
|
76
|
-
├── index.ts # Main export
|
|
77
|
-
├── rules.ts # Rule definitions (optional)
|
|
78
|
-
└── ambient.d.ts # Type declarations for plugins (if needed)
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Adding New Features
|
|
82
|
-
|
|
83
|
-
### New Framework Config (as package)
|
|
84
|
-
```bash
|
|
85
|
-
# 1. Create package directory
|
|
86
|
-
mkdir -p packages/myframework/src
|
|
87
|
-
|
|
88
|
-
# 2. Create package.json with dependencies
|
|
89
|
-
# 3. Create tsconfig.json extending base
|
|
90
|
-
# 4. Create tsup.config.ts
|
|
91
|
-
# 5. Create src/index.ts with config
|
|
92
|
-
# 6. Add enum value to packages/core/src/types.ts
|
|
93
|
-
# 7. Wire into src/index.ts eslintConfig()
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### New Optional
|
|
97
|
-
```typescript
|
|
98
|
-
// src/optionals/myoptional.ts
|
|
99
|
-
import type { TSESLint } from '@typescript-eslint/utils'
|
|
100
|
-
|
|
101
|
-
export const myoptional: TSESLint.FlatConfig.ConfigArray = [
|
|
102
|
-
// optional rules
|
|
103
|
-
]
|
|
104
|
-
|
|
105
|
-
// Add to src/optionals/index.ts
|
|
106
|
-
// Add enum value to packages/core/src/types.ts
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Verification Commands
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
npm run build # Turborepo builds all packages
|
|
113
|
-
npm run lint # Lints entire monorepo from root
|
|
114
|
-
npm run test # Runs Vitest (30 tests)
|
|
115
|
-
npm run inspector # Visual config inspection
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## Common Pitfalls
|
|
119
|
-
|
|
120
|
-
1. **Peer dependencies**: Use `$` references in overrides for version alignment
|
|
121
|
-
2. **Plugin loading**: Use direct plugin object references, not string-based resolution
|
|
122
|
-
3. **Type exports**: May need explicit type annotations to avoid TS2742 errors
|
|
123
|
-
4. **Ambient declarations**: Create `.d.ts` files for plugins without TypeScript types
|
|
124
|
-
5. **Workspace lint**: Don't add lint scripts to individual packages - lint runs from root only
|
package/.editorconfig
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Editor configuration, see http://editorconfig.org
|
|
2
|
-
root = true
|
|
3
|
-
|
|
4
|
-
[*]
|
|
5
|
-
charset = utf-8
|
|
6
|
-
indent_style = space
|
|
7
|
-
indent_size = 2
|
|
8
|
-
insert_final_newline = true
|
|
9
|
-
trim_trailing_whitespace = true
|
|
10
|
-
|
|
11
|
-
[*.md]
|
|
12
|
-
max_line_length = off
|
|
13
|
-
trim_trailing_whitespace = false
|
package/.env.example
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# GitHub Personal Access Token — used by the release workflow to create
|
|
2
|
-
# GitHub Releases and push changelog commits. Requires `repo` scope.
|
|
3
|
-
PA_TOKEN=
|
|
4
|
-
|
|
5
|
-
# npm Access Token — used by the publish workflow to publish the
|
|
6
|
-
# @santi020k/eslint-config-basic package to the npm registry.
|
|
7
|
-
# Generate at https://www.npmjs.com/settings/<user>/tokens
|
|
8
|
-
NPM_TOKEN=
|
package/.github/CODEOWNERS
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
body:
|
|
2
|
-
- attributes:
|
|
3
|
-
label: RFC
|
|
4
|
-
value: |
|
|
5
|
-
Suggested changes...
|
|
6
|
-
id: rfc
|
|
7
|
-
type: textarea
|
|
8
|
-
- attributes:
|
|
9
|
-
label: Additional Info
|
|
10
|
-
value: |
|
|
11
|
-
Any additional info...
|
|
12
|
-
id: additional
|
|
13
|
-
type: textarea
|
|
14
|
-
- attributes:
|
|
15
|
-
label: Before you submit your RFC, please confirm the following. If any of these required steps are not taken, we may not be able to review your RFC. Help us to help you!
|
|
16
|
-
options:
|
|
17
|
-
- label: I have searched for related discussions and issues.
|
|
18
|
-
required: true
|
|
19
|
-
id: required-checks
|
|
20
|
-
type: checkboxes
|
|
21
|
-
title: Your Title Here
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
body:
|
|
2
|
-
- attributes:
|
|
3
|
-
label: Body
|
|
4
|
-
value: |
|
|
5
|
-
Body of the technical discussion...
|
|
6
|
-
id: body
|
|
7
|
-
type: textarea
|
|
8
|
-
- attributes:
|
|
9
|
-
label: Additional Info
|
|
10
|
-
value: |
|
|
11
|
-
Any additional info...
|
|
12
|
-
id: additional
|
|
13
|
-
type: textarea
|
|
14
|
-
- attributes:
|
|
15
|
-
label: Before you submit your discussion, please confirm the following. If any of these required steps are not taken, we may not be able to review your RFC. Help us to help you!
|
|
16
|
-
options:
|
|
17
|
-
- label: I have searched for related discussions and issues.
|
|
18
|
-
required: true
|
|
19
|
-
id: required-checks
|
|
20
|
-
type: checkboxes
|
|
21
|
-
title: Your Title Here
|
package/.github/FUNDING.yml
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Issue Templates
|
|
2
|
-
|
|
3
|
-
## Documentation
|
|
4
|
-
|
|
5
|
-
[Syntax for issue forms (the top level properties)](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms)
|
|
6
|
-
|
|
7
|
-
[Syntax for GitHub's form schema (the form body)](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema)
|
|
8
|
-
|
|
9
|
-
[Configuring the template chooser (config.yml)](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser)
|
|
10
|
-
|
|
11
|
-
## Template Chooser Sorting
|
|
12
|
-
|
|
13
|
-
The templates are sorted in the template chooser based on the filename, not on the form name. This is why we have prefixed the filenames with numbers.
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
name: 🐛 Bug Report
|
|
2
|
-
description: Create a report to help us improve
|
|
3
|
-
title: "[Bug]: "
|
|
4
|
-
labels: ["bug"]
|
|
5
|
-
body:
|
|
6
|
-
- type: markdown
|
|
7
|
-
attributes:
|
|
8
|
-
value: |
|
|
9
|
-
Thanks for taking the time to fill out this bug report!
|
|
10
|
-
|
|
11
|
-
- type: textarea
|
|
12
|
-
id: description
|
|
13
|
-
attributes:
|
|
14
|
-
label: Description
|
|
15
|
-
description: A clear and concise description of what the bug is.
|
|
16
|
-
placeholder: When I run eslint, it crashes with error...
|
|
17
|
-
validations:
|
|
18
|
-
required: true
|
|
19
|
-
|
|
20
|
-
- type: textarea
|
|
21
|
-
id: reproduction
|
|
22
|
-
attributes:
|
|
23
|
-
label: Reproduction
|
|
24
|
-
description: |
|
|
25
|
-
Please provide a link to a reproduction repository or a minimal code snippet.
|
|
26
|
-
This is critical for us to understand and fix the issue.
|
|
27
|
-
placeholder: |
|
|
28
|
-
1. create a new project with...
|
|
29
|
-
2. install @santi020k/eslint-config-basic
|
|
30
|
-
3. run eslint .
|
|
31
|
-
validations:
|
|
32
|
-
required: true
|
|
33
|
-
|
|
34
|
-
- type: checkboxes
|
|
35
|
-
id: packages
|
|
36
|
-
attributes:
|
|
37
|
-
label: Packages Affected
|
|
38
|
-
description: Select the packages that seem to be causing the issue.
|
|
39
|
-
options:
|
|
40
|
-
- label: "@santi020k/eslint-config-basic"
|
|
41
|
-
- label: "@santi020k/eslint-config-core"
|
|
42
|
-
- label: "@santi020k/eslint-config-typescript"
|
|
43
|
-
- label: "@santi020k/eslint-config-react"
|
|
44
|
-
- label: "@santi020k/eslint-config-next"
|
|
45
|
-
- label: "@santi020k/eslint-config-astro"
|
|
46
|
-
- label: "@santi020k/eslint-config-expo"
|
|
47
|
-
|
|
48
|
-
- type: textarea
|
|
49
|
-
id: expected-behavior
|
|
50
|
-
attributes:
|
|
51
|
-
label: Expected Behavior
|
|
52
|
-
description: A clear and concise description of what you expected to happen.
|
|
53
|
-
validations:
|
|
54
|
-
required: true
|
|
55
|
-
|
|
56
|
-
- type: input
|
|
57
|
-
id: environment
|
|
58
|
-
attributes:
|
|
59
|
-
label: Environment Info
|
|
60
|
-
description: |
|
|
61
|
-
Create a report using `npx envinfo --system --binaries --browsers --npmPackages "{eslint,@santi020k/*,typescript}"`
|
|
62
|
-
placeholder: |
|
|
63
|
-
System:
|
|
64
|
-
OS: macOS 14.0
|
|
65
|
-
Binaries:
|
|
66
|
-
Node: 20.10.0
|
|
67
|
-
npm: 10.2.3
|
|
68
|
-
validations:
|
|
69
|
-
required: false
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
blank_issues_enabled: false
|
|
2
|
-
contact_links:
|
|
3
|
-
- name: Global ESLint Config Docs
|
|
4
|
-
url: https://eslint.org/docs/latest/use/configure/configuration-files
|
|
5
|
-
about: Official ESLint configuration documentation
|
|
6
|
-
- name: GitHub Discussions
|
|
7
|
-
url: https://github.com/santi020k/eslint-config/discussions
|
|
8
|
-
about: Ask questions and discuss ideas
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
name: ✨ Feature Request
|
|
2
|
-
description: Suggest an idea for this project
|
|
3
|
-
title: "[Feature]: "
|
|
4
|
-
labels: ["enhancement"]
|
|
5
|
-
body:
|
|
6
|
-
- type: textarea
|
|
7
|
-
id: description
|
|
8
|
-
attributes:
|
|
9
|
-
label: Is your feature request related to a problem? Please describe.
|
|
10
|
-
description: A clear and concise description of what the problem is.
|
|
11
|
-
placeholder: I'm always frustrated when...
|
|
12
|
-
validations:
|
|
13
|
-
required: true
|
|
14
|
-
|
|
15
|
-
- type: checkboxes
|
|
16
|
-
id: packages
|
|
17
|
-
attributes:
|
|
18
|
-
label: Packages Affected
|
|
19
|
-
description: Select the packages relevant to this feature.
|
|
20
|
-
options:
|
|
21
|
-
- label: "@santi020k/eslint-config-basic"
|
|
22
|
-
- label: "@santi020k/eslint-config-core"
|
|
23
|
-
- label: "@santi020k/eslint-config-typescript"
|
|
24
|
-
- label: "@santi020k/eslint-config-react"
|
|
25
|
-
- label: "@santi020k/eslint-config-next"
|
|
26
|
-
- label: "@santi020k/eslint-config-astro"
|
|
27
|
-
- label: "@santi020k/eslint-config-expo"
|
|
28
|
-
|
|
29
|
-
- type: textarea
|
|
30
|
-
id: solution
|
|
31
|
-
attributes:
|
|
32
|
-
label: Describe the solution you'd like
|
|
33
|
-
description: A clear and concise description of what you want to happen.
|
|
34
|
-
validations:
|
|
35
|
-
required: true
|
|
36
|
-
|
|
37
|
-
- type: textarea
|
|
38
|
-
id: alternatives
|
|
39
|
-
attributes:
|
|
40
|
-
label: Describe alternatives you've considered
|
|
41
|
-
description: A clear and concise description of any alternative solutions or features you've considered.
|
|
42
|
-
validations:
|
|
43
|
-
required: false
|