Skip to content

Commit 8a23e1f

Browse files
committed
fix: update admin
1 parent ef8d7ef commit 8a23e1f

Some content is hidden

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

55 files changed

+6209
-13024
lines changed

admin/.babelrc

Lines changed: 19 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,58 +3,30 @@
33
[
44
"@babel/preset-env",
55
{
6-
"loose": true,
7-
"modules": false
6+
"targets": [">0.2%", "not dead", "not ie <= 11", "not op_mini all"],
7+
"useBuiltIns": "usage",
8+
"corejs": 3
89
}
910
],
10-
// NOTE: flow flow
11-
// "@babel/preset-flow",
11+
"@babel/preset-typescript",
1212
"@babel/preset-react"
1313
],
14-
"env": {
15-
"test": {
16-
"presets": [
17-
"@babel/preset-env",
18-
"@babel/preset-react"
19-
],
20-
"plugins": [
21-
"@babel/plugin-syntax-dynamic-import",
22-
"@babel/plugin-syntax-import-meta",
23-
"@babel/plugin-proposal-class-properties",
24-
"@babel/plugin-proposal-json-strings",
25-
[
26-
"@babel/plugin-proposal-decorators",
27-
{
28-
"legacy": true
29-
}
30-
],
31-
"@babel/plugin-proposal-function-sent",
32-
"@babel/plugin-proposal-export-namespace-from",
33-
"@babel/plugin-proposal-numeric-separator",
34-
"@babel/plugin-proposal-throw-expressions"
35-
]
36-
},
37-
"development": {
38-
"plugins": [
39-
"babel-plugin-styled-components",
40-
"react-hot-loader/babel"
41-
]
42-
}
43-
},
14+
4415
"plugins": [
4516
"@babel/plugin-syntax-dynamic-import",
46-
"@babel/plugin-syntax-import-meta",
17+
"@babel/plugin-proposal-object-rest-spread",
4718
"@babel/plugin-proposal-class-properties",
48-
"@babel/plugin-proposal-json-strings",
49-
[
50-
"@babel/plugin-proposal-decorators",
51-
{
52-
"legacy": true
53-
}
54-
],
55-
"@babel/plugin-proposal-function-sent",
56-
"@babel/plugin-proposal-export-namespace-from",
57-
"@babel/plugin-proposal-numeric-separator",
58-
"@babel/plugin-proposal-throw-expressions"
59-
]
19+
"babel-plugin-styled-components",
20+
"macros",
21+
"react-hot-loader/babel"
22+
],
23+
24+
"env": {
25+
"production": {
26+
"plugins": ["transform-remove-console"]
27+
},
28+
"test": {
29+
"plugins": ["dynamic-import-node", "syntax-class-properties"]
30+
}
31+
}
6032
}

admin/.eslintignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
./static/
22
webpack.*.js
3-
index.root.js
4-
flow-typed

admin/.eslintrc.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// TODO: do we need airbnb config anymore?
2+
// The `recommended` configs that are already added should suffice
3+
4+
module.exports = {
5+
parser: '@typescript-eslint/parser',
6+
7+
// NOTE: using `plugin:` prefix makes it so that the corresponding
8+
// eslint plugin is automatically enabled and the rules are turned on
9+
extends: [
10+
'standard',
11+
'plugin:react/recommended',
12+
'plugin:@typescript-eslint/recommended',
13+
14+
// Enables eslint-plugin-prettier and displays prettier errors as ESLint errors.
15+
// Make sure this is always the last configuration in the extends array.
16+
'plugin:prettier/recommended',
17+
18+
// Uses eslint-config-prettier to disable ESLint rules from various plugins
19+
// that would conflict with prettier
20+
'prettier/@typescript-eslint',
21+
'prettier/react',
22+
'prettier/standard',
23+
],
24+
25+
parserOptions: {
26+
ecmaVersion: 2018,
27+
sourceType: 'module',
28+
ecmaFeatures: {
29+
jsx: true,
30+
},
31+
// TODO: vscode's eslint extension borks with the following option :(
32+
// project: './tsconfig.json',
33+
},
34+
35+
env: {
36+
browser: true,
37+
jest: true,
38+
},
39+
40+
rules: {
41+
// Turn of stupid TS specific rules
42+
'@typescript-eslint/explicit-function-return-type': 'off',
43+
'@typescript-eslint/explicit-member-accessibility': 'off',
44+
'@typescript-eslint/no-use-before-define': 'off',
45+
'@typescript-eslint/no-explicit-any': 'off',
46+
'@typescript-eslint/no-unused-vars': 'warn',
47+
48+
// Enforce absolute imports to be first
49+
'import/order': [
50+
'error',
51+
{
52+
groups: [
53+
['builtin', 'external', 'internal'],
54+
['parent', 'sibling', 'index'],
55+
],
56+
},
57+
],
58+
59+
'no-var': 'error', // No `var` plz - we are not savages anymore
60+
},
61+
62+
settings: {
63+
react: {
64+
// Tells eslint-plugin-react to automatically detect the version of React to use
65+
version: 'detect',
66+
},
67+
},
68+
};

admin/.eslintrc.yml

Lines changed: 0 additions & 96 deletions
This file was deleted.

admin/.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true
6+
}

admin/assets/README.md

Lines changed: 0 additions & 21 deletions
This file was deleted.
-1.52 KB
Binary file not shown.
-2.91 KB
Binary file not shown.

admin/assets/apple-touch-icon.png

-1.39 KB
Binary file not shown.

admin/assets/browserconfig.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)