Skip to content

Commit 1f4e7b2

Browse files
committed
Auto Fix Linting Issues
1 parent e737863 commit 1f4e7b2

File tree

19 files changed

+299
-340
lines changed

19 files changed

+299
-340
lines changed

.eslintcache

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

babel.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
2-
presets: ["@babel/preset-env", "@babel/preset-react"],
3-
plugins: ["transform-class-properties"],
2+
presets: ['@babel/preset-env', '@babel/preset-react'],
3+
plugins: ['transform-class-properties'],
44
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"scripts": {
1111
"dev": "webpack --progress --colors --config scripts/webpack/webpack.dev.js",
1212
"test": "jest",
13-
"lint": "eslint ./ --ext .js --cache"
13+
"lint": "eslint ./ --ext .js --cache --fix"
1414
},
1515
"devDependencies": {
1616
"@babel/core": "7.8.4",

scripts/webpack/postcss.config.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
module.exports = () => {
2-
return {
3-
plugins: {
4-
autoprefixer: {},
5-
'postcss-reporter': {},
6-
'postcss-browser-reporter': {},
7-
}
8-
};
9-
};
1+
module.exports = () => ({
2+
plugins: {
3+
autoprefixer: {},
4+
'postcss-reporter': {},
5+
'postcss-browser-reporter': {},
6+
},
7+
});

scripts/webpack/webpack.common.js

Lines changed: 57 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
1-
"use strict";
1+
const webpack = require('webpack');
2+
const path = require('path');
3+
const HtmlWebpackPlugin = require('html-webpack-plugin');
4+
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
5+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
6+
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
7+
const CopyPlugin = require('copy-webpack-plugin');
8+
const ESLintPlugin = require('eslint-webpack-plugin');
29

3-
const webpack = require("webpack");
4-
const path = require("path");
5-
const HtmlWebpackPlugin = require("html-webpack-plugin");
6-
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
7-
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
8-
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
9-
const CopyPlugin = require("copy-webpack-plugin");
10-
const ESLintPlugin = require("eslint-webpack-plugin");
11-
12-
const fs = require("fs");
10+
const fs = require('fs');
1311

1412
module.exports = {
15-
target: "web",
13+
target: 'web',
1614

1715
entry: {
18-
app: "./webapp/javascript/index.jsx",
19-
styles: "./webapp/sass/profile.scss",
16+
app: './webapp/javascript/index.jsx',
17+
styles: './webapp/sass/profile.scss',
2018
},
2119

2220
output: {
23-
publicPath: "",
24-
path: path.resolve(__dirname, "../../webapp/public/build"),
25-
filename: "[name].[hash].js",
21+
publicPath: '',
22+
path: path.resolve(__dirname, '../../webapp/public/build'),
23+
filename: '[name].[hash].js',
2624
},
2725

2826
resolve: {
29-
extensions: [".ts", ".tsx", ".es6", ".js", ".jsx", ".json", ".svg"],
27+
extensions: ['.ts', '.tsx', '.es6', '.js', '.jsx', '.json', '.svg'],
3028
alias: {
3129
// rc-trigger uses babel-runtime which has internal dependency to core-js@2
3230
// this alias maps that dependency to core-js@t3
33-
"core-js/library/fn": "core-js/stable",
31+
'core-js/library/fn': 'core-js/stable',
3432
},
3533
modules: [
36-
"node_modules",
37-
path.resolve("webapp"),
38-
path.resolve("node_modules"),
34+
'node_modules',
35+
path.resolve('webapp'),
36+
path.resolve('node_modules'),
3937
],
4038
},
4139

@@ -57,30 +55,30 @@ module.exports = {
5755
exclude: /node_modules/,
5856
use: [
5957
{
60-
loader: "babel-loader",
58+
loader: 'babel-loader',
6159
options: {
6260
cacheDirectory: true,
6361
babelrc: true,
6462
// Note: order is bottom-to-top and/or right-to-left
6563
presets: [
6664
[
67-
"@babel/preset-env",
65+
'@babel/preset-env',
6866
{
6967
targets: {
70-
browsers: "last 3 versions",
68+
browsers: 'last 3 versions',
7169
},
72-
useBuiltIns: "entry",
70+
useBuiltIns: 'entry',
7371
corejs: 3,
7472
modules: false,
7573
},
7674
],
7775
[
78-
"@babel/preset-typescript",
76+
'@babel/preset-typescript',
7977
{
8078
allowNamespaces: true,
8179
},
8280
],
83-
"@babel/preset-react",
81+
'@babel/preset-react',
8482
],
8583
},
8684
},
@@ -90,9 +88,9 @@ module.exports = {
9088
test: /\.js$/,
9189
use: [
9290
{
93-
loader: "babel-loader",
91+
loader: 'babel-loader',
9492
options: {
95-
presets: [["@babel/preset-env"]],
93+
presets: [['@babel/preset-env']],
9694
},
9795
},
9896
],
@@ -102,7 +100,7 @@ module.exports = {
102100
exclude: /(index|error)\.html/,
103101
use: [
104102
{
105-
loader: "html-loader",
103+
loader: 'html-loader',
106104
options: {
107105
attrs: [],
108106
minimize: true,
@@ -115,29 +113,29 @@ module.exports = {
115113
{
116114
test: /\.css$/,
117115
// include: MONACO_DIR, // https://github.com/react-monaco-editor/react-monaco-editor
118-
use: ["style-loader", "css-loader"],
116+
use: ['style-loader', 'css-loader'],
119117
},
120118
{
121119
test: /\.scss$/,
122120
use: [
123121
MiniCssExtractPlugin.loader,
124122
{
125-
loader: "css-loader",
123+
loader: 'css-loader',
126124
options: {
127125
importLoaders: 2,
128126
url: true,
129127
sourceMap: true,
130128
},
131129
},
132130
{
133-
loader: "postcss-loader",
131+
loader: 'postcss-loader',
134132
options: {
135133
sourceMap: true,
136134
config: { path: __dirname },
137135
},
138136
},
139137
{
140-
loader: "sass-loader",
138+
loader: 'sass-loader',
141139
options: {
142140
sourceMap: true,
143141
},
@@ -146,51 +144,49 @@ module.exports = {
146144
},
147145
{
148146
test: /\.(svg|ico|jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|cur|ani|pdf)(\?.*)?$/,
149-
loader: "file-loader",
150-
options: { name: "static/img/[name].[hash:8].[ext]" },
147+
loader: 'file-loader',
148+
options: { name: 'static/img/[name].[hash:8].[ext]' },
151149
},
152150
],
153151
},
154152

155153
plugins: [
156154
new ESLintPlugin(),
157155
new webpack.ProvidePlugin({
158-
$: "jquery",
159-
jQuery: "jquery",
156+
$: 'jquery',
157+
jQuery: 'jquery',
160158
}),
161159
new HtmlWebpackPlugin({
162-
filename: path.resolve(__dirname, "../../webapp/public/index.html"),
163-
template: path.resolve(__dirname, "../../webapp/templates/index.html"),
160+
filename: path.resolve(__dirname, '../../webapp/public/index.html'),
161+
template: path.resolve(__dirname, '../../webapp/templates/index.html'),
164162
inject: false,
165-
chunksSortMode: "none",
166-
templateParameters: (compilation, assets, options) => {
167-
return {
168-
extra_metadata: process.env.EXTRA_METADATA
169-
? fs.readFileSync(process.env.EXTRA_METADATA)
170-
: "",
171-
mode: process.env.NODE_ENV,
172-
webpack: compilation.getStats().toJson(),
173-
compilation: compilation,
174-
webpackConfig: compilation.options,
175-
htmlWebpackPlugin: {
176-
files: assets,
177-
options: options,
178-
},
179-
};
180-
},
163+
chunksSortMode: 'none',
164+
templateParameters: (compilation, assets, options) => ({
165+
extra_metadata: process.env.EXTRA_METADATA
166+
? fs.readFileSync(process.env.EXTRA_METADATA)
167+
: '',
168+
mode: process.env.NODE_ENV,
169+
webpack: compilation.getStats().toJson(),
170+
compilation,
171+
webpackConfig: compilation.options,
172+
htmlWebpackPlugin: {
173+
files: assets,
174+
options,
175+
},
176+
}),
181177
}),
182178
new MiniCssExtractPlugin({
183-
filename: "[name].[hash].css",
179+
filename: '[name].[hash].css',
184180
}),
185181
new webpack.DefinePlugin({
186-
PYROSCOPE_VERSION: JSON.stringify(require("../../package.json").version),
182+
PYROSCOPE_VERSION: JSON.stringify(require('../../package.json').version),
187183
}),
188184
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
189185
new CopyPlugin({
190186
patterns: [
191187
{
192-
from: "webapp/images",
193-
to: "images",
188+
from: 'webapp/images',
189+
to: 'images',
194190
},
195191
],
196192
}),

scripts/webpack/webpack.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ const { merge } = require('webpack-merge');
44
const common = require('./webpack.common.js');
55

66
module.exports = merge(common, {
7-
mode: 'development'
7+
mode: 'development',
88
});

scripts/webpack/webpack.prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ const { merge } = require('webpack-merge');
44
const common = require('./webpack.common.js');
55

66
module.exports = merge(common, {
7-
mode: 'production'
7+
mode: 'production',
88
});

webapp/__tests__/Label.spec.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
1-
import React from "react";
2-
import Label from "../javascript/components/Label";
3-
import { configure } from "enzyme";
4-
import Adapter from "enzyme-adapter-react-16";
5-
import { shallow, mount, render } from "enzyme";
6-
import { Provider } from "react-redux";
7-
import configureStore from "redux-mock-store";
1+
import React from 'react';
2+
import {
3+
configure, shallow, mount, render,
4+
} from 'enzyme';
5+
import Adapter from 'enzyme-adapter-react-16';
6+
7+
import { Provider } from 'react-redux';
8+
import configureStore from 'redux-mock-store';
9+
import Label from '../javascript/components/Label';
810

911
const mockStore = configureStore();
1012
configure({ adapter: new Adapter() });
11-
let store, wrapper;
12-
const initialState = { label: { name: "Expensive Process", value: 32 } };
13+
let store; let
14+
wrapper;
15+
const initialState = { label: { name: 'Expensive Process', value: 32 } };
1316

1417
beforeEach(() => {
1518
store = mockStore(initialState);
1619
wrapper = mount(
1720
<Provider store={store}>
1821
<Label />
19-
</Provider>
22+
</Provider>,
2023
);
2124
});
2225

23-
describe("Label is correctly rendered", () => {
24-
it("Correctly renders name", () => {
26+
describe('Label is correctly rendered', () => {
27+
it('Correctly renders name', () => {
2528
expect(
2629
wrapper.contains(
27-
<span className="label-name">{initialState.label.name}</span>
28-
)
30+
<span className="label-name">{initialState.label.name}</span>,
31+
),
2932
).toBe(true);
3033
});
31-
it("Correctly renders value", () => {
34+
it('Correctly renders value', () => {
3235
expect(
3336
wrapper.contains(
34-
<span className="label-value">{initialState.label.value}</span>
35-
)
37+
<span className="label-value">{initialState.label.value}</span>,
38+
),
3639
).toBe(true);
3740
});
3841
});
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
export const SET_DATE_RANGE = "SET_DATE_RANGE";
2-
export const SET_FROM = "SET_FROM";
3-
export const SET_UNTIL = "SET_UNTIL";
4-
export const SET_MAX_NODES = "SET_MAX_NODES";
5-
export const SET_LABELS = "SET_LABELS";
6-
export const ADD_LABEL = "ADD_LABEL";
7-
export const REMOVE_LABEL = "REMOVE_LABEL";
8-
export const REFRESH = "REFRESH";
9-
export const REQUEST_JSON = "REQUEST_JSON";
10-
export const RECEIVE_JSON = "RECEIVE_JSON";
11-
export const REQUEST_NAMES = "REQUEST_NAMES";
12-
export const RECEIVE_NAMES = "RECEIVE_NAMES";
1+
export const SET_DATE_RANGE = 'SET_DATE_RANGE';
2+
export const SET_FROM = 'SET_FROM';
3+
export const SET_UNTIL = 'SET_UNTIL';
4+
export const SET_MAX_NODES = 'SET_MAX_NODES';
5+
export const SET_LABELS = 'SET_LABELS';
6+
export const ADD_LABEL = 'ADD_LABEL';
7+
export const REMOVE_LABEL = 'REMOVE_LABEL';
8+
export const REFRESH = 'REFRESH';
9+
export const REQUEST_JSON = 'REQUEST_JSON';
10+
export const RECEIVE_JSON = 'RECEIVE_JSON';
11+
export const REQUEST_NAMES = 'REQUEST_NAMES';
12+
export const RECEIVE_NAMES = 'RECEIVE_NAMES';

0 commit comments

Comments
 (0)