Skip to content

Commit f2c6633

Browse files
refactor: apply prettier (#694)
* refactor: apply `prettier` * refactor: disable stylistic rules * refactor: apply more * test: fix
1 parent dee9258 commit f2c6633

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2162
-1763
lines changed

.babelrc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
// Compiles sources, gulpfile and tests
33
{
44
"presets": [
5-
["@babel/preset-env", {
6-
"targets": {"node": "16.20.2"}
7-
}]
5+
[
6+
"@babel/preset-env",
7+
{
8+
"targets": { "node": "16.20.2" }
9+
}
10+
]
811
]
912
}

.eslintrc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
{
22
"root": true,
3+
"rules": {
4+
"quotes": "off",
5+
"curly": "off",
6+
"indent": "off",
7+
"comma-dangle": "off",
8+
"line-comment-position": "off",
9+
"object-curly-spacing": "off",
10+
"generator-star-spacing": "off",
11+
"nonblock-statement-body-position": "off",
12+
"newline-per-chained-call": "off",
13+
"lines-between-class-members": "off"
14+
},
315
"extends": "th0r"
416
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
/samples
44
node_modules
55
npm-debug.log
6+
.eslintcache

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
test/bundles/**
2+
test/stats/**
3+
test/output/**
4+
samples/**
5+
CHANGELOG.md

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
1818
* Add support for Zstandard compression ([#693](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/693) by [@bjohansebas](https://github.com/bjohansebas))
1919

2020
* **Internal**
21+
* Prettier applied to the code base ([#693](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/694) by [@alexander-akait](https://github.com/alexander-akait))
2122
* Update `sirv` dependency ([#692](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/692) by [@bjohansebas](https://github.com/bjohansebas))
2223
* Update `ws` dependency ([#691](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/691) by [@bjohansebas](https://github.com/bjohansebas))
2324

README.md

Lines changed: 26 additions & 29 deletions
Large diffs are not rendered by default.

client/.eslintrc.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
2-
"extends": [
3-
"th0r-react",
4-
"../.eslintrc.json"
5-
],
2+
"extends": ["th0r-react", "../.eslintrc.json"],
63
"settings": {
74
"react": {
85
"version": "16.2"

client/components/Button.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
font: var(--main-font);
88
outline: none;
99
padding: 5px 7px;
10-
transition: background .3s ease, border-color .3s ease, color .3s ease;
10+
transition:
11+
background 0.3s ease,
12+
border-color 0.3s ease,
13+
color 0.3s ease;
1114
white-space: nowrap;
1215
color: var(--text-primary);
1316
}

client/components/Button.jsx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
1-
import cls from 'classnames';
2-
import s from './Button.css';
3-
import PureComponent from '../lib/PureComponent';
1+
import cls from "classnames";
2+
import s from "./Button.css";
3+
import PureComponent from "../lib/PureComponent";
44

55
export default class Button extends PureComponent {
6-
render({active, toggle, className, children, ...props}) {
6+
render({ active, toggle, className, children, ...props }) {
77
const classes = cls(className, {
88
[s.button]: true,
99
[s.active]: active,
10-
[s.toggle]: toggle
10+
[s.toggle]: toggle,
1111
});
1212

1313
return (
14-
<button {...props}
14+
<button
15+
{...props}
1516
ref={this.saveRef}
1617
type="button"
1718
className={classes}
1819
disabled={this.disabled}
19-
onClick={this.handleClick}>
20+
onClick={this.handleClick}
21+
>
2022
{children}
2123
</button>
2224
);
2325
}
2426

2527
get disabled() {
26-
const {props} = this;
27-
return (
28-
props.disabled ||
29-
(props.active && !props.toggle)
30-
);
28+
const { props } = this;
29+
return props.disabled || (props.active && !props.toggle);
3130
}
3231

3332
handleClick = (event) => {
3433
this.elem.blur();
3534
this.props.onClick(event);
36-
}
35+
};
3736

38-
saveRef = elem => this.elem = elem;
37+
saveRef = (elem) => (this.elem = elem);
3938
}

client/components/Checkbox.jsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
import {Component} from 'preact';
2-
import cls from 'classnames';
1+
import { Component } from "preact";
2+
import cls from "classnames";
33

4-
import s from './Checkbox.css';
4+
import s from "./Checkbox.css";
55

66
export default class Checkbox extends Component {
7-
87
render() {
9-
const {checked, className, children} = this.props;
8+
const { checked, className, children } = this.props;
109

1110
return (
1211
<label className={cls(s.label, className)}>
13-
<input className={s.checkbox}
12+
<input
13+
className={s.checkbox}
1414
type="checkbox"
1515
checked={checked}
16-
onChange={this.handleChange}/>
17-
<span className={s.itemText}>
18-
{children}
19-
</span>
16+
onChange={this.handleChange}
17+
/>
18+
<span className={s.itemText}>{children}</span>
2019
</label>
2120
);
2221
}
2322

2423
handleChange = () => {
2524
this.props.onChange(!this.props.checked);
26-
}
27-
25+
};
2826
}

0 commit comments

Comments
 (0)