Skip to content

Commit 33e5546

Browse files
committed
Fix style
1 parent 4c25ca5 commit 33e5546

File tree

5 files changed

+40
-37
lines changed

5 files changed

+40
-37
lines changed

__tests__/modifyConfig.test.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test('plugins can add new theme values', () => {
77
corePlugins: [],
88
plugins: [
99
{
10-
modifyConfig: function(config) {
10+
modifyConfig(config) {
1111
return {
1212
...config,
1313
theme: {
@@ -17,26 +17,26 @@ test('plugins can add new theme values', () => {
1717
'90': '90deg',
1818
'180': '180deg',
1919
'270': '270deg',
20-
}
21-
}
20+
},
21+
},
2222
}
2323
},
24-
handler: function({ addUtilities, theme }) {
25-
addUtilities(Object.entries(theme('rotate')).map(([key, value]) => {
26-
return {
27-
[`.rotate-${key}`]: {
28-
transform: `rotate(${value})`,
29-
},
30-
}
31-
}))
24+
handler({ addUtilities, theme }) {
25+
addUtilities(
26+
Object.entries(theme('rotate')).map(([key, value]) => {
27+
return {
28+
[`.rotate-${key}`]: {
29+
transform: `rotate(${value})`,
30+
},
31+
}
32+
})
33+
)
3234
},
33-
}
34-
]
35+
},
36+
],
3537
}),
3638
])
37-
.process('@tailwind utilities;',
38-
{ from: undefined }
39-
)
39+
.process('@tailwind utilities;', { from: undefined })
4040
.then(result => {
4141
const expected = `
4242
.rotate-0 {

__tests__/processPlugins.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ test('plugins can be provided as an object with a handler function', () => {
12111211
const { components, utilities } = processPlugins(
12121212
[
12131213
{
1214-
handler: function({ addUtilities }) {
1214+
handler({ addUtilities }) {
12151215
addUtilities({
12161216
'.object-fill': {
12171217
'object-fit': 'fill',
@@ -1224,7 +1224,7 @@ test('plugins can be provided as an object with a handler function', () => {
12241224
},
12251225
})
12261226
},
1227-
}
1227+
},
12281228
],
12291229
makeConfig()
12301230
)

__tests__/resolveConfig.test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,15 +1363,15 @@ test('plugin config modifications are applied', () => {
13631363
const userConfig = {
13641364
plugins: [
13651365
{
1366-
modifyConfig: function (config) {
1366+
modifyConfig(config) {
13671367
return {
13681368
...config,
1369-
prefix: 'tw-'
1369+
prefix: 'tw-',
13701370
}
13711371
},
1372-
handler: function () {}
1373-
}
1374-
]
1372+
handler() {},
1373+
},
1374+
],
13751375
}
13761376

13771377
const defaultConfig = {
@@ -1391,7 +1391,7 @@ test('plugin config modifications are applied', () => {
13911391
}
13921392

13931393
const result = resolveConfig([userConfig, defaultConfig])
1394-
1394+
13951395
expect(result).toEqual({
13961396
prefix: 'tw-',
13971397
important: false,
@@ -1415,15 +1415,15 @@ test('user config takes precedence over plugin config modifications', () => {
14151415
prefix: 'user-',
14161416
plugins: [
14171417
{
1418-
modifyConfig: function (config) {
1418+
modifyConfig(config) {
14191419
return {
14201420
...config,
1421-
prefix: 'plugin-'
1421+
prefix: 'plugin-',
14221422
}
14231423
},
1424-
handler: function () {}
1425-
}
1426-
]
1424+
handler() {},
1425+
},
1426+
],
14271427
}
14281428

14291429
const defaultConfig = {
@@ -1443,7 +1443,7 @@ test('user config takes precedence over plugin config modifications', () => {
14431443
}
14441444

14451445
const result = resolveConfig([userConfig, defaultConfig])
1446-
1446+
14471447
expect(result).toEqual({
14481448
prefix: 'user-',
14491449
important: false,

__tmp_4/tailwind.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
2-
theme: {
3-
screens: {
4-
mobile: '400px',
5-
},
6-
},
7-
}
2+
theme: {
3+
screens: {
4+
mobile: '400px',
5+
},
6+
},
7+
}

src/util/resolveConfig.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ function resolveFunctionKeys(object) {
103103
}
104104

105105
export default function resolveConfig([userConfig, defaultConfig]) {
106-
const modifiedDefaultConfig = applyPluginConfigModifications(defaultConfig, get(userConfig, 'plugins', []))
106+
const modifiedDefaultConfig = applyPluginConfigModifications(
107+
defaultConfig,
108+
get(userConfig, 'plugins', [])
109+
)
107110
const configs = [userConfig, modifiedDefaultConfig]
108111

109112
return defaults(

0 commit comments

Comments
 (0)