@santi020k/eslint-config-basic 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,10 +1,73 @@
1
1
  # @santi020k/eslint-config-basic
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#74](https://github.com/santi020k/eslint-config-basic/pull/74) [`c63e902`](https://github.com/santi020k/eslint-config-basic/commit/c63e902ab0107b9d2231a84715f2d220ea283489) Thanks [@santi020k](https://github.com/santi020k)! - # v1.2.0 Release - Documentation Overhaul
8
+
9
+ This release focuses on a comprehensive update of the documentation site and branding refresh.
10
+
11
+ ## Highlights
12
+
13
+ - **VitePress Refresh**: Major updates to the documentation structure, including new guides and improved navigation.
14
+ - **Branding Assets**: Added new official logos, icons, and social preview images (opengraph) in `packages/docs/public`.
15
+ - **Theme Enhancements**: Custom styling and component improvements for a more premium documentation experience.
16
+ - **Improved Installation Guide**: Updated steps for getting started with the latest features.
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [[`c63e902`](https://github.com/santi020k/eslint-config-basic/commit/c63e902ab0107b9d2231a84715f2d220ea283489)]:
21
+ - @santi020k/eslint-config-core@1.2.0
22
+ - @santi020k/eslint-config-typescript@1.2.0
23
+ - @santi020k/eslint-config-react@1.2.0
24
+ - @santi020k/eslint-config-next@1.2.0
25
+ - @santi020k/eslint-config-astro@1.2.0
26
+ - @santi020k/eslint-config-vue@1.2.0
27
+ - @santi020k/eslint-config-svelte@1.2.0
28
+ - @santi020k/eslint-config-solid@1.2.0
29
+ - @santi020k/eslint-config-angular@1.2.0
30
+ - @santi020k/eslint-config-nest@1.2.0
31
+ - @santi020k/eslint-config-expo@1.2.0
32
+ - @santi020k/eslint-config-qwik@1.2.0
33
+ - @santi020k/eslint-config-remix@1.2.0
34
+ - @santi020k/eslint-config-optionals@1.2.0
35
+
36
+ ## 1.1.0
37
+
38
+ ### Minor Changes
39
+
40
+ - [#70](https://github.com/santi020k/eslint-config-basic/pull/70) [`ef658c1`](https://github.com/santi020k/eslint-config-basic/commit/ef658c170f6eaadce14a7e662eaa2a3762362e82) Thanks [@santi020k](https://github.com/santi020k)! - # 1.1.0 Release
41
+
42
+ ## Update Highlights
43
+
44
+ - **ESLint 10 Support**: Harmonized ESLint version to `^10.1.0` across the monorepo and playgrounds.
45
+ - **Security Patches**: Fixed vulnerabilities in `lodash`, `esbuild`, and `path-to-regexp` via root overrides.
46
+ - **Solid Playground Fix**: Resolved `MODULE_NOT_FOUND` error in the Solid playground linting process.
47
+
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies [[`ef658c1`](https://github.com/santi020k/eslint-config-basic/commit/ef658c170f6eaadce14a7e662eaa2a3762362e82)]:
51
+ - @santi020k/eslint-config-core@1.1.0
52
+ - @santi020k/eslint-config-typescript@1.1.0
53
+ - @santi020k/eslint-config-astro@1.1.0
54
+ - @santi020k/eslint-config-vue@1.1.0
55
+ - @santi020k/eslint-config-optionals@1.1.0
56
+ - @santi020k/eslint-config-qwik@1.1.0
57
+ - @santi020k/eslint-config-remix@1.1.0
58
+ - @santi020k/eslint-config-angular@1.1.0
59
+ - @santi020k/eslint-config-expo@1.1.0
60
+ - @santi020k/eslint-config-nest@1.1.0
61
+ - @santi020k/eslint-config-next@1.1.0
62
+ - @santi020k/eslint-config-react@1.1.0
63
+ - @santi020k/eslint-config-solid@1.1.0
64
+ - @santi020k/eslint-config-svelte@1.1.0
65
+
3
66
  ## 1.0.0
4
67
 
5
68
  ### Minor Changes
6
69
 
7
- - [#66](https://github.com/santi020k/eslint-config-basic/pull/66) [`6f2f473`](https://github.com/santi020k/eslint-config-basic/commit/6f2f4733642087eb9eac22a7b6193b71453f375d) Thanks [@santi020k](https://github.com/santi020k)! - # v0.10.0 Release
70
+ - [#66](https://github.com/santi020k/eslint-config-basic/pull/66) [`6f2f473`](https://github.com/santi020k/eslint-config-basic/commit/6f2f4733642087eb9eac22a7b6193b71453f375d) Thanks [@santi020k](https://github.com/santi020k)! - v0.10.0 Release
8
71
 
9
72
  ## Major Changes
10
73
 
@@ -61,7 +124,6 @@
61
124
  ### Minor Changes
62
125
 
63
126
  - 13e8e5a: # Release 0.8.0
64
-
65
127
  - **Snippet Fixes**: Resolved ESLint parsing errors in virtual TypeScript files within Markdown, Astro, and VitePress code blocks by disabling type-aware rules for those snippets.
66
128
  - **Standalone TS Support**: Restored `disableTypeChecked` configuration in the TypeScript package, ensuring it remains fully functional and parsing-error-free when used without the main composer.
67
129
  - **Documentation Reorganization**: Significantly expanded and restructured the documentation site, adding new pages for the Inspector, CLI Tooling, Extensions, and better framework-specific guides.
@@ -70,7 +132,7 @@
70
132
 
71
133
  ### Patch Changes
72
134
 
73
- - # CI & Workflow Stabilization
135
+ - CI & Workflow Stabilization
74
136
 
75
137
  - Fixed invalid `actions/setup-node` version from `@v6` to `@v4` in Release and Docs workflows.
76
138
  - Improved CLI test performance and reliability by refactoring integration tests into fast in-memory unit tests.
@@ -187,7 +249,6 @@
187
249
  ### Minor Changes
188
250
 
189
251
  - [#28](https://github.com/santi020k/eslint-config-basic/pull/28) [`162afdb`](https://github.com/santi020k/eslint-config-basic/commit/162afdb2f0a30714487915bdf083234426018ad2) Thanks [@santi020k](https://github.com/santi020k)! - feat: add `regexp` optional config with `eslint-plugin-regexp`
190
-
191
252
  - New `OptionalOption.Regexp` to enable regex linting via `eslint-plugin-regexp`
192
253
  - Catches common regex mistakes: exponential backtracking, unnecessary escapes, and optimizable character classes
193
254
  - Uses recommended rules with selective overrides for smoother adoption
@@ -212,7 +273,6 @@
212
273
  ### Minor Changes
213
274
 
214
275
  - feat: add Nest.js, Vue, and Expo ESLint configs with optionals package
215
-
216
276
  - Added `@santi020k/eslint-config-nest` with NestJS-specific linting rules
217
277
  - Added `@santi020k/eslint-config-vue` with Vue 3 linting rules
218
278
  - Added `@santi020k/eslint-config-expo` with Expo/React Native linting rules
package/README.md CHANGED
@@ -3,101 +3,27 @@
3
3
  [![CI](https://github.com/santi020k/eslint-config-basic/actions/workflows/build.yml/badge.svg)](https://github.com/santi020k/eslint-config-basic/actions/workflows/build.yml)
4
4
  [![npm version](https://img.shields.io/npm/v/@santi020k/eslint-config-basic.svg)](https://www.npmjs.com/package/@santi020k/eslint-config-basic)
5
5
  [![npm downloads](https://img.shields.io/npm/dm/@santi020k/eslint-config-basic.svg)](https://www.npmjs.com/package/@santi020k/eslint-config-basic)
6
- [![Docs](https://img.shields.io/badge/docs-VitePress-114d66.svg)](https://eslint.santi020k.me/)
7
6
  [![license](https://img.shields.io/npm/l/@santi020k/eslint-config-basic.svg)](https://github.com/santi020k/eslint-config-basic/blob/main/LICENSE)
8
7
 
9
- Composable ESLint 10+ flat-config tooling for JavaScript and TypeScript projects, with optional framework packages for React, Next.js, Astro, Vue, Svelte, Solid, Angular, NestJS, Expo, Qwik, and Remix.
8
+ Composable ESLint 10+ flat-config for JavaScript, TypeScript, and all major frameworks.
10
9
 
11
- ## Canonical Docs
10
+ This is the main entry point of the [`@santi020k/eslint-config-basic`](https://github.com/santi020k/eslint-config-basic) monorepo.
12
11
 
13
- - Docs site: [eslint.santi020k.me](https://eslint.santi020k.me/)
14
- - Repository: [github.com/santi020k/eslint-config-basic](https://github.com/santi020k/eslint-config-basic)
12
+ - Docs: [eslint.santi020k.me](https://eslint.santi020k.me/)
13
+ - Repository: [santi020k/eslint-config-basic](https://github.com/santi020k/eslint-config-basic)
15
14
  - Author: [santi020k](https://santi020k.me)
16
15
 
17
- ## ✨ Key Features
18
-
19
- - **🎯 Composable & Modular**: Mix and match configurations for different frameworks and tools using a clean, options-based API.
20
- - **🔍 Deep Auto-Detection**: Automatically detects your project's frameworks, libraries, and tools. Core features like TypeScript and runtime presets are enabled by default if detected.
21
- - **⚡ Lazy Loading**: Framework-specific configurations are loaded only when needed, ensuring maximum performance and avoiding unnecessary peer dependency conflicts.
22
- - **🛡️ Strict Mode**: Opt-in `strict: true` to promote all warnings to errors, perfect for CI/CD and maintaining high code standards.
23
- - **🌐 Smart Runtime Support**: Built-in support for Node.js, Browser, or Universal runtimes with appropriate globals and rules.
24
- - **💅 Prettier Integrated**: Seamlessly integrated with Prettier out of the box for consistent code formatting.
25
- - **🧩 Extensive Plugin Support**: Tailored rules for Tailwind CSS, Vitest, Testing Library, Storybook, TanStack (Query/Router), and more.
26
-
27
- ## 🚀 Quick Start
28
-
29
- ### Installation
16
+ ## Quick start
30
17
 
31
18
  ```bash
32
19
  npm install -D eslint @santi020k/eslint-config-basic
33
20
  ```
34
21
 
35
- ### Usage
36
-
37
- Create an `eslint.config.js` in your project root. By default, it will detect your project settings:
38
-
39
22
  ```js
23
+ // eslint.config.js
40
24
  import { eslintConfig } from '@santi020k/eslint-config-basic'
41
25
 
42
26
  export default eslintConfig()
43
27
  ```
44
28
 
45
- ### Comprehensive Example
46
-
47
- Here is an example with many features activated. Note that many of these are automatically detected if the corresponding packages are in your `package.json`.
48
-
49
- ```js
50
- import { eslintConfig, Extension, Format, Library, Testing, Tool } from '@santi020k/eslint-config-basic'
51
- import next from '@santi020k/eslint-config-next'
52
- import react from '@santi020k/eslint-config-react'
53
-
54
- export default eslintConfig({
55
- // Explicitly enable TypeScript (auto-detected if tsconfig.json exists)
56
- typescript: true,
57
-
58
- // Strict mode: warnings become errors
59
- strict: true,
60
-
61
- // Frameworks (imports are lazy-loaded)
62
- frameworks: {
63
- react,
64
- next
65
- },
66
-
67
- // Optional integrations
68
- libraries: [Library.Tailwind, Library.TanstackQuery],
69
- testing: [Testing.Vitest, Testing.Playwright, Testing.TestingLibrary],
70
- formats: [Format.Mdx, Format.Jsonc, Format.Graphql],
71
- tools: [Tool.Prettier, Tool.Cspell],
72
- extensions: [Extension.Unicorn, Extension.Sonarjs, Extension.Perfectionist]
73
- })
74
- ```
75
-
76
- ## Framework packages
77
-
78
- - TypeScript: [`@santi020k/eslint-config-typescript`](https://eslint.santi020k.me/frameworks/typescript.html)
79
- - React: [`@santi020k/eslint-config-react`](https://eslint.santi020k.me/frameworks/react.html)
80
- - Next.js: [`@santi020k/eslint-config-next`](https://eslint.santi020k.me/frameworks/next.html)
81
- - Astro: [`@santi020k/eslint-config-astro`](https://eslint.santi020k.me/frameworks/astro.html)
82
- - Vue: [`@santi020k/eslint-config-vue`](https://eslint.santi020k.me/frameworks/vue.html)
83
- - Svelte: [`@santi020k/eslint-config-svelte`](https://eslint.santi020k.me/frameworks/svelte.html)
84
- - Solid: [`@santi020k/eslint-config-solid`](https://eslint.santi020k.me/frameworks/solid.html)
85
- - Angular: [`@santi020k/eslint-config-angular`](https://eslint.santi020k.me/frameworks/angular.html)
86
- - NestJS: [`@santi020k/eslint-config-nest`](https://eslint.santi020k.me/frameworks/nest.html)
87
- - Expo: [`@santi020k/eslint-config-expo`](https://eslint.santi020k.me/frameworks/expo.html)
88
- - Qwik: [`@santi020k/eslint-config-qwik`](https://eslint.santi020k.me/frameworks/qwik.html)
89
- - Remix: [`@santi020k/eslint-config-remix`](https://eslint.santi020k.me/frameworks/remix.html)
90
-
91
- ## Development
92
-
93
- ```bash
94
- pnpm install # Install dependencies
95
- pnpm run build # Build all packages
96
- pnpm run test # Run integration tests
97
- pnpm run lint # Run linting checks
98
- pnpm run ok # Run all checks
99
- ```
100
-
101
- ---
102
-
103
- *Authored with ❤️ by [santi020k](https://santi020k.me)*
29
+ Auto-detects TypeScript, frameworks, and common tools from your `package.json`. See the [full docs](https://eslint.santi020k.me/) for all options.
package/dist/index.js CHANGED
@@ -6,32 +6,31 @@ import {
6
6
  createCoreConfig,
7
7
  detectProjectOptions,
8
8
  gitignore,
9
- hasReactConfig,
10
9
  NextMode,
11
10
  Runtime,
12
11
  Setting
13
12
  } from "@santi020k/eslint-config-core";
14
13
  import { createTypescriptConfig } from "@santi020k/eslint-config-typescript";
15
14
  import {
16
- Library,
17
- Tool,
18
- Extension,
19
- Setting as Setting2,
20
- Runtime as Runtime2,
21
- Preset,
22
- Testing,
23
- Format,
24
- NextMode as NextMode2,
25
- ReactConfigKeys,
26
- hasReactConfig as hasReactConfig2,
27
15
  coreConfig as coreConfig2,
28
16
  createCoreConfig as createCoreConfig2,
17
+ detectProjectOptions as detectProjectOptions2,
18
+ Extension,
19
+ Format,
29
20
  getGlobalsForRuntime,
30
- jsConfig,
31
21
  gitignore as gitignore2,
32
- detectProjectOptions as detectProjectOptions2
22
+ hasReactConfig,
23
+ jsConfig,
24
+ Library,
25
+ NextMode as NextMode2,
26
+ Preset,
27
+ ReactConfigKeys,
28
+ Runtime as Runtime2,
29
+ Setting as Setting2,
30
+ Testing,
31
+ Tool
33
32
  } from "@santi020k/eslint-config-core";
34
- import { typescriptConfig, tsConfig } from "@santi020k/eslint-config-typescript";
33
+ import { tsConfig, typescriptConfig } from "@santi020k/eslint-config-typescript";
35
34
  import {
36
35
  cspell,
37
36
  cypress,
@@ -89,9 +88,19 @@ const eslintConfig = (options) => {
89
88
  "Next and Expo configurations require frameworks.react. Import @santi020k/eslint-config-react and pass it via frameworks.react."
90
89
  );
91
90
  }
91
+ const hasReact = !!frameworks.react;
92
+ const hasVue = !!frameworks.vue;
93
+ const hasSvelte = !!frameworks.svelte;
94
+ const hasSolid = !!frameworks.solid;
95
+ const useGitignore = !uniqueSettings.includes(Setting.NoGitignore);
92
96
  const reactParam = resolveFramework("react", frameworks.react);
93
97
  const nextParam = resolveFramework("next", frameworks.next);
94
- const astroParam = resolveFramework("astro", frameworks.astro);
98
+ const astroParam = resolveFramework("astro", frameworks.astro, {
99
+ hasReact,
100
+ hasVue,
101
+ hasSvelte,
102
+ hasSolid
103
+ });
95
104
  const expoParam = resolveFramework("expo", frameworks.expo);
96
105
  const nestParam = resolveFramework("nest", frameworks.nest);
97
106
  const vueParam = resolveFramework("vue", frameworks.vue);
@@ -100,8 +109,6 @@ const eslintConfig = (options) => {
100
109
  const angularParam = resolveFramework("angular", frameworks.angular);
101
110
  const qwikParam = resolveFramework("qwik", frameworks.qwik);
102
111
  const remixParam = resolveFramework("remix", frameworks.remix);
103
- const hasReact = hasReactConfig({ frameworks });
104
- const useGitignore = !uniqueSettings.includes(Setting.NoGitignore);
105
112
  const runtimeCoreConfig = runtime !== Runtime.Universal ? createCoreConfig(runtime) : coreConfig;
106
113
  const configs = [
107
114
  // Settings
@@ -119,9 +126,17 @@ const eslintConfig = (options) => {
119
126
  ...runtimeCoreConfig,
120
127
  // React config (included if any React-based framework is used/passed)
121
128
  ...hasReact ? reactParam : [],
122
- // Framework-specific configs (Modularized)
123
- ...typescript ? createTypescriptConfig({ tsconfigRootDir }) : [],
124
129
  ...nextParam,
130
+ ...astroParam,
131
+ ...expoParam,
132
+ ...nestParam,
133
+ ...vueParam,
134
+ ...svelteParam,
135
+ ...solidParam,
136
+ ...angularParam,
137
+ ...qwikParam,
138
+ ...remixParam,
139
+ ...typescript ? createTypescriptConfig({ tsconfigRootDir }) : [],
125
140
  // Next.js App Router overrides (#12)
126
141
  ...frameworks.next && nextMode === NextMode.AppRouter ? [
127
142
  {
@@ -132,15 +147,6 @@ const eslintConfig = (options) => {
132
147
  }
133
148
  }
134
149
  ] : [],
135
- ...astroParam,
136
- ...expoParam,
137
- ...nestParam,
138
- ...vueParam,
139
- ...svelteParam,
140
- ...solidParam,
141
- ...angularParam,
142
- ...qwikParam,
143
- ...remixParam,
144
150
  // Optionals
145
151
  ...getOptionalConfigs(
146
152
  uniqueLibraries,
@@ -174,7 +180,7 @@ export {
174
180
  getGlobalsForRuntime,
175
181
  gitignore2 as gitignore,
176
182
  graphql,
177
- hasReactConfig2 as hasReactConfig,
183
+ hasReactConfig,
178
184
  i18next,
179
185
  jest,
180
186
  jsConfig,
@@ -1,9 +1,9 @@
1
1
  import { ImportedFramework, FlatConfigArray, Preset, EslintConfigOptions } from '@santi020k/eslint-config-core';
2
2
 
3
3
  /**
4
- * Resolves an imported framework (either array or default export) into a config array.
4
+ * Resolves an imported framework (either array, object with default, or factory function) into a config array.
5
5
  */
6
- declare const resolveFramework: (frameworkName: string, framework?: ImportedFramework) => FlatConfigArray;
6
+ declare const resolveFramework: (frameworkName: string, framework?: ImportedFramework, options?: Record<string, unknown>) => FlatConfigArray;
7
7
  /**
8
8
  * Resolves a preset into options
9
9
  */
package/dist/resolvers.js CHANGED
@@ -7,14 +7,23 @@ import {
7
7
  Testing,
8
8
  Tool
9
9
  } from "@santi020k/eslint-config-core";
10
- const resolveFramework = (frameworkName, framework) => {
10
+ const resolveFramework = (frameworkName, framework, options) => {
11
11
  if (!framework) return [];
12
12
  if (framework === true) {
13
13
  throw new TypeError(
14
14
  `Framework "${frameworkName}" requires an imported config. Install @santi020k/eslint-config-${frameworkName} and pass it via frameworks.${frameworkName}.`
15
15
  );
16
16
  }
17
- return Array.isArray(framework) ? framework : framework.default;
17
+ if (typeof framework === "function") {
18
+ return framework(options);
19
+ }
20
+ if (typeof framework === "object" && "default" in framework) {
21
+ if (typeof framework.default === "function") {
22
+ return framework.default(options);
23
+ }
24
+ return framework.default;
25
+ }
26
+ return Array.isArray(framework) ? framework : [];
18
27
  };
19
28
  const resolvePreset = (preset) => {
20
29
  switch (preset) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@santi020k/eslint-config-basic",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "A composable ESLint 9/10+ Flat Config package for JavaScript, TypeScript, React, Next.js, Vue, Svelte, Solid, Angular, Astro, Expo, NestJS, Qwik, and Remix.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -21,24 +21,24 @@
21
21
  "basic-eslint": "./dist/cli.js"
22
22
  },
23
23
  "dependencies": {
24
+ "eslint": "^9.0.0 || ^10.0.0",
24
25
  "@typescript-eslint/utils": "^8.57.0",
25
- "@santi020k/eslint-config-core": "^1.0.0",
26
- "@santi020k/eslint-config-optionals": "^1.0.0",
27
- "@santi020k/eslint-config-typescript": "^1.0.0"
26
+ "@santi020k/eslint-config-core": "^1.2.0",
27
+ "@santi020k/eslint-config-optionals": "^1.2.0",
28
+ "@santi020k/eslint-config-typescript": "^1.2.0"
28
29
  },
29
30
  "peerDependencies": {
30
- "eslint": "^9.0.0 || ^10.0.0",
31
- "@santi020k/eslint-config-angular": "^1.0.0",
32
- "@santi020k/eslint-config-astro": "^1.0.0",
33
- "@santi020k/eslint-config-expo": "^1.0.0",
34
- "@santi020k/eslint-config-nest": "^1.0.0",
35
- "@santi020k/eslint-config-next": "^1.0.0",
36
- "@santi020k/eslint-config-react": "^1.0.0",
37
- "@santi020k/eslint-config-solid": "^1.0.0",
38
- "@santi020k/eslint-config-svelte": "^1.0.0",
39
- "@santi020k/eslint-config-vue": "^1.0.0",
40
- "@santi020k/eslint-config-qwik": "^0.8.2",
41
- "@santi020k/eslint-config-remix": "^0.8.2"
31
+ "@santi020k/eslint-config-angular": "^1.2.0",
32
+ "@santi020k/eslint-config-astro": "^1.2.0",
33
+ "@santi020k/eslint-config-expo": "^1.2.0",
34
+ "@santi020k/eslint-config-nest": "^1.2.0",
35
+ "@santi020k/eslint-config-next": "^1.2.0",
36
+ "@santi020k/eslint-config-react": "^1.2.0",
37
+ "@santi020k/eslint-config-solid": "^1.2.0",
38
+ "@santi020k/eslint-config-svelte": "^1.2.0",
39
+ "@santi020k/eslint-config-vue": "^1.2.0",
40
+ "@santi020k/eslint-config-qwik": "^1.2.0",
41
+ "@santi020k/eslint-config-remix": "^1.2.0"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "@santi020k/eslint-config-angular": {