Skip to content

Commit 9b92ff1

Browse files
committed
chore: use webpack
1 parent 3ab9b40 commit 9b92ff1

27 files changed

+5817
-2904
lines changed

.eslintrc.cjs

-76
This file was deleted.

.eslintrc.js

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
const webpackConfig = require('./webpack.config');
2+
3+
module.exports = {
4+
parser: '@typescript-eslint/parser',
5+
parserOptions: {
6+
ecmaVersion: 2021,
7+
sourceType: 'module',
8+
ecmaFeatures: {
9+
jsx: true,
10+
},
11+
},
12+
globals: {
13+
Blockly: false,
14+
trackJs: false,
15+
jest: false,
16+
dataLayer: false,
17+
goog: false,
18+
google: false,
19+
gapi: false,
20+
__webpack_public_path__: false,
21+
window: true,
22+
performance: true,
23+
process: true,
24+
},
25+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
26+
settings: {
27+
'import/resolver': {
28+
webpack: { config: webpackConfig },
29+
},
30+
},
31+
plugins: ['simple-import-sort', '@typescript-eslint'],
32+
rules: {
33+
'simple-import-sort/imports': 'warn',
34+
'simple-import-sort/exports': 'warn',
35+
},
36+
overrides: [
37+
{
38+
files: ['**/*.js', '**/*.ts', '**/*.tsx', '**/*.jsx'],
39+
rules: {
40+
'simple-import-sort/imports': [
41+
'warn',
42+
{
43+
groups: [
44+
[
45+
'public-path',
46+
// `react` first, then packages starting with a character
47+
'^react$',
48+
'^[a-z]',
49+
// Packages starting with `@`
50+
'^@',
51+
// Packages starting with `~`
52+
'^~',
53+
'^Components',
54+
'^Constants',
55+
'^Utils',
56+
'^Types',
57+
'^Stores',
58+
// Imports starting with `../`
59+
'^\\.\\.(?!/?$)',
60+
'^\\.\\./?$',
61+
// Imports starting with `./`
62+
'^\\./(?=.*/)(?!/?$)',
63+
'^\\.(?!/?$)',
64+
'^\\./?$',
65+
// Style imports
66+
'^.+\\.s?css$',
67+
// Side effect imports
68+
'^\\u0000',
69+
// Delete the empty line copied as the next line of the last import
70+
'\\s*',
71+
],
72+
],
73+
},
74+
],
75+
},
76+
},
77+
],
78+
ignorePatterns: ['node_modules/', 'dist/', '**/webpack.config.js'],
79+
};

.lintstagedrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"*.{js,jsx,ts,tsx,md,html,css,scss}": "prettier --write",
3-
"*.{js,jsx,ts,tsx}": "eslint --fix --config .eslintrc.cjs",
3+
"*.{js,jsx,ts,tsx}": "eslint --fix --config .eslintrc.js",
44
"*.{css,scss}": "npx stylelint --fix"
55
}

.stylelintrc.cjs

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module.exports = {
22
plugins: ['stylelint-no-unsupported-browser-features'],
33
rules: {
4+
'scss/at-mixin-pattern': null,
5+
'scss/no-global-function-names': null,
6+
'scss/dollar-variable-pattern': null,
47
'color-named': 'never',
58
'color-no-invalid-hex': true,
69
'declaration-block-no-duplicate-properties': [true, { ignore: ['consecutive-duplicates'] }],

babel.config.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"presets": ["@babel/preset-env", ["@babel/preset-react", { "runtime": "automatic" }], "@babel/preset-typescript"],
3+
"plugins": [
4+
["@babel/plugin-proposal-decorators", { "legacy": true }],
5+
["@babel/plugin-proposal-class-properties", { "loose": true }],
6+
["@babel/plugin-proposal-private-methods", { "loose": true }],
7+
["@babel/plugin-proposal-private-property-in-object", { "loose": true }],
8+
"@babel/plugin-proposal-export-default-from",
9+
"@babel/plugin-proposal-object-rest-spread",
10+
"@babel/plugin-proposal-export-namespace-from",
11+
"@babel/plugin-syntax-dynamic-import",
12+
"@babel/plugin-proposal-optional-chaining"
13+
]
14+
}

index.html

+35
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,42 @@
55
<link rel="icon" type="image/svg+xml" href="/deriv-logo.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Deriv Bot</title>
8+
<style>
9+
:root {
10+
--logo-loading-color: rgba(0, 0, 0, 0.8);
11+
--header-footer-bg-color: rgba(0, 0, 0, 0.04);
12+
--content-bg-color: #fff;
13+
--general-main-1: #ffffff;
14+
--general-section-1: #f2f3f4;
15+
--text-prominent: #333333;
16+
font-size: 62.5%;
17+
}
18+
19+
#platform_name:after {
20+
content: var(--app-shell-platform-name);
21+
margin-left: 8px;
22+
}
23+
24+
.deriv-app > .header__loading {
25+
background-color: var(--general-main-1);
26+
border-bottom: var(--general-main-1);
27+
}
28+
29+
.deriv-app > .app-contents__loading {
30+
background-color: var(--general-main-1);
31+
}
32+
33+
.deriv-app > .footer__loading {
34+
background-color: var(--general-main-1);
35+
border-bottom: var(--general-main-1);
36+
}
37+
38+
.initial-loader__loading {
39+
background-color: var(--general-main-1);
40+
}
41+
</style>
842
</head>
43+
944
<body class="body">
1045
<div id="root"></div>
1146
<script type="module" src="/src/main.tsx"></script>

0 commit comments

Comments
 (0)