Skip to content

Commit 1c5adab

Browse files
chore: fix pre-commit prettier linting and add json linting (#484)
1 parent b50db5f commit 1c5adab

File tree

27 files changed

+100
-122
lines changed

27 files changed

+100
-122
lines changed

.eslintrc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
{
2-
"extends": ["@gravity-ui/eslint-config", "prettier"],
2+
"extends": ["@gravity-ui/eslint-config", "@gravity-ui/eslint-config/prettier"],
33
"root": true,
44
"overrides": [
55
{
6-
"files": [
7-
"config-overrides.js",
8-
"commitlint.config.js"
9-
],
6+
"files": ["config-overrides.js", "commitlint.config.js"],
107
"env": {
118
"node": true
129
}

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
],
6565
"*.{js,jsx,ts,tsx}": [
6666
"eslint --fix --quiet"
67+
],
68+
"*.{json}": [
69+
"prettier --write"
6770
]
6871
},
6972
"jest": {

src/components/QueryResultTable/Cell/Cell.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ interface CellProps {
1111
}
1212

1313
export const Cell = React.memo(function Cell(props: CellProps) {
14-
const {
15-
className,
16-
value,
17-
} = props;
14+
const {className, value} = props;
1815

1916
const dispatch = useDispatch();
2017

21-
useEffect(() => () => {
22-
dispatch(hideTooltip());
23-
}, [dispatch]);
18+
useEffect(
19+
() => () => {
20+
dispatch(hideTooltip());
21+
},
22+
[dispatch],
23+
);
2424

2525
return (
2626
<span
@@ -29,5 +29,5 @@ export const Cell = React.memo(function Cell(props: CellProps) {
2929
>
3030
{value}
3131
</span>
32-
)
32+
);
3333
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"empty": "Table is empty"
2+
"empty": "Table is empty"
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"empty": "Таблица пустая"
2+
"empty": "Таблица пустая"
33
}

src/components/ShortyString/ShortyString.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,15 @@ export default function ShortyString({
3333
const [expanded, setExpanded] = React.useState(false);
3434

3535
const toggleLabelAction = expanded ? collapseLabel : expandLabel;
36-
const toggleLabelSymbolsCount = displayLength && !expanded
37-
? i18n('chars_count', {count: value.length})
38-
: '';
36+
const toggleLabelSymbolsCount =
37+
displayLength && !expanded ? i18n('chars_count', {count: value.length}) : '';
3938
const toggleLabel = toggleLabelAction + toggleLabelSymbolsCount;
4039

4140
// showing toogle button with a label that is longer than the hidden part is pointless,
4241
// hence compare to limit + length in the not-strict mode
4342
const hasToggle = value.length > limit + (strict ? 0 : toggleLabel.length);
4443

45-
const text = expanded || !hasToggle
46-
? value
47-
: value.slice(0, limit - 4) + '\u00a0...';
44+
const text = expanded || !hasToggle ? value : value.slice(0, limit - 4) + '\u00a0...';
4845

4946
return (
5047
<div className={block()}>
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"default_collapse_label": "Show less",
3-
"default_expand_label": "Show more",
4-
"chars_count": [
5-
" ({{count}} symbol)",
6-
" ({{count}} symbols)",
7-
" ({{count}} symbols)",
8-
" ({{count}} symbols)"
9-
]
2+
"default_collapse_label": "Show less",
3+
"default_expand_label": "Show more",
4+
"chars_count": [
5+
" ({{count}} symbol)",
6+
" ({{count}} symbols)",
7+
" ({{count}} symbols)",
8+
" ({{count}} symbols)"
9+
]
1010
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"default_collapse_label": "Показать меньше",
3-
"default_expand_label": "Показать ещё",
4-
"chars_count": [
5-
" ({{count}} символ)",
6-
" ({{count}} символа)",
7-
" ({{count}} символов)",
8-
" ({{count}} символов)"
9-
]
2+
"default_collapse_label": "Показать меньше",
3+
"default_expand_label": "Показать ещё",
4+
"chars_count": [
5+
" ({{count}} символ)",
6+
" ({{count}} символа)",
7+
" ({{count}} символов)",
8+
" ({{count}} символов)"
9+
]
1010
}

src/components/SpeedMultiMeter/i18n/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ i18n.registerKeyset(Lang.En, COMPONENT, en);
99
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);
1010

1111
export default i18n.keyset(COMPONENT);
12-
13-

src/components/Stack/Stack.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ const b = cn('stack');
1313

1414
export const Stack: React.FC<StackProps> = ({children, className}) => (
1515
<div className={b(null, className)}>
16-
{
17-
React.Children.map(children, (child, index) => {
18-
if (!React.isValidElement(child)) {
19-
return null;
20-
}
16+
{React.Children.map(children, (child, index) => {
17+
if (!React.isValidElement(child)) {
18+
return null;
19+
}
2120

22-
return (
23-
<div
24-
className={b('layer')}
25-
style={{
21+
return (
22+
<div
23+
className={b('layer')}
24+
style={
25+
{
2626
[LAYER_CSS_VAR]: index,
27-
} as React.CSSProperties}
28-
>
29-
{child}
30-
</div>
31-
);
32-
})
33-
}
27+
} as React.CSSProperties
28+
}
29+
>
30+
{child}
31+
</div>
32+
);
33+
})}
3434
</div>
3535
);

0 commit comments

Comments
 (0)