@tsslint/config 3.0.2 → 3.0.3

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/lib/eslint.d.ts CHANGED
@@ -11,4 +11,4 @@ import { type RuleSeverity } from './utils.js';
11
11
  */
12
12
  export declare function importESLintRules(config: {
13
13
  [K in keyof ESLintRulesConfig]: RuleSeverity | [RuleSeverity, ...ESLintRulesConfig[K]];
14
- }, context?: Partial<ESLint.Rule.RuleContext>): Promise<TSSLint.Rules>;
14
+ }, context?: Partial<ESLint.Rule.RuleContext>, getConvertRule?: () => Promise<typeof import("@tsslint/compat-eslint").convertRule>): Promise<TSSLint.Rules>;
package/lib/eslint.js CHANGED
@@ -28,14 +28,15 @@ const loader = async (moduleName) => {
28
28
  *
29
29
  * Please run `npx tsslint-docgen` to update them.
30
30
  */
31
- async function importESLintRules(config, context = {}) {
32
- let convertRule;
31
+ async function importESLintRules(config, context = {}, getConvertRule = async () => {
33
32
  try {
34
- ({ convertRule } = await import('@tsslint/compat-eslint'));
33
+ return (await import('@tsslint/compat-eslint')).convertRule;
35
34
  }
36
35
  catch {
37
36
  throw new Error('Please install @tsslint/compat-eslint to use importESLintRules().');
38
37
  }
38
+ }) {
39
+ const convertRule = await getConvertRule();
39
40
  const rules = {};
40
41
  for (const [rule, severityOrOptions] of Object.entries(config)) {
41
42
  let severity;
package/lib/tsl.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { Rule } from '@tsslint/config';
1
+ import type { Rule } from '@tsslint/types';
2
2
  import type * as TSL from 'tsl' with { 'resolution-mode': 'import' };
3
3
  export declare function fromTSLRules(tslRules: TSL.Rule<unknown>[]): Record<string, Rule>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsslint/config",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": ">=22.6.0"
@@ -18,7 +18,7 @@
18
18
  "directory": "packages/config"
19
19
  },
20
20
  "dependencies": {
21
- "@tsslint/types": "3.0.2",
21
+ "@tsslint/types": "3.0.3",
22
22
  "minimatch": "^10.0.1",
23
23
  "ts-api-utils": "^2.0.0"
24
24
  },
@@ -38,5 +38,5 @@
38
38
  "optional": true
39
39
  }
40
40
  },
41
- "gitHead": "89dbc73b57c9563dc287b4fd95df6c894bc2ed38"
41
+ "gitHead": "0f465c4bd0705530fb6edb1ce1c287e2461cb388"
42
42
  }