@rslint/core 0.7.0 → 0.7.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.
package/dist/cli.js CHANGED
@@ -133,8 +133,7 @@ async function run(binPath, argv, startTime) {
133
133
  singleThreaded: args.singleThreaded
134
134
  },
135
135
  extraInit: {
136
- configDiscovery: {
137
- mode: usesExplicitJSConfig ? 'explicit' : args.config ? 'disabled' : 'auto',
136
+ configDiscovery: args.config && !usesExplicitJSConfig ? void 0 : {
138
137
  explicitConfigPath: usesExplicitJSConfig ? explicitConfigPath : void 0
139
138
  }
140
139
  }
package/dist/index.js CHANGED
@@ -1407,24 +1407,26 @@ class RunPathResolver {
1407
1407
  return results;
1408
1408
  }
1409
1409
  }
1410
- function _to_primitive(input, hint) {
1411
- if ("object" !== _type_of(input) || null === input) return input;
1412
- var prim = input[Symbol.toPrimitive];
1413
- if (void 0 !== prim) {
1414
- var res = prim.call(input, hint || "default");
1415
- if ("object" !== _type_of(res)) return res;
1416
- throw new TypeError("@@toPrimitive must return a primitive value.");
1417
- }
1418
- return ("string" === hint ? String : Number)(input);
1410
+ function isRecord(value) {
1411
+ return null !== value && 'object' == typeof value && !Array.isArray(value);
1419
1412
  }
1420
- function _to_property_key(arg) {
1421
- var key = _to_primitive(arg, "string");
1422
- return "symbol" === _type_of(key) ? key : String(key);
1413
+ function isPluginHostFactoryModule(value) {
1414
+ return isRecord(value) && 'function' == typeof value.createPluginLintHost;
1423
1415
  }
1424
- function _type_of(obj) {
1425
- return obj && "u" > typeof Symbol && obj.constructor === Symbol ? "symbol" : typeof obj;
1416
+ function isPluginLintHost(value) {
1417
+ return isRecord(value) && 'function' == typeof value.lint && 'function' == typeof value.shutdown;
1418
+ }
1419
+ let pluginHostFactoryPromise;
1420
+ async function loadPluginHostFactory() {
1421
+ pluginHostFactoryPromise ??= (async ()=>{
1422
+ const pluginEntry = '@rslint/core/eslint-plugin';
1423
+ const module = await import(pluginEntry);
1424
+ if (!isPluginHostFactoryModule(module)) throw new Error('rslint ESLint-plugin entry does not export createPluginLintHost');
1425
+ return module.createPluginLintHost;
1426
+ })();
1427
+ const factory = await pluginHostFactoryPromise;
1428
+ return factory;
1426
1429
  }
1427
- let _computedKey;
1428
1430
  class PluginHostLifecycle {
1429
1431
  #pendingBuilds = new Set();
1430
1432
  #staged = new Set();
@@ -1465,23 +1467,6 @@ class PluginHostLifecycle {
1465
1467
  await Promise.allSettled(shutdowns);
1466
1468
  }
1467
1469
  }
1468
- function isPluginHostFactoryModule(value) {
1469
- return isRecord(value) && 'function' == typeof value.createPluginLintHost;
1470
- }
1471
- function isPluginLintHost(value) {
1472
- return isRecord(value) && 'function' == typeof value.lint && 'function' == typeof value.shutdown;
1473
- }
1474
- let pluginHostFactoryPromise;
1475
- async function loadPluginHostFactory() {
1476
- pluginHostFactoryPromise ??= (async ()=>{
1477
- const pluginEntry = '@rslint/core/eslint-plugin';
1478
- const module = await import(pluginEntry);
1479
- if (!isPluginHostFactoryModule(module)) throw new Error('rslint ESLint-plugin entry does not export createPluginLintHost');
1480
- return module.createPluginLintHost;
1481
- })();
1482
- const factory = await pluginHostFactoryPromise;
1483
- return factory;
1484
- }
1485
1470
  async function stageNativeConfigActivation(configHost, request, getPluginHostFactory, onLog, isClosing, lifecycle) {
1486
1471
  let pluginHost = null;
1487
1472
  try {
@@ -1511,7 +1496,25 @@ async function stageNativeConfigActivation(configHost, request, getPluginHostFac
1511
1496
  throw error;
1512
1497
  }
1513
1498
  }
1514
- function isRecord(value) {
1499
+ function _to_primitive(input, hint) {
1500
+ if ("object" !== _type_of(input) || null === input) return input;
1501
+ var prim = input[Symbol.toPrimitive];
1502
+ if (void 0 !== prim) {
1503
+ var res = prim.call(input, hint || "default");
1504
+ if ("object" !== _type_of(res)) return res;
1505
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1506
+ }
1507
+ return ("string" === hint ? String : Number)(input);
1508
+ }
1509
+ function _to_property_key(arg) {
1510
+ var key = _to_primitive(arg, "string");
1511
+ return "symbol" === _type_of(key) ? key : String(key);
1512
+ }
1513
+ function _type_of(obj) {
1514
+ return obj && "u" > typeof Symbol && obj.constructor === Symbol ? "symbol" : typeof obj;
1515
+ }
1516
+ let _computedKey;
1517
+ function rslint_isRecord(value) {
1515
1518
  return null !== value && 'object' == typeof value && !Array.isArray(value);
1516
1519
  }
1517
1520
  function globPatternRole(pattern) {
@@ -1534,19 +1537,16 @@ function staticGlobRoot(pattern, cwd) {
1534
1537
  }
1535
1538
  return current || cwd;
1536
1539
  }
1537
- function compactScanDirectories(directories) {
1540
+ function deduplicateScanDirectories(directories) {
1538
1541
  const byIdentity = new Map();
1539
1542
  for (const directory of directories){
1540
1543
  const normalized = node_path.normalize(directory);
1541
1544
  const key = nativePathIdentity.key(normalized);
1542
1545
  if (!byIdentity.has(key)) byIdentity.set(key, normalized);
1543
1546
  }
1544
- const sorted = [
1547
+ return [
1545
1548
  ...byIdentity.values()
1546
- ].sort((a, b)=>a.length - b.length || nativePathIdentity.compare(a, b));
1547
- const compact = [];
1548
- for (const directory of sorted)if (!compact.some((parent)=>nativePathIdentity.isSameOrChild(parent, directory))) compact.push(directory);
1549
- return compact;
1549
+ ].sort(nativePathIdentity.compare);
1550
1550
  }
1551
1551
  function normalizeGlobPatternForCwd(pattern, cwd) {
1552
1552
  let normalized = pattern;
@@ -1610,7 +1610,7 @@ async function classifyLintPatterns(patterns, cwd) {
1610
1610
  return {
1611
1611
  literalFilePatterns,
1612
1612
  literalDirectorySymlinks,
1613
- scanDirectories: compactScanDirectories(scanDirectories)
1613
+ scanDirectories: deduplicateScanDirectories(scanDirectories)
1614
1614
  };
1615
1615
  }
1616
1616
  _computedKey = _to_property_key(Symbol.asyncDispose);
@@ -1644,7 +1644,6 @@ class Rslint {
1644
1644
  const response = await this.#service.lint({
1645
1645
  config: usesNativeDiscovery ? void 0 : overrideConfig,
1646
1646
  configDiscovery: usesNativeDiscovery ? {
1647
- mode: 'string' == typeof this.#overrideConfigFile ? 'explicit' : 'auto',
1648
1647
  explicitConfigPath: 'string' == typeof this.#overrideConfigFile ? node_path.resolve(this.#cwd, this.#overrideConfigFile) : void 0,
1649
1648
  explicitFiles: [
1650
1649
  true
@@ -1744,7 +1743,6 @@ class Rslint {
1744
1743
  const response = await this.#service.lint({
1745
1744
  config: usesNativeDiscovery ? void 0 : overrideConfig,
1746
1745
  configDiscovery: usesNativeDiscovery ? {
1747
- mode: 'string' == typeof this.#overrideConfigFile ? 'explicit' : 'auto',
1748
1746
  explicitConfigPath: 'string' == typeof this.#overrideConfigFile ? node_path.resolve(this.#cwd, this.#overrideConfigFile) : void 0,
1749
1747
  directories: scanDirectories,
1750
1748
  explicitFiles: selectedFiles.map((file)=>file.explicit),
@@ -1840,7 +1838,7 @@ class Rslint {
1840
1838
  ];
1841
1839
  for (const [index, entry] of override.entries()){
1842
1840
  if (null == entry || 'object' != typeof entry || Array.isArray(entry)) continue;
1843
- const plugins = isRecord(entry) ? entry.plugins : void 0;
1841
+ const plugins = rslint_isRecord(entry) ? entry.plugins : void 0;
1844
1842
  if (null !== plugins && 'object' == typeof plugins && !Array.isArray(plugins)) throw new Error(`[rslint] overrideConfig entry at index ${index} uses object-form "plugins". Community ESLint plugins in overrideConfig are not supported because the plugin worker cannot re-import an in-memory plugin object. Move the plugin declaration to rslint.config.js (or .mjs/.cjs/.ts/.mts/.cts), or use array-form built-in plugins.`);
1845
1843
  }
1846
1844
  this.#normalizedOverrideConfig = normalizeConfig(override);
@@ -43,7 +43,6 @@ export declare interface LintOptions {
43
43
  * backends intentionally do not advertise this host-filesystem capability.
44
44
  */
45
45
  configDiscovery?: {
46
- mode: 'auto' | 'explicit';
47
46
  explicitConfigPath?: string;
48
47
  /** Static glob roots; Go visits only branches leading to the supplied files. */
49
48
  directories?: string[];
package/dist/service.d.ts CHANGED
@@ -149,7 +149,6 @@ export declare interface LintOptions {
149
149
  * backends intentionally do not advertise this host-filesystem capability.
150
150
  */
151
151
  configDiscovery?: {
152
- mode: 'auto' | 'explicit';
153
152
  explicitConfigPath?: string;
154
153
  /** Static glob roots; Go visits only branches leading to the supplied files. */
155
154
  directories?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rslint/core",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "exports": {
5
5
  ".": {
6
6
  "@typescript/source": "./src/index.ts",
@@ -64,7 +64,7 @@
64
64
  "globals": "17.7.0",
65
65
  "tinyglobby": "0.2.15",
66
66
  "typescript": "5.9.3",
67
- "@rslint/api": "0.7.0"
67
+ "@rslint/api": "0.7.1"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "jiti": "^2.0.0"
@@ -75,14 +75,14 @@
75
75
  }
76
76
  },
77
77
  "optionalDependencies": {
78
- "@rslint/native-linux-arm64-gnu": "0.7.0",
79
- "@rslint/native-darwin-arm64": "0.7.0",
80
- "@rslint/native-darwin-x64": "0.7.0",
81
- "@rslint/native-linux-x64-gnu": "0.7.0",
82
- "@rslint/native-linux-arm64-musl": "0.7.0",
83
- "@rslint/native-win32-arm64-msvc": "0.7.0",
84
- "@rslint/native-win32-x64-msvc": "0.7.0",
85
- "@rslint/native-linux-x64-musl": "0.7.0"
78
+ "@rslint/native-darwin-x64": "0.7.1",
79
+ "@rslint/native-linux-arm64-gnu": "0.7.1",
80
+ "@rslint/native-linux-x64-gnu": "0.7.1",
81
+ "@rslint/native-darwin-arm64": "0.7.1",
82
+ "@rslint/native-win32-arm64-msvc": "0.7.1",
83
+ "@rslint/native-linux-x64-musl": "0.7.1",
84
+ "@rslint/native-linux-arm64-musl": "0.7.1",
85
+ "@rslint/native-win32-x64-msvc": "0.7.1"
86
86
  },
87
87
  "dependencies": {
88
88
  "picomatch": "4.0.4"