@apify/oxlint-config 0.2.5 → 0.2.7

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 (3) hide show
  1. package/index.d.ts +16 -4
  2. package/index.js +8 -5
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,4 +1,15 @@
1
- import type { OxlintConfig } from 'oxlint';
1
+ import type { OxlintConfig as RawOxlintConfig } from 'oxlint';
2
+
3
+ /**
4
+ * Re-aliased {@link RawOxlintConfig} owned by this package. Structurally
5
+ * identical to oxlint's `OxlintConfig`, but living in `@apify/oxlint-config`
6
+ * means TypeScript can write a portable name when emitting inferred types
7
+ * for consumer config files (`export default defineConfig({...})`) instead
8
+ * of chasing back to oxlint via pnpm's `.pnpm/...` resolved path — which
9
+ * trips TS2883 ("inferred type cannot be named portably") in IDEs and
10
+ * `--isolatedDeclarations` builds.
11
+ */
12
+ export interface OxlintConfig extends RawOxlintConfig {}
2
13
 
3
14
  /**
4
15
  * Narrow {@link OxlintConfig} so the keys this preset always populates
@@ -19,9 +30,10 @@ export type ApifyOxlintConfig = OxlintConfig & {
19
30
  * everything else (`ignorePatterns`, `jsPlugins`, `categories`, …) is
20
31
  * passed through unchanged.
21
32
  *
22
- * Returns `OxlintConfig` (not the narrower `ApifyOxlintConfig`), which is
23
- * re-exported from oxlint, so default-exporting the result is safe under
24
- * `composite` / `--isolatedDeclarations` TypeScript projects.
33
+ * Returns this package's {@link OxlintConfig} alias rather than oxlint's
34
+ * raw type, so consumers can `export default defineConfig({...})` from a
35
+ * `composite` / `--isolatedDeclarations` TS project (or any IDE that runs
36
+ * the same checks) without TS2883.
25
37
  *
26
38
  * import { defineConfig } from '@apify/oxlint-config';
27
39
  *
package/index.js CHANGED
@@ -83,6 +83,14 @@ const sharedConfig = {
83
83
  'unicorn/no-await-in-promise-methods': 'error',
84
84
  'jest/require-to-throw-message': 'off',
85
85
  'jest/prefer-snapshot-hint': 'off',
86
+ // Jest and vitest plugins have some overlapping rules.
87
+ // Disable the Jest ones and let the Vitest plugin handle them.
88
+ 'jest/expect-expect': 'off',
89
+ 'jest/no-standalone-expect': 'off',
90
+ 'jest/valid-describe-callback': 'off',
91
+ 'jest/valid-expect': 'off',
92
+ 'jest/valid-expect-in-promise': 'off',
93
+ 'jest/valid-title': 'off',
86
94
  // Vitest plugin auto-enables most of its rules at error level. Keep
87
95
  // the few that catch real bugs and turn the noisy/opinionated/buggy
88
96
  // ones off:
@@ -156,7 +164,6 @@ const sharedConfig = {
156
164
  'jest/no-disabled-tests': 'error',
157
165
  'jest/no-conditional-expect': 'error',
158
166
  'jest/no-focused-tests': 'error',
159
- 'jest/valid-expect': 'off',
160
167
  'import/no-default-export': 'off',
161
168
  },
162
169
  },
@@ -172,10 +179,6 @@ const sharedConfig = {
172
179
  files: ['**/*.stories.{js,jsx,ts,tsx,mjs,cjs}'],
173
180
  rules: { 'no-console': 'off', 'import/no-default-export': 'off' },
174
181
  },
175
- {
176
- files: ['**/integration_tests/**'],
177
- rules: { 'jest/expect-expect': 'off' },
178
- },
179
182
  ],
180
183
  };
181
184
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/oxlint-config",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Apify oxlint preset to be shared between projects.",
5
5
  "repository": {
6
6
  "url": "https://github.com/apify/apify-oxlint-config"