@vortiquo/eslint-config 1.2.1-beta.1 → 1.2.1

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.
@@ -1,37 +1,18 @@
1
1
  import tseslint from 'typescript-eslint';
2
2
  import { base } from './base.js';
3
3
 
4
- /**
5
- * TypeScript file patterns - type-aware rules only apply to these
6
- */
7
- const TS_FILES = ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'];
8
-
9
4
  /**
10
5
  * Base TypeScript ESLint configuration.
11
6
  * Extends base config with TypeScript-specific rules.
12
7
  *
13
- * Type-aware rules are ONLY applied to TypeScript files (.ts, .tsx, .mts, .cts).
14
- * JavaScript files (including config files like eslint.config.js) are not affected.
15
- *
16
8
  * @type {import("eslint").Linter.Config[]}
17
9
  */
18
10
  export const baseTypescript = [
19
11
  ...base,
20
-
21
- // Apply type-checked configs ONLY to TypeScript files
22
- ...tseslint.configs.strictTypeChecked.map((config) => ({
23
- ...config,
24
- files: TS_FILES,
25
- })),
26
- ...tseslint.configs.stylisticTypeChecked.map((config) => ({
27
- ...config,
28
- files: TS_FILES,
29
- })),
30
-
31
- // TypeScript-specific settings and rules (only for TS files)
12
+ ...tseslint.configs.strictTypeChecked,
13
+ ...tseslint.configs.stylisticTypeChecked,
32
14
  {
33
15
  name: 'vortiquo/typescript',
34
- files: TS_FILES,
35
16
  languageOptions: {
36
17
  parserOptions: {
37
18
  projectService: true,
@@ -118,13 +99,41 @@ export const baseTypescript = [
118
99
  ],
119
100
  },
120
101
  },
121
-
122
- // Allow relative imports in config files (only applies to TS files since
123
- // no-restricted-imports is only defined in base-typescript)
102
+ // Disable type-aware linting for config files (typically not in tsconfig)
124
103
  {
104
+ // Spread disableTypeChecked FIRST, then override with our settings
105
+ ...tseslint.configs.disableTypeChecked,
125
106
  name: 'vortiquo/typescript/config-files',
126
- files: ['**/*.config.ts', '**/*.config.mts', '**/*.config.cts'],
107
+ files: [
108
+ '**/*.config.{js,ts,mjs,cjs}',
109
+ '**/.*rc.{js,ts,mjs,cjs}',
110
+ 'eslint.config.*',
111
+ '.lintstagedrc.*',
112
+ 'tsup.config.*',
113
+ 'vitest.config.*',
114
+ 'jest.config.*',
115
+ 'tailwind.config.*',
116
+ 'postcss.config.*',
117
+ 'next.config.*',
118
+ 'commitlint.config.*',
119
+ 'prettier.config.*',
120
+ ],
121
+ languageOptions: {
122
+ parserOptions: {
123
+ projectService: false,
124
+ },
125
+ },
127
126
  rules: {
127
+ // Spread the disableTypeChecked rules first, then add our overrides
128
+ ...tseslint.configs.disableTypeChecked.rules,
129
+ // Relax strictness for config files
130
+ '@typescript-eslint/explicit-function-return-type': 'off',
131
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
132
+ // Config files require default exports
133
+ 'import/no-default-export': 'off',
134
+ // Allow console in config files
135
+ 'no-console': 'off',
136
+ // Allow relative imports in config files (they often need it)
128
137
  'no-restricted-imports': 'off',
129
138
  },
130
139
  },
package/base.js CHANGED
@@ -69,22 +69,6 @@ export const base = [
69
69
  '**/public/**',
70
70
  ],
71
71
  },
72
- // Relaxations for config files
73
- {
74
- name: 'vortiquo/base/config-files',
75
- files: [
76
- '**/*.config.{js,ts,mjs,cjs}',
77
- '**/.*rc.{js,ts,mjs,cjs}',
78
- 'eslint.config.*',
79
- '.lintstagedrc.*',
80
- ],
81
- rules: {
82
- // Config files require default exports
83
- 'import/no-default-export': 'off',
84
- // Allow console in config files
85
- 'no-console': 'off',
86
- },
87
- },
88
72
  ];
89
73
 
90
74
  export default base;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vortiquo/eslint-config",
3
- "version": "1.2.1-beta.1",
3
+ "version": "1.2.1",
4
4
  "description": "Modern ESLint v9 flat configurations with TypeScript, React, Next.js, and Node.js support",
5
5
  "type": "module",
6
6
  "license": "MIT",