Skip to content

Commit

Permalink
feat: add config name for better debug
Browse files Browse the repository at this point in the history
  • Loading branch information
BBboy01 committed Aug 16, 2024
1 parent 2939d63 commit 6ae293b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ const allRules: Record<string, string> = Object.assign(
export default {
configs: {
recommended: {
name: 'oxlint ignore rules recommended',
plugins: ['oxlint'],
rules: ruleMapsByCategory.correctnessRules,
},
all: {
name: 'oxlint ignore rules all',
plugins: ['oxlint'],
rules: allRules,
},
'flat/all': {
name: 'oxlint ignore rules all',
rules: allRules,
},
'flat/recommended': {
name: 'oxlint ignore rules recommended',
rules: ruleMapsByCategory.correctnessRules,
},
...createFlatRulesConfig(ruleMapsByScope),
Expand Down
8 changes: 6 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ export function createFlatRulesConfig(rulesModule: { [key: string]: unknown }) {
for (const key of Object.keys(rulesModule)) {
if (key.endsWith('Rules')) {
// Ensure the property is a rules set
const flatKey = `flat/${kebabCase(key.replace('Rules', ''))}`; // Create the new key
flatRulesConfig[flatKey] = { rules: rulesModule[key] }; // Assign the rules to the new key
const ruleName = kebabCase(key.replace('Rules', ''));
const flatKey = `flat/${ruleName}`; // Create the new key
flatRulesConfig[flatKey] = {
name: `oxlint/${ruleName}`,
rules: rulesModule[key],
}; // Assign the rules to the new key
}
}

Expand Down

0 comments on commit 6ae293b

Please sign in to comment.