@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.
Files changed (142) hide show
  1. package/dist/index.d.ts +21 -0
  2. package/dist/index.js +129 -0
  3. package/package.json +47 -50
  4. package/.agent/rules/context.md +0 -78
  5. package/.agent/rules/guidelines.md +0 -124
  6. package/.editorconfig +0 -13
  7. package/.env.example +0 -8
  8. package/.github/CODEOWNERS +0 -2
  9. package/.github/DISCUSSION_TEMPLATE/rfcs.yml +0 -21
  10. package/.github/DISCUSSION_TEMPLATE/technical-discussions.yml +0 -21
  11. package/.github/FUNDING.yml +0 -2
  12. package/.github/ISSUE_TEMPLATE/README.md +0 -13
  13. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -69
  14. package/.github/ISSUE_TEMPLATE/config.yml +0 -8
  15. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -43
  16. package/.github/ISSUE_TEMPLATE/question.yml +0 -22
  17. package/.github/SECURITY.md +0 -12
  18. package/.github/SPONSORSHIPS.md +0 -27
  19. package/.github/dependabot.yml +0 -45
  20. package/.github/labeler.yml +0 -46
  21. package/.github/pull_request_template.md +0 -56
  22. package/.github/workflows/assign-issues.yml +0 -18
  23. package/.github/workflows/audit.yml +0 -22
  24. package/.github/workflows/build.yml +0 -29
  25. package/.github/workflows/codeql.yml +0 -40
  26. package/.github/workflows/docs.yml +0 -49
  27. package/.github/workflows/labeler.yml +0 -18
  28. package/.github/workflows/publish.yml +0 -24
  29. package/.github/workflows/release.yml +0 -35
  30. package/.github/workflows/size-check.yml +0 -23
  31. package/.github/workflows/stale.yml +0 -31
  32. package/.nvmrc +0 -1
  33. package/.vscode/extensions.json +0 -10
  34. package/.vscode/settings.json +0 -55
  35. package/CHANGELOG.md +0 -16
  36. package/CONTRIBUTING.md +0 -194
  37. package/DEVELOPMENT.md +0 -4
  38. package/LICENSE +0 -21
  39. package/README.md +0 -275
  40. package/config/.husky/commit-msg +0 -9
  41. package/config/.husky/pre-commit +0 -1
  42. package/config/.husky/pre-push +0 -1
  43. package/config/.husky/prepare-commit-msg +0 -1
  44. package/cspell.config.yaml +0 -2
  45. package/eslint.config.js +0 -21
  46. package/llms.txt +0 -72
  47. package/packages/astro/README.md +0 -13
  48. package/packages/astro/package.json +0 -45
  49. package/packages/astro/src/ambient.d.ts +0 -10
  50. package/packages/astro/src/index.ts +0 -18
  51. package/packages/astro/src/rules.ts +0 -29
  52. package/packages/astro/tsconfig.json +0 -9
  53. package/packages/astro/tsup.config.ts +0 -11
  54. package/packages/basic/README.md +0 -33
  55. package/packages/basic/package.json +0 -55
  56. package/packages/basic/src/index.ts +0 -110
  57. package/packages/basic/tsconfig.json +0 -9
  58. package/packages/basic/tsup.config.ts +0 -18
  59. package/packages/core/README.md +0 -14
  60. package/packages/core/index.ts +0 -14
  61. package/packages/core/package.json +0 -61
  62. package/packages/core/src/ambient.d.ts +0 -61
  63. package/packages/core/src/index.ts +0 -75
  64. package/packages/core/src/rules.ts +0 -157
  65. package/packages/core/src/settings/gitignore.ts +0 -10
  66. package/packages/core/src/settings/index.ts +0 -1
  67. package/packages/core/src/types.ts +0 -57
  68. package/packages/core/src/utils/index.ts +0 -28
  69. package/packages/core/tsconfig.json +0 -9
  70. package/packages/core/tsup.config.ts +0 -10
  71. package/packages/expo/README.md +0 -13
  72. package/packages/expo/package.json +0 -48
  73. package/packages/expo/src/ambient.d.ts +0 -3
  74. package/packages/expo/src/index.ts +0 -39
  75. package/packages/expo/tsconfig.json +0 -9
  76. package/packages/expo/tsup.config.ts +0 -11
  77. package/packages/nest/package.json +0 -45
  78. package/packages/nest/src/ambient.d.ts +0 -14
  79. package/packages/nest/src/index.ts +0 -20
  80. package/packages/nest/src/rules.ts +0 -15
  81. package/packages/nest/tsconfig.json +0 -9
  82. package/packages/nest/tsup.config.ts +0 -11
  83. package/packages/next/README.md +0 -13
  84. package/packages/next/package.json +0 -47
  85. package/packages/next/src/index.ts +0 -31
  86. package/packages/next/src/rules.ts +0 -16
  87. package/packages/next/tsconfig.json +0 -9
  88. package/packages/next/tsup.config.ts +0 -10
  89. package/packages/optionals/README.md +0 -18
  90. package/packages/optionals/package.json +0 -55
  91. package/packages/optionals/src/ambient.d.ts +0 -25
  92. package/packages/optionals/src/cspell.ts +0 -14
  93. package/packages/optionals/src/i18next.ts +0 -19
  94. package/packages/optionals/src/index.ts +0 -8
  95. package/packages/optionals/src/markdown.ts +0 -66
  96. package/packages/optionals/src/mdx.ts +0 -40
  97. package/packages/optionals/src/stencil.ts +0 -48
  98. package/packages/optionals/src/tailwind.ts +0 -11
  99. package/packages/optionals/src/vitest.ts +0 -61
  100. package/packages/optionals/tsconfig.json +0 -9
  101. package/packages/optionals/tsup.config.ts +0 -11
  102. package/packages/playground/README.md +0 -14
  103. package/packages/playground/package.json +0 -17
  104. package/packages/playground/src/astro/eslint.config.js +0 -4
  105. package/packages/playground/src/js/eslint.config.js +0 -4
  106. package/packages/playground/src/js/index.test.js +0 -63
  107. package/packages/playground/src/mdx/eslint.config.js +0 -4
  108. package/packages/playground/src/mdx/index.mdx +0 -115
  109. package/packages/playground/src/react/eslint.config.js +0 -4
  110. package/packages/playground/src/react/index.test.jsx +0 -130
  111. package/packages/playground/src/ts/eslint.config.js +0 -4
  112. package/packages/playground/src/ts/index.test.ts +0 -61
  113. package/packages/playground/src/ts/tsconfig.json +0 -3
  114. package/packages/playground/tsconfig.json +0 -9
  115. package/packages/react/README.md +0 -14
  116. package/packages/react/index.ts +0 -26
  117. package/packages/react/package.json +0 -49
  118. package/packages/react/src/ambient.d.ts +0 -23
  119. package/packages/react/src/index.ts +0 -52
  120. package/packages/react/src/rules.ts +0 -47
  121. package/packages/react/tsconfig.json +0 -9
  122. package/packages/react/tsup.config.ts +0 -10
  123. package/packages/tests/README.md +0 -17
  124. package/packages/tests/package.json +0 -21
  125. package/packages/tests/src/__snapshots__/snapshots.test.ts.snap +0 -654
  126. package/packages/tests/src/composition.test.ts +0 -171
  127. package/packages/tests/src/configs.test.ts +0 -118
  128. package/packages/tests/src/rules.test.ts +0 -60
  129. package/packages/tests/src/snapshots.test.ts +0 -126
  130. package/packages/tests/tsconfig.json +0 -10
  131. package/packages/tests/vitest.config.ts +0 -8
  132. package/packages/typescript/README.md +0 -14
  133. package/packages/typescript/package.json +0 -47
  134. package/packages/typescript/src/index.ts +0 -32
  135. package/packages/typescript/src/rules.ts +0 -36
  136. package/packages/typescript/tsconfig.json +0 -9
  137. package/packages/typescript/tsup.config.ts +0 -10
  138. package/tsconfig.base.json +0 -20
  139. package/tsconfig.docs.json +0 -18
  140. package/turbo.json +0 -19
  141. package/typedoc.config.mjs +0 -25
  142. package/typedoc.markdown.mjs +0 -26
