@gv-tech/eslint-config 0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Eric Garcia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # @gv-tech/eslint-config
2
+
3
+ Shareable ESLint configuration for Garcia Ventures projects. Uses **ESLint v9** flat config format (forward-compatible with v10).
4
+
5
+ ## Features
6
+
7
+ - 🚀 **ESLint v9+ Flat Config** - Modern configuration format
8
+ - 📦 **Modular** - Use only what you need
9
+ - 🔷 **TypeScript** - First-class TypeScript support via typescript-eslint v8
10
+ - ⚛️ **Next.js** - Next.js 15+ with Core Web Vitals
11
+ - 💅 **Prettier** - Integrated formatting as ESLint rules
12
+
13
+ ## Requirements
14
+
15
+ - Node.js >= 20.19.0
16
+ - ESLint >= 9.0.0
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ npm install --save-dev @gv-tech/eslint-config eslint
22
+ ```
23
+
24
+ ### With TypeScript
25
+
26
+ ```bash
27
+ npm install --save-dev @gv-tech/eslint-config eslint typescript-eslint typescript
28
+ ```
29
+
30
+ ### With Next.js
31
+
32
+ ```bash
33
+ npm install --save-dev @gv-tech/eslint-config eslint typescript-eslint typescript @next/eslint-plugin-next
34
+ ```
35
+
36
+ ### With Prettier
37
+
38
+ ```bash
39
+ npm install --save-dev @gv-tech/eslint-config eslint eslint-plugin-prettier eslint-config-prettier @eng618/prettier-config
40
+ ```
41
+
42
+ > **Note:** Add `"prettier": "@eng618/prettier-config"` to your `package.json` to use the shared Prettier config.
43
+
44
+ ## Usage
45
+
46
+ Create an `eslint.config.mjs` file in your project root:
47
+
48
+ ### Basic JavaScript
49
+
50
+ ```js
51
+ import { base } from '@gv-tech/eslint-config';
52
+
53
+ export default [...base];
54
+ ```
55
+
56
+ ### TypeScript Project
57
+
58
+ ```js
59
+ import { typescript, prettier } from '@gv-tech/eslint-config';
60
+
61
+ export default [...typescript, ...prettier];
62
+ ```
63
+
64
+ ### Next.js Project
65
+
66
+ ```js
67
+ import { next, prettier } from '@gv-tech/eslint-config';
68
+
69
+ export default [...next, ...prettier];
70
+ ```
71
+
72
+ ### Using Presets
73
+
74
+ For convenience, pre-combined presets are available:
75
+
76
+ ```js
77
+ // TypeScript + Prettier (recommended)
78
+ import { recommended } from '@gv-tech/eslint-config';
79
+ export default [...recommended];
80
+
81
+ // Next.js + TypeScript + Prettier
82
+ import { nextjs } from '@gv-tech/eslint-config';
83
+ export default [...nextjs];
84
+ ```
85
+
86
+ ### Custom Configuration
87
+
88
+ Extend and customize as needed:
89
+
90
+ ```js
91
+ import { typescript, prettier } from '@gv-tech/eslint-config';
92
+
93
+ export default [
94
+ ...typescript,
95
+ ...prettier,
96
+ {
97
+ // Add project-specific ignores
98
+ ignores: ['custom-folder/**'],
99
+ },
100
+ {
101
+ // Override rules
102
+ files: ['**/*.ts'],
103
+ rules: {
104
+ '@typescript-eslint/no-unused-vars': 'warn',
105
+ },
106
+ },
107
+ ];
108
+ ```
109
+
110
+ ## Available Configurations
111
+
112
+ | Export | Description |
113
+ |--------|-------------|
114
+ | `base` | Core JavaScript rules |
115
+ | `typescript` | TypeScript support (includes base) |
116
+ | `next` | Next.js 16+ (includes TypeScript) |
117
+ | `prettier` | Prettier formatting integration |
118
+ | `recommended` | TypeScript + Prettier |
119
+ | `nextjs` | Next.js + Prettier |
120
+
121
+ ## Exported Utilities
122
+
123
+ | Export | Description |
124
+ |--------|-------------|
125
+ | `jsFiles` | JavaScript file patterns |
126
+ | `tsFiles` | TypeScript file patterns |
127
+ | `allJsTsFiles` | All JS/TS file patterns |
128
+ | `commonIgnores` | Common ignore patterns |
129
+ | `nextIgnores` | Next.js-specific ignores |
130
+
131
+ ## License
132
+
133
+ MIT
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "@gv-tech/eslint-config",
3
+ "version": "0.1.0",
4
+ "description": "Shareable ESLint configuration for Garcia Ventures projects - ESLint v9 flat config",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": "./src/index.mjs",
8
+ "./base": "./src/base.mjs",
9
+ "./typescript": "./src/typescript.mjs",
10
+ "./next": "./src/next.mjs",
11
+ "./prettier": "./src/prettier.mjs"
12
+ },
13
+ "files": [
14
+ "src"
15
+ ],
16
+ "keywords": [
17
+ "eslint",
18
+ "eslintconfig",
19
+ "eslint-config",
20
+ "flat-config",
21
+ "eslint-v10",
22
+ "typescript",
23
+ "nextjs",
24
+ "prettier"
25
+ ],
26
+ "author": "Eric N. Garcia <eng618@garciaericn.com>",
27
+ "license": "MIT",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/Garcia-Ventures/eslint-config.git"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/Garcia-Ventures/eslint-config/issues"
34
+ },
35
+ "homepage": "https://github.com/Garcia-Ventures/eslint-config#readme",
36
+ "engines": {
37
+ "node": ">=20.19.0"
38
+ },
39
+ "peerDependencies": {
40
+ "@eng618/prettier-config": "^1.0.0",
41
+ "@eslint/js": "^9.0.0",
42
+ "@next/eslint-plugin-next": "^15.0.0 || ^16.0.0",
43
+ "eslint": "^9.0.0",
44
+ "eslint-config-prettier": "^9.0.0 || ^10.0.0",
45
+ "eslint-plugin-prettier": "^5.0.0",
46
+ "globals": "^15.0.0 || ^16.0.0",
47
+ "typescript": ">=5.0.0",
48
+ "typescript-eslint": "^8.0.0"
49
+ },
50
+ "peerDependenciesMeta": {
51
+ "typescript-eslint": {
52
+ "optional": true
53
+ },
54
+ "typescript": {
55
+ "optional": true
56
+ },
57
+ "@next/eslint-plugin-next": {
58
+ "optional": true
59
+ },
60
+ "eslint-plugin-prettier": {
61
+ "optional": true
62
+ },
63
+ "eslint-config-prettier": {
64
+ "optional": true
65
+ },
66
+ "@eng618/prettier-config": {
67
+ "optional": true
68
+ }
69
+ },
70
+ "devDependencies": {
71
+ "@eng618/prettier-config": "^1.8.0",
72
+ "@eslint/js": "^9.0.0",
73
+ "@next/eslint-plugin-next": "^15.0.0",
74
+ "eslint": "^9.0.0",
75
+ "eslint-config-prettier": "^9.0.0",
76
+ "eslint-plugin-prettier": "^5.0.0",
77
+ "globals": "^15.0.0",
78
+ "typescript": "^5.7.0",
79
+ "typescript-eslint": "^8.0.0"
80
+ },
81
+ "prettier": "@eng618/prettier-config"
82
+ }
package/src/base.mjs ADDED
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @gv-tech/eslint-config - Base Configuration
3
+ *
4
+ * Core ESLint configuration with recommended JavaScript rules.
5
+ * Uses ESLint v10 flat config format.
6
+ */
7
+
8
+ import js from '@eslint/js';
9
+ import globals from 'globals';
10
+
11
+ /** File patterns for JavaScript files */
12
+ export const jsFiles = ['**/*.js', '**/*.jsx', '**/*.mjs', '**/*.cjs'];
13
+
14
+ /** Common ignore patterns */
15
+ export const commonIgnores = [
16
+ '**/node_modules/**',
17
+ '**/dist/**',
18
+ '**/build/**',
19
+ '**/coverage/**',
20
+ '**/.git/**',
21
+ ];
22
+
23
+ /**
24
+ * Base ESLint configuration for JavaScript projects.
25
+ *
26
+ * @example
27
+ * ```js
28
+ * // eslint.config.mjs
29
+ * import { base } from '@gv-tech/eslint-config';
30
+ *
31
+ * export default [...base];
32
+ * ```
33
+ */
34
+ export const base = [
35
+ // Global ignores
36
+ {
37
+ ignores: commonIgnores,
38
+ },
39
+ // Base configuration for all JS files
40
+ {
41
+ files: jsFiles,
42
+ ...js.configs.recommended,
43
+ languageOptions: {
44
+ ecmaVersion: 'latest',
45
+ sourceType: 'module',
46
+ globals: {
47
+ ...globals.node,
48
+ ...globals.browser,
49
+ },
50
+ },
51
+ linterOptions: {
52
+ reportUnusedDisableDirectives: 'error',
53
+ },
54
+ },
55
+ ];
56
+
57
+ export default base;
package/src/index.mjs ADDED
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @gv-tech/eslint-config
3
+ *
4
+ * Shareable ESLint configuration for Garcia Ventures projects.
5
+ * Supports ESLint v9+ flat config format.
6
+ *
7
+ * @example Basic JavaScript
8
+ * ```js
9
+ * import { base } from '@gv-tech/eslint-config';
10
+ * export default [...base];
11
+ * ```
12
+ *
13
+ * @example TypeScript
14
+ * ```js
15
+ * import { typescript, prettier } from '@gv-tech/eslint-config';
16
+ * export default [...typescript, ...prettier];
17
+ * ```
18
+ *
19
+ * @example Next.js
20
+ * ```js
21
+ * import { next, prettier } from '@gv-tech/eslint-config';
22
+ * export default [...next, ...prettier];
23
+ * ```
24
+ */
25
+
26
+ // Import for creating combined presets
27
+ import { base, jsFiles, commonIgnores } from './base.mjs';
28
+ import { typescript, tsFiles, allJsTsFiles } from './typescript.mjs';
29
+ import { next, nextIgnores } from './next.mjs';
30
+ import { prettier } from './prettier.mjs';
31
+
32
+ // Re-export individual configurations
33
+ export { base, jsFiles, commonIgnores };
34
+ export { typescript, tsFiles, allJsTsFiles };
35
+ export { next, nextIgnores };
36
+ export { prettier };
37
+
38
+ /**
39
+ * Recommended configuration for TypeScript projects with Prettier.
40
+ * Combines TypeScript and Prettier configurations.
41
+ */
42
+ export const recommended = [...typescript, ...prettier];
43
+
44
+ /**
45
+ * Recommended configuration for Next.js projects with Prettier.
46
+ * Combines Next.js (which includes TypeScript) and Prettier configurations.
47
+ */
48
+ export const nextjs = [...next, ...prettier];
49
+
50
+ /**
51
+ * Base configuration preset for simple JavaScript projects.
52
+ */
53
+ export const javascript = [...base];
54
+
55
+ // Default export is the recommended TypeScript + Prettier config
56
+ export default recommended;
package/src/next.mjs ADDED
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @gv-tech/eslint-config - Next.js Configuration
3
+ *
4
+ * Next.js 15+ ESLint configuration with Core Web Vitals.
5
+ * Uses ESLint v9 flat config format.
6
+ */
7
+
8
+ import nextPlugin from '@next/eslint-plugin-next';
9
+ import { typescript, allJsTsFiles } from './typescript.mjs';
10
+ import { commonIgnores } from './base.mjs';
11
+
12
+ /** Next.js specific ignore patterns */
13
+ export const nextIgnores = [
14
+ ...commonIgnores,
15
+ '.next/**',
16
+ 'out/**',
17
+ 'next-env.d.ts',
18
+ ];
19
+
20
+ /**
21
+ * Next.js ESLint configuration.
22
+ * Extends TypeScript configuration and adds Next.js-specific rules.
23
+ *
24
+ * @example
25
+ * ```js
26
+ * // eslint.config.mjs
27
+ * import { next } from '@gv-tech/eslint-config';
28
+ *
29
+ * export default [...next];
30
+ * ```
31
+ */
32
+ export const next = [
33
+ // Global ignores including Next.js specific
34
+ {
35
+ ignores: nextIgnores,
36
+ },
37
+ // Extend TypeScript config
38
+ ...typescript.filter((config) => !config.ignores),
39
+ // Next.js plugin configuration
40
+ {
41
+ files: allJsTsFiles,
42
+ plugins: {
43
+ '@next/next': nextPlugin,
44
+ },
45
+ rules: {
46
+ // Core Web Vitals rules
47
+ ...nextPlugin.configs.recommended.rules,
48
+ ...nextPlugin.configs['core-web-vitals'].rules,
49
+ },
50
+ },
51
+ ];
52
+
53
+ export default next;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @gv-tech/eslint-config - Prettier Configuration
3
+ *
4
+ * Prettier integration for ESLint - runs Prettier as an ESLint rule.
5
+ * Uses @eng618/prettier-config for consistent formatting.
6
+ * Uses ESLint v9 flat config format.
7
+ */
8
+
9
+ import prettierPlugin from 'eslint-plugin-prettier';
10
+ import prettierConfig from 'eslint-config-prettier';
11
+ import { allJsTsFiles } from './typescript.mjs';
12
+
13
+ /**
14
+ * Prettier ESLint configuration.
15
+ * Disables formatting rules that conflict with Prettier and runs Prettier as an ESLint rule.
16
+ * Uses @eng618/prettier-config for Prettier options.
17
+ *
18
+ * @example
19
+ * ```js
20
+ * // eslint.config.mjs
21
+ * import { typescript, prettier } from '@gv-tech/eslint-config';
22
+ *
23
+ * export default [...typescript, ...prettier];
24
+ * ```
25
+ */
26
+ export const prettier = [
27
+ // Disable ESLint rules that conflict with Prettier
28
+ prettierConfig,
29
+ // Run Prettier as an ESLint rule with @eng618/prettier-config
30
+ {
31
+ files: allJsTsFiles,
32
+ plugins: {
33
+ prettier: prettierPlugin,
34
+ },
35
+ rules: {
36
+ 'prettier/prettier': [
37
+ 'error',
38
+ {},
39
+ {
40
+ usePrettierrc: true, // Will find @eng618/prettier-config via package.json or .prettierrc
41
+ },
42
+ ],
43
+ },
44
+ },
45
+ ];
46
+
47
+ export default prettier;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @gv-tech/eslint-config - TypeScript Configuration
3
+ *
4
+ * TypeScript-specific ESLint configuration using typescript-eslint v8.
5
+ * Uses ESLint v9 flat config format.
6
+ */
7
+
8
+ import tseslint from 'typescript-eslint';
9
+ import { base, jsFiles, commonIgnores } from './base.mjs';
10
+
11
+ /** File patterns for TypeScript files */
12
+ export const tsFiles = ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'];
13
+
14
+ /** All JavaScript and TypeScript file patterns */
15
+ export const allJsTsFiles = [...jsFiles, ...tsFiles];
16
+
17
+ /**
18
+ * TypeScript ESLint configuration.
19
+ * Extends base configuration and adds TypeScript-specific rules.
20
+ *
21
+ * @example
22
+ * ```js
23
+ * // eslint.config.mjs
24
+ * import { typescript } from '@gv-tech/eslint-config';
25
+ *
26
+ * export default [...typescript];
27
+ * ```
28
+ */
29
+ export const typescript = [
30
+ // Global ignores
31
+ {
32
+ ignores: commonIgnores,
33
+ },
34
+ // Extend base JS config
35
+ ...base.filter((config) => !config.ignores),
36
+ // TypeScript configuration
37
+ ...tseslint.configs.recommended.map((config) => ({
38
+ ...config,
39
+ files: tsFiles,
40
+ })),
41
+ // Ensure JS files still get base rules
42
+ {
43
+ files: jsFiles,
44
+ rules: {
45
+ // Any JS-specific overrides if needed
46
+ },
47
+ },
48
+ ];
49
+
50
+ export default typescript;