From 522787ac416b8f14310150a4884b8d034d1c7206 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Tue, 11 May 2021 14:25:34 -0400 Subject: [PATCH] Revert fix lint errors?! --- src/jit/lib/setupContext.js | 8 ++++++-- src/lib/substituteClassApplyAtRules.js | 7 +++++-- src/plugins/fontVariantNumeric.js | 19 +++++++++---------- tests/processPlugins.test.js | 7 +++---- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/jit/lib/setupContext.js b/src/jit/lib/setupContext.js index 13338e21c934..f941558ae232 100644 --- a/src/jit/lib/setupContext.js +++ b/src/jit/lib/setupContext.js @@ -689,8 +689,12 @@ export default function setupContext(configOrPath) { }) let sourcePath = result.opts.from - let [tailwindConfig, userConfigPath, tailwindConfigHash, configDependencies] = - getTailwindConfig(configOrPath) + let [ + tailwindConfig, + userConfigPath, + tailwindConfigHash, + configDependencies, + ] = getTailwindConfig(configOrPath) let isConfigFile = userConfigPath !== null let contextDependencies = new Set( diff --git a/src/lib/substituteClassApplyAtRules.js b/src/lib/substituteClassApplyAtRules.js index 0708c7aee40f..7493da1c8dc4 100644 --- a/src/lib/substituteClassApplyAtRules.js +++ b/src/lib/substituteClassApplyAtRules.js @@ -281,8 +281,11 @@ function processApplyAtRules(css, lookupTree, config) { const nearestParentRule = findParent(applyRule, (r) => r.type === 'rule') const currentUtilityNames = extractUtilityNames(nearestParentRule.selector) - const [importantEntries, applyUtilityNames, important = importantEntries.length > 0] = - _.partition(applyRule.params.split(/[\s\t\n]+/g), (n) => n === '!important') + const [ + importantEntries, + applyUtilityNames, + important = importantEntries.length > 0, + ] = _.partition(applyRule.params.split(/[\s\t\n]+/g), (n) => n === '!important') if (_.intersection(applyUtilityNames, currentUtilityNames).length > 0) { const currentUtilityName = _.intersection(applyUtilityNames, currentUtilityNames)[0] diff --git a/src/plugins/fontVariantNumeric.js b/src/plugins/fontVariantNumeric.js index 75f7e2c7974d..726225f405f5 100644 --- a/src/plugins/fontVariantNumeric.js +++ b/src/plugins/fontVariantNumeric.js @@ -2,16 +2,15 @@ export default function () { return function ({ addUtilities, variants }) { addUtilities( { - '.ordinal, .slashed-zero, .lining-nums, .oldstyle-nums, .proportional-nums, .tabular-nums, .diagonal-fractions, .stacked-fractions': - { - '--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)', - 'font-variant-numeric': - 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)', - }, + '.ordinal, .slashed-zero, .lining-nums, .oldstyle-nums, .proportional-nums, .tabular-nums, .diagonal-fractions, .stacked-fractions': { + '--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)', + 'font-variant-numeric': + 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)', + }, '.normal-nums': { 'font-variant-numeric': 'normal', }, diff --git a/tests/processPlugins.test.js b/tests/processPlugins.test.js index 9bdb602241ce..9896c06a1fc1 100644 --- a/tests/processPlugins.test.js +++ b/tests/processPlugins.test.js @@ -1768,10 +1768,9 @@ test('plugins with extra options can be created using the `createPlugin.withOpti test('plugins should cache correctly', () => { const plugin = createPlugin.withOptions( - ({ className = 'banana' } = {}) => - ({ addComponents, variants }) => { - addComponents({ [`.${className}`]: { position: 'absolute' } }, variants('testPlugin')) - }, + ({ className = 'banana' } = {}) => ({ addComponents, variants }) => { + addComponents({ [`.${className}`]: { position: 'absolute' } }, variants('testPlugin')) + }, () => ({ variants: { testPlugin: ['responsive'] } }) )