Skip to content

Commit e481e28

Browse files
committed
Fix style
1 parent ca0f695 commit e481e28

File tree

5 files changed

+41
-38
lines changed

5 files changed

+41
-38
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: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,15 +1239,15 @@ test('plugin config modifications are applied', () => {
12391239
const userConfig = {
12401240
plugins: [
12411241
{
1242-
modifyConfig: function (config) {
1242+
modifyConfig(config) {
12431243
return {
12441244
...config,
1245-
prefix: 'tw-'
1245+
prefix: 'tw-',
12461246
}
12471247
},
1248-
handler: function () {}
1249-
}
1250-
]
1248+
handler() {},
1249+
},
1250+
],
12511251
}
12521252

12531253
const defaultConfig = {
@@ -1267,7 +1267,7 @@ test('plugin config modifications are applied', () => {
12671267
}
12681268

12691269
const result = resolveConfig([userConfig, defaultConfig])
1270-
1270+
12711271
expect(result).toEqual({
12721272
prefix: 'tw-',
12731273
important: false,
@@ -1291,15 +1291,15 @@ test('user config takes precedence over plugin config modifications', () => {
12911291
prefix: 'user-',
12921292
plugins: [
12931293
{
1294-
modifyConfig: function (config) {
1294+
modifyConfig(config) {
12951295
return {
12961296
...config,
1297-
prefix: 'plugin-'
1297+
prefix: 'plugin-',
12981298
}
12991299
},
1300-
handler: function () {}
1301-
}
1302-
]
1300+
handler() {},
1301+
},
1302+
],
13031303
}
13041304

13051305
const defaultConfig = {
@@ -1319,7 +1319,7 @@ test('user config takes precedence over plugin config modifications', () => {
13191319
}
13201320

13211321
const result = resolveConfig([userConfig, defaultConfig])
1322-
1322+
13231323
expect(result).toEqual({
13241324
prefix: 'user-',
13251325
important: false,
@@ -1336,4 +1336,4 @@ test('user config takes precedence over plugin config modifications', () => {
13361336
},
13371337
plugins: userConfig.plugins,
13381338
})
1339-
})
1339+
})

__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
@@ -71,7 +71,10 @@ function resolveFunctionKeys(object) {
7171
}
7272

7373
export default function resolveConfig([userConfig, defaultConfig]) {
74-
const modifiedDefaultConfig = applyPluginConfigModifications(defaultConfig, get(userConfig, 'plugins', []))
74+
const modifiedDefaultConfig = applyPluginConfigModifications(
75+
defaultConfig,
76+
get(userConfig, 'plugins', [])
77+
)
7578
const configs = [userConfig, modifiedDefaultConfig]
7679

7780
return defaults(

0 commit comments

Comments
 (0)