@santi020k/eslint-config-basic 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,10 +1,40 @@
1
1
  # @santi020k/eslint-config-basic
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#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
8
+
9
+ ## Update Highlights
10
+
11
+ - **ESLint 10 Support**: Harmonized ESLint version to `^10.1.0` across the monorepo and playgrounds.
12
+ - **Security Patches**: Fixed vulnerabilities in `lodash`, `esbuild`, and `path-to-regexp` via root overrides.
13
+ - **Solid Playground Fix**: Resolved `MODULE_NOT_FOUND` error in the Solid playground linting process.
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [[`ef658c1`](https://github.com/santi020k/eslint-config-basic/commit/ef658c170f6eaadce14a7e662eaa2a3762362e82)]:
18
+ - @santi020k/eslint-config-core@1.1.0
19
+ - @santi020k/eslint-config-typescript@1.1.0
20
+ - @santi020k/eslint-config-astro@1.1.0
21
+ - @santi020k/eslint-config-vue@1.1.0
22
+ - @santi020k/eslint-config-optionals@1.1.0
23
+ - @santi020k/eslint-config-qwik@1.1.0
24
+ - @santi020k/eslint-config-remix@1.1.0
25
+ - @santi020k/eslint-config-angular@1.1.0
26
+ - @santi020k/eslint-config-expo@1.1.0
27
+ - @santi020k/eslint-config-nest@1.1.0
28
+ - @santi020k/eslint-config-next@1.1.0
29
+ - @santi020k/eslint-config-react@1.1.0
30
+ - @santi020k/eslint-config-solid@1.1.0
31
+ - @santi020k/eslint-config-svelte@1.1.0
32
+
3
33
  ## 1.0.0
4
34
 
5
35
  ### Minor Changes
6
36
 
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
37
+ - [#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
38
 
9
39
  ## Major Changes
10
40
 
@@ -61,7 +91,6 @@
61
91
  ### Minor Changes
62
92
 
63
93
  - 13e8e5a: # Release 0.8.0
64
-
65
94
  - **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
95
  - **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
96
  - **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 +99,7 @@
70
99
 
71
100
  ### Patch Changes
72
101
 
73
- - # CI & Workflow Stabilization
102
+ - CI & Workflow Stabilization
74
103
 
75
104
  - Fixed invalid `actions/setup-node` version from `@v6` to `@v4` in Release and Docs workflows.
76
105
  - Improved CLI test performance and reliability by refactoring integration tests into fast in-memory unit tests.
@@ -187,7 +216,6 @@
187
216
  ### Minor Changes
188
217
 
189
218
  - [#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
219
  - New `OptionalOption.Regexp` to enable regex linting via `eslint-plugin-regexp`
192
220
  - Catches common regex mistakes: exponential backtracking, unnecessary escapes, and optimizable character classes
193
221
  - Uses recommended rules with selective overrides for smoother adoption
@@ -212,7 +240,6 @@
212
240
  ### Minor Changes
213
241
 
214
242
  - feat: add Nest.js, Vue, and Expo ESLint configs with optionals package
215
-
216
243
  - Added `@santi020k/eslint-config-nest` with NestJS-specific linting rules
217
244
  - Added `@santi020k/eslint-config-vue` with Vue 3 linting rules
218
245
  - 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.1.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.1.0",
27
+ "@santi020k/eslint-config-optionals": "^1.1.0",
28
+ "@santi020k/eslint-config-typescript": "^1.1.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.1.0",
32
+ "@santi020k/eslint-config-astro": "^1.1.0",
33
+ "@santi020k/eslint-config-expo": "^1.1.0",
34
+ "@santi020k/eslint-config-nest": "^1.1.0",
35
+ "@santi020k/eslint-config-next": "^1.1.0",
36
+ "@santi020k/eslint-config-react": "^1.1.0",
37
+ "@santi020k/eslint-config-solid": "^1.1.0",
38
+ "@santi020k/eslint-config-svelte": "^1.1.0",
39
+ "@santi020k/eslint-config-vue": "^1.1.0",
40
+ "@santi020k/eslint-config-qwik": "^1.1.0",
41
+ "@santi020k/eslint-config-remix": "^1.1.0"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "@santi020k/eslint-config-angular": {