-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
808ea2e
commit c088c39
Showing
9 changed files
with
108 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use strict'; | ||
const defaultGroups = require('../config/groups').groups; | ||
|
||
function getOption(context, name) { | ||
// Options (defined at rule level) | ||
const options = context.options[0] || {}; | ||
if (options[name] != undefined) { | ||
return options[name]; | ||
} | ||
// Settings (defined at plugin level, shared accross rules) | ||
if (context.settings && context.settings.tailwindcss && context.settings.tailwindcss[name] != undefined) { | ||
return context.settings.tailwindcss[name]; | ||
} | ||
// Fallback to defaults | ||
switch (name) { | ||
case 'callees': | ||
return ['classnames', 'clsx', 'ctl']; | ||
case 'config': | ||
return 'tailwind.config.js'; | ||
case 'groups': | ||
return defaultGroups; | ||
case 'prependCustom': | ||
return false; | ||
case 'removeDuplicates': | ||
return true; | ||
case 'whitelist': | ||
return []; | ||
} | ||
} | ||
|
||
module.exports = getOption; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters