Skip to content

Commit 9c762df

Browse files
authored
no space parens (#526)
1 parent f1b31d5 commit 9c762df

File tree

9 files changed

+15
-14
lines changed

9 files changed

+15
-14
lines changed

.eslintrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"curly": "error",
1616
"brace-style": "error",
1717
"indent": ["error", "tab", { "SwitchCase": 1 }],
18-
"radix": "error"
18+
"radix": "error",
19+
"space-in-parens": ["error", "never"]
1920
},
2021
"overrides": [
2122
{

plugin-packs/postcss-preset-env/src/lib/list-features.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function listFeatures(cssdbList, options, sharedOptions, logger) {
5858
return true;
5959
}
6060

61-
if ( minimumVendorImplementations <= feature.vendors_implementations ) {
61+
if (minimumVendorImplementations <= feature.vendors_implementations) {
6262
return true;
6363
}
6464

plugins/css-has-pseudo/src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const getEscapedCss = (/** @type {string} */ value) => {
9595
switch (char) {
9696
case '%':
9797
flushEncoded();
98-
encodedOut += ( '\\' + char );
98+
encodedOut += ('\\' + char);
9999
continue;
100100
case '\\':
101101
encodedCurrent += char;
@@ -132,7 +132,7 @@ const getEscapedCss = (/** @type {string} */ value) => {
132132
case '(':
133133
case ')':
134134
flushCurrent();
135-
out += ( '\\' + char );
135+
out += ('\\' + char);
136136
continue;
137137
case '\\':
138138
current += char;

plugins/postcss-design-tokens/src/data-formats/style-dictionary/v3/group.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function extractTokens(node: StyleDictionaryV3TokenGroup, path: Array<string>, f
1818
if (typeof child['value'] !== 'undefined') {
1919
const token = extractStyleDictionaryV3Token(child, key, path, filePath);
2020
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
21-
result.set(token.metadata!.path.join('.'), token );
21+
result.set(token.metadata!.path.join('.'), token);
2222
continue;
2323
}
2424

plugins/postcss-nesting/src/lib/merge-selectors/compound-selector-order.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function sortCompoundSelectorsInsideComplexSelector(node) {
3333
continue;
3434
}
3535

36-
if (node.nodes[i].type === 'tag' && currentCompoundSelector.find(x => x.type === 'tag') ) {
36+
if (node.nodes[i].type === 'tag' && currentCompoundSelector.find(x => x.type === 'tag')) {
3737
const isPseudoClone = isPseudo.clone();
3838
const child = node.nodes[i];
3939
child.replaceWith(isPseudoClone);

plugins/postcss-pseudo-class-any-link/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function creator(opts) {
2525
const rawSelector = rule.raws.selector && rule.raws.selector.raw || rule.selector;
2626

2727
// workaround for https://github.com/postcss/postcss-selector-parser/issues/28#issuecomment-171910556
28-
if (rawSelector.endsWith( ':')) {
28+
if (rawSelector.endsWith(':')) {
2929
return;
3030
}
3131

plugins/postcss-stepped-value-functions/src/round.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,17 @@ function transformRoundFunction(
9292

9393
switch (strategy) {
9494
case RoundingStrategy.Down:
95-
roundedValue = Math.floor( numberA / numberB ) * numberB;
95+
roundedValue = Math.floor(numberA / numberB) * numberB;
9696
break;
9797
case RoundingStrategy.Up:
98-
roundedValue = Math.ceil( numberA / numberB ) * numberB;
98+
roundedValue = Math.ceil(numberA / numberB) * numberB;
9999
break;
100100
case RoundingStrategy.ToZero:
101-
roundedValue = Math.trunc( numberA / numberB ) * numberB;
101+
roundedValue = Math.trunc(numberA / numberB) * numberB;
102102
break;
103103
case RoundingStrategy.Nearest:
104104
default:
105-
roundedValue = Math.round( numberA / numberB ) * numberB;
105+
roundedValue = Math.round(numberA / numberB) * numberB;
106106
break;
107107
}
108108

plugins/postcss-trigonometric-functions/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const creator: PluginCreator<pluginOptions> = (opts?: pluginOptions) => {
5454
return;
5555
}
5656

57-
decl.before( newDeclaration );
57+
decl.before(newDeclaration);
5858

5959
if (!options.preserve) {
6060
decl.remove();

plugins/postcss-trigonometric-functions/src/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function gradToRad(grad: number): number {
1515
}
1616

1717
export function radToDeg(rad: number): number {
18-
return rad * ( 180 / Math.PI );
18+
return rad * (180 / Math.PI);
1919
}
2020

2121
export function gradToDeg(grad: number): number {
@@ -328,7 +328,7 @@ export function parseNumber(value: string) {
328328
let number;
329329
let unit = '';
330330

331-
if (value.toLowerCase() === 'infinity' ) {
331+
if (value.toLowerCase() === 'infinity') {
332332
number = Infinity;
333333
} else if (value.toLowerCase() === '-infinity') {
334334
number = Infinity * -1;

0 commit comments

Comments
 (0)