@isentinel/eslint-config 5.0.0-beta.6 → 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 +9 -5
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -256,11 +256,12 @@ async function resolveOxfmtConfigOptions() {
256
256
  *
257
257
  * @param rules - The rules object to override.
258
258
  * @param severity - The target severity level.
259
+ * @param excludeRules - Rules to exclude from the severity override.
259
260
  * @returns A new rules object with overridden severities.
260
261
  */
261
- function overrideRuleSeverity(rules, severity) {
262
+ function overrideRuleSeverity(rules, severity, excludeRules = /* @__PURE__ */ new Set()) {
262
263
  return Object.fromEntries(Object.entries(rules).map(([key, value]) => {
263
- if (value === "off" || value === 0) return [key, value];
264
+ if (value === "off" || value === 0 || excludeRules.has(key)) return [key, value];
264
265
  if (Array.isArray(value)) {
265
266
  const [currentSeverity, ...options] = value;
266
267
  if (currentSeverity === "off" || currentSeverity === 0) return [key, value];
@@ -1884,9 +1885,12 @@ async function isentinel(options, ...userConfigs) {
1884
1885
  return (await import("eslint/use-at-your-own-risk")).builtinRules;
1885
1886
  } });
1886
1887
  }
1887
- if (defaultSeverity) composer = composer.onResolved((item) => {
1888
- for (const config of item) if (config.rules) config.rules = overrideRuleSeverity(config.rules, defaultSeverity);
1889
- });
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
+ }
1890
1894
  return composer;
1891
1895
  }
1892
1896
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isentinel/eslint-config",
3
- "version": "5.0.0-beta.6",
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.6"
134
+ "@isentinel/eslint-config": "5.0.0-beta.7"
135
135
  },
136
136
  "peerDependencies": {
137
137
  "@vitest/eslint-plugin": "^1.6.4",