@@ -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
- "private": false,
4
- "publishConfig": {
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
- "packageManager": "npm@10.8.3",
11
- "workspaces": [
12
- "packages/*"
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
- "dev": "turbo run dev",
16
- "build": "turbo run build",
17
- "lint": "turbo run lint",
18
- "lint:fix": "turbo run lint:fix",
19
- "test": "vitest run packages/tests",
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
- "devDependencies": {
29
- "commitizen": "^4.3.1",
30
- "cz-conventional-changelog": "^3.3.0",
31
- "eslint": "^9.39.2",
32
- "eslint-config-standard": "^17.1.0",
33
- "eslint-plugin-n": "^17.23.2",
34
- "eslint-plugin-promise": "^7.2.1",
35
- "husky": "^9.1.7",
36
- "lint-staged": "^16.2.7",
37
- "turbo": "^2.5.3",
38
- "typedoc": "^0.28.16",
39
- "typedoc-plugin-markdown": "^4.10.0",
40
- "vitest": "^4.0.18"
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
- "lint-staged": {
43
- "*.{js,jsx,ts,tsx,md}": [
44
- "eslint --fix"
45
- ]
43
+ "devDependencies": {
44
+ "tsup": "^8.5.1",
45
+ "typescript": "^5.9.3",
46
+ "@typescript-eslint/utils": "^8.57.0"
46
47
  },
47
- "config": {
48
- "commitizen": {
49
- "path": "./node_modules/cz-conventional-changelog"
50
- }
48
+ "publishConfig": {
49
+ "access": "public"
51
50
  },
52
- "overrides": {
53
- "eslint": "$eslint",
54
- "eslint-config-standard": "$eslint-config-standard",
55
- "eslint-plugin-promise": "$eslint-plugin-promise",
56
- "eslint-plugin-n": "$eslint-plugin-n",
57
- "lodash": "^4.17.23",
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
  }
@@ -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=
@@ -1,2 +0,0 @@
1
- # Users who can approve a pr of any part of the project
2
- * @santi020k
@@ -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
@@ -1,2 +0,0 @@
1
- ko_fi: santi020k
2
- github: santi020k
@@ -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