@isentinel/eslint-config 5.0.0-beta.5 → 5.0.0-beta.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 (2) hide show
  1. package/dist/index.mjs +11 -6
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -242,7 +242,8 @@ async function resolveOxfmtConfigOptions() {
242
242
  const configPath = path.resolve(process.cwd(), filename);
243
243
  try {
244
244
  const content = await fs.promises.readFile(configPath, "utf-8");
245
- return JSON.parse(content);
245
+ const { $schema: _, ...config } = JSON.parse(content);
246
+ return config;
246
247
  } catch {
247
248
  continue;
248
249
  }
@@ -255,11 +256,12 @@ async function resolveOxfmtConfigOptions() {
255
256
  *
256
257
  * @param rules - The rules object to override.
257
258
  * @param severity - The target severity level.
259
+ * @param excludeRules - Rules to exclude from the severity override.
258
260
  * @returns A new rules object with overridden severities.
259
261
  */
260
- function overrideRuleSeverity(rules, severity) {
262
+ function overrideRuleSeverity(rules, severity, excludeRules = /* @__PURE__ */ new Set()) {
261
263
  return Object.fromEntries(Object.entries(rules).map(([key, value]) => {
262
- if (value === "off" || value === 0) return [key, value];
264
+ if (value === "off" || value === 0 || excludeRules.has(key)) return [key, value];
263
265
  if (Array.isArray(value)) {
264
266
  const [currentSeverity, ...options] = value;
265
267
  if (currentSeverity === "off" || currentSeverity === 0) return [key, value];
@@ -1883,9 +1885,12 @@ async function isentinel(options, ...userConfigs) {
1883
1885
  return (await import("eslint/use-at-your-own-risk")).builtinRules;
1884
1886
  } });
1885
1887
  }
1886
- if (defaultSeverity) composer = composer.onResolved((item) => {
1887
- for (const config of item) if (config.rules) config.rules = overrideRuleSeverity(config.rules, defaultSeverity);
1888
- });
1888
+ if (defaultSeverity) {
1889
+ const severityExcludeRules = new Set(["sonar/todo-tag"]);
1890
+ composer = composer.onResolved((item) => {
1891
+ for (const config of item) if (config.rules) config.rules = overrideRuleSeverity(config.rules, defaultSeverity, severityExcludeRules);
1892
+ });
1893
+ }
1889
1894
  return composer;
1890
1895
  }
1891
1896
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isentinel/eslint-config",
3
- "version": "5.0.0-beta.5",
3
+ "version": "5.0.0-beta.7",
4
4
  "description": "iSentinel's ESLint config",
5
5
  "keywords": [
6
6
  "eslint-config",
@@ -131,7 +131,7 @@
131
131
  "type-fest": "5.4.4",
132
132
  "typescript": "5.9.3",
133
133
  "unplugin-unused": "0.5.7",
134
- "@isentinel/eslint-config": "5.0.0-beta.5"
134
+ "@isentinel/eslint-config": "5.0.0-beta.7"
135
135
  },
136
136
  "peerDependencies": {
137
137
  "@vitest/eslint-plugin": "^1.6.4",