td-stylekit 28.40.1 → 28.40.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/es/ChartPrimitives/utils.d.ts +1 -1
- package/dist/es/Select/components/MenuList.d.ts +1 -6
- package/dist/es/Select/components/MenuList.js +103 -99
- package/dist/es/utils/comparison.d.ts +1 -1
- package/dist/es/utils/testingLibrary.js +3 -1
- package/package.json +13 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [28.40.3](https://github.com/treasure-data/td-stylekit/compare/v28.40.2...v28.40.3) (2024-06-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **CON-16017:** Remove scrollToIndex from Select Menulist ([#1567](https://github.com/treasure-data/td-stylekit/issues/1567)) ([b25a7f0](https://github.com/treasure-data/td-stylekit/commit/b25a7f03931952f25e1f71d8ce9b2617fc6ef11c))
|
|
7
|
+
|
|
8
|
+
## [28.40.2](https://github.com/treasure-data/td-stylekit/compare/v28.40.1...v28.40.2) (2024-06-06)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* "revert CON-15783: Upgrade emotion" ([#1570](https://github.com/treasure-data/td-stylekit/issues/1570)) ([6c7717a](https://github.com/treasure-data/td-stylekit/commit/6c7717abb774271a7691ebd0b12e2bb05186904c)), closes [#1555](https://github.com/treasure-data/td-stylekit/issues/1555)
|
|
14
|
+
|
|
1
15
|
## [28.40.1](https://github.com/treasure-data/td-stylekit/compare/v28.40.0...v28.40.1) (2024-05-29)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -54,7 +54,7 @@ export type ChartTheme = VictoryThemeDefinition & {
|
|
|
54
54
|
_comparisonColors: string[];
|
|
55
55
|
_axisLabelWidth: number;
|
|
56
56
|
_backgroundStyles: {
|
|
57
|
-
[key: string]:
|
|
57
|
+
[key: string]: any;
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
60
|
export declare function getTheme({ width, height, detailed, grayscale, yAxisLabel, yTickLabel, data, theme }: {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
|
-
import type { ListRowProps } from 'react-virtualized';
|
|
3
1
|
import type { Theme } from '../../ThemeProvider';
|
|
4
2
|
import type { OptionType } from './OptionTypes';
|
|
5
3
|
import type { MenuListComponentProps } from 'react-select';
|
|
@@ -9,8 +7,5 @@ export type MenuListProps = {
|
|
|
9
7
|
rowHeight?: number;
|
|
10
8
|
onMenuScrollToBottom?: () => void;
|
|
11
9
|
} & Omit<MenuListComponentProps<OptionType, boolean>, 'maxHeight'>;
|
|
12
|
-
export declare
|
|
13
|
-
rowRenderer: ({ key, index, style }: ListRowProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
|
-
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
|
-
}
|
|
10
|
+
export declare const MenuList: ({ children, maxHeight, onMenuScrollToBottom, rowHeight, selectProps }: MenuListProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
11
|
//# sourceMappingURL=MenuList.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -12,16 +11,7 @@ var _elements = require("../elements");
|
|
|
12
11
|
var _ThemeProvider = require("../../ThemeProvider");
|
|
13
12
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
14
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
function
|
|
16
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
17
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
18
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
19
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
24
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
25
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27
17
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -41,97 +31,111 @@ var StyledRow = /*#__PURE__*/(0, _base["default"])('div', process.env.NODE_ENV =
|
|
|
41
31
|
}, (0, _ThemeProvider.getOverrides)(_ThemeProvider.Overridable.Select.StyledRow)({
|
|
42
32
|
theme: theme
|
|
43
33
|
}));
|
|
44
|
-
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57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V4PXtzY3JvbGxUb0luZGV4fVxuICAgICAgICAgIG9uUm93c1JlbmRlcmVkPXsoeyBzdG9wSW5kZXggfTogeyBzdG9wSW5kZXg6IG51bWJlciB9KSA9PiB7XG4gICAgICAgICAgICAvLyBMaXN0ZW4gZm9yIHVzZXIgc2Nyb2xsaW5nIHRvIGJvdHRvbSBvZiBsb2FkZWQgbGlzdFxuICAgICAgICAgICAgaWYgKHN0b3BJbmRleCA+PSByb3dDb3VudCAtIDEgJiYgb25NZW51U2Nyb2xsVG9Cb3R0b20pIHtcbiAgICAgICAgICAgICAgb25NZW51U2Nyb2xsVG9Cb3R0b20oKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH19XG4gICAgICAgIC8+XG4gICAgICApfVxuICAgIDwvQXV0b1NpemVyPlxuICApXG59XG4iXX0= */");
|
|
35
|
+
var valueIsOptionType = function valueIsOptionType(value) {
|
|
36
|
+
return !!value && !Array.isArray(value) && _typeof(value) === 'object' && 'value' in value;
|
|
37
|
+
};
|
|
38
|
+
var MenuList = exports.MenuList = function MenuList(_ref2) {
|
|
39
|
+
var children = _ref2.children,
|
|
40
|
+
_ref2$maxHeight = _ref2.maxHeight,
|
|
41
|
+
maxHeight = _ref2$maxHeight === void 0 ? 255 : _ref2$maxHeight,
|
|
42
|
+
onMenuScrollToBottom = _ref2.onMenuScrollToBottom,
|
|
43
|
+
_ref2$rowHeight = _ref2.rowHeight,
|
|
44
|
+
_rowHeight = _ref2$rowHeight === void 0 ? 33 : _ref2$rowHeight,
|
|
45
|
+
selectProps = _ref2.selectProps;
|
|
46
|
+
var rows = Array.isArray(children) ? children : [];
|
|
47
|
+
var initialRowCountRef = (0, _react.useRef)(null);
|
|
48
|
+
var rowCount = rows.length;
|
|
49
|
+
var fullListHeight = rowCount * _rowHeight - 1; // Need to subtract 1px for lack of border bottom on last option
|
|
50
|
+
|
|
51
|
+
// Keep track of the row count to determine if the list has changed since initially rendered
|
|
52
|
+
// This will happen on a paginated list when the user scrolls to the bottom
|
|
53
|
+
if (initialRowCountRef.current === null) {
|
|
54
|
+
initialRowCountRef.current = rowCount;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Find the focused child based on the isFocused prop on the child node
|
|
58
|
+
var focusedChild = rows.find(function (child) {
|
|
59
|
+
return child && child.props.isFocused;
|
|
60
|
+
});
|
|
61
|
+
var focusedOptionIndex = focusedChild ? rows.indexOf(focusedChild) : 0;
|
|
62
|
+
|
|
63
|
+
// Find the selected child based on the select value prop
|
|
64
|
+
// This is needed for a paginated list as the options may not have the isFocused prop
|
|
65
|
+
// or the selected value option hasn't loaded yet
|
|
66
|
+
var value = valueIsOptionType(selectProps.value) ? selectProps.value.value : undefined;
|
|
67
|
+
var selectedValueIndex = value ? rows.findIndex(function (child) {
|
|
68
|
+
return child && child.props.value === value;
|
|
69
|
+
}) : undefined;
|
|
70
|
+
|
|
71
|
+
// If the select is using the paginated onMenuScrollToBottom use the selected value index as the scroll to index
|
|
72
|
+
// but only if the list is not loading or new pages haven't been added, this will prevent flickering
|
|
73
|
+
// with the forced focused scrolling back
|
|
74
|
+
// Otherwise if not paginating use the focused option index which is determined by the isFocused prop on the option
|
|
75
|
+
var scrollToIndex = onMenuScrollToBottom ? selectProps.isLoading || initialRowCountRef.current !== null && initialRowCountRef.current !== rowCount ? undefined : selectedValueIndex : focusedOptionIndex;
|
|
76
|
+
var rowRenderer = function rowRenderer(_ref3) {
|
|
77
|
+
var key = _ref3.key,
|
|
78
|
+
index = _ref3.index,
|
|
79
|
+
style = _ref3.style;
|
|
80
|
+
return (0, _jsxRuntime.jsx)(StyledRow, {
|
|
81
|
+
"data-gs-c": gsC(rows[index]),
|
|
82
|
+
"data-gs": gs("src", "select", "components", "styled-row"),
|
|
83
|
+
style: _objectSpread({}, style),
|
|
84
|
+
children: rows[index]
|
|
85
|
+
}, key);
|
|
86
|
+
};
|
|
87
|
+
if (!rowCount) {
|
|
88
|
+
return (0, _jsxRuntime.jsx)(_elements.NoResultsMessage, {
|
|
89
|
+
"data-gs-c": gsC(selectProps.noResultsMessage || 'No results found'),
|
|
90
|
+
"data-gs": gs("src", "select", "components", "no-results-message"),
|
|
91
|
+
children: selectProps.noResultsMessage || 'No results found'
|
|
64
92
|
});
|
|
65
|
-
return _this;
|
|
66
93
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
return (0, _jsxRuntime.jsx)(_reactVirtualized.AutoSizer, {
|
|
95
|
+
"data-gs-c": gsC(function children(_ref4) {
|
|
96
|
+
var width = _ref4.width;
|
|
97
|
+
return (0, _jsxRuntime.jsx)(_reactVirtualized.List, {
|
|
98
|
+
"data-gs": gs("src", "select", "components", "auto-sizer", "list"),
|
|
99
|
+
width: width,
|
|
100
|
+
height: fullListHeight < maxHeight ? fullListHeight : maxHeight,
|
|
101
|
+
rowCount: rowCount,
|
|
102
|
+
rowHeight: function rowHeight(_ref5) {
|
|
103
|
+
var index = _ref5.index;
|
|
104
|
+
return index === rowCount - 1 ? _rowHeight - 1 : _rowHeight;
|
|
105
|
+
},
|
|
106
|
+
rowRenderer: rowRenderer,
|
|
107
|
+
scrollToIndex: scrollToIndex,
|
|
108
|
+
onRowsRendered: function onRowsRendered(_ref6) {
|
|
109
|
+
var stopIndex = _ref6.stopIndex;
|
|
110
|
+
// Listen for user scrolling to bottom of loaded list
|
|
111
|
+
if (stopIndex >= rowCount - 1 && onMenuScrollToBottom) {
|
|
112
|
+
onMenuScrollToBottom();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
86
115
|
});
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}),
|
|
111
|
-
"data-gs": gs("src", "select", "components", "auto-sizer"),
|
|
112
|
-
disableHeight: true,
|
|
113
|
-
children: function children(_ref3) {
|
|
114
|
-
var width = _ref3.width;
|
|
115
|
-
return (0, _jsxRuntime.jsx)(_reactVirtualized.List, {
|
|
116
|
-
"data-gs": gs("src", "select", "components", "auto-sizer", "list"),
|
|
117
|
-
width: width,
|
|
118
|
-
height: fullListHeight < maxHeight ? fullListHeight : maxHeight,
|
|
119
|
-
rowCount: rowCount,
|
|
120
|
-
rowHeight: function rowHeight(_ref4) {
|
|
121
|
-
var index = _ref4.index;
|
|
122
|
-
return index === rowCount - 1 ? _rowHeight - 1 : _rowHeight;
|
|
123
|
-
},
|
|
124
|
-
rowRenderer: _this2.rowRenderer,
|
|
125
|
-
scrollToIndex: focusedOptionIndex,
|
|
126
|
-
onRowsRendered: function onRowsRendered(_ref5) {
|
|
127
|
-
var stopIndex = _ref5.stopIndex;
|
|
128
|
-
if (stopIndex >= rowCount - 1 && _this2.props.onMenuScrollToBottom) {
|
|
129
|
-
_this2.props.onMenuScrollToBottom();
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
});
|
|
116
|
+
}),
|
|
117
|
+
"data-gs": gs("src", "select", "components", "auto-sizer"),
|
|
118
|
+
disableHeight: true,
|
|
119
|
+
children: function children(_ref4) {
|
|
120
|
+
var width = _ref4.width;
|
|
121
|
+
return (0, _jsxRuntime.jsx)(_reactVirtualized.List, {
|
|
122
|
+
"data-gs": gs("src", "select", "components", "auto-sizer", "list"),
|
|
123
|
+
width: width,
|
|
124
|
+
height: fullListHeight < maxHeight ? fullListHeight : maxHeight,
|
|
125
|
+
rowCount: rowCount,
|
|
126
|
+
rowHeight: function rowHeight(_ref5) {
|
|
127
|
+
var index = _ref5.index;
|
|
128
|
+
return index === rowCount - 1 ? _rowHeight - 1 : _rowHeight;
|
|
129
|
+
},
|
|
130
|
+
rowRenderer: rowRenderer,
|
|
131
|
+
scrollToIndex: scrollToIndex,
|
|
132
|
+
onRowsRendered: function onRowsRendered(_ref6) {
|
|
133
|
+
var stopIndex = _ref6.stopIndex;
|
|
134
|
+
if (stopIndex >= rowCount - 1 && onMenuScrollToBottom) {
|
|
135
|
+
onMenuScrollToBottom();
|
|
136
|
+
}
|
|
133
137
|
}
|
|
134
138
|
});
|
|
135
139
|
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
140
|
+
});
|
|
141
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isOneOf(one: any, of:
|
|
1
|
+
export declare function isOneOf(one: any, of: any): boolean;
|
|
2
2
|
//# sourceMappingURL=comparison.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "td-stylekit",
|
|
3
|
-
"version": "28.40.
|
|
3
|
+
"version": "28.40.3",
|
|
4
4
|
"main": "dist/es/index.js",
|
|
5
5
|
"module": "dist/es/index.js",
|
|
6
6
|
"types": "dist/es/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"build:icons": "node bin/icons/build.js > dist/es/Icon/types.js",
|
|
30
30
|
"build:icons:types": "bin/icons/build.js types > src/Icon/staticTypes.ts",
|
|
31
31
|
"build:types": "tsc --declaration --emitDeclarationOnly --declarationMap && cp -r dist/es/src/* dist/es/",
|
|
32
|
-
"lint": "eslint .
|
|
32
|
+
"lint": "eslint .",
|
|
33
33
|
"release": "semantic-release",
|
|
34
34
|
"start": "yarn docs:start",
|
|
35
35
|
"tdd": "yarn test:unit --watch",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@babel/runtime": "7.24.5",
|
|
45
|
-
"@emotion/is-prop-valid": "^1.
|
|
46
|
-
"@emotion/jest": "^11.
|
|
47
|
-
"@emotion/react": "^11.
|
|
45
|
+
"@emotion/is-prop-valid": "^1.1.1",
|
|
46
|
+
"@emotion/jest": "^11.7.1",
|
|
47
|
+
"@emotion/react": "^11.7.1",
|
|
48
48
|
"@emotion/styled": "^11.6.0",
|
|
49
49
|
"@reach/dialog": "^0.11.2",
|
|
50
50
|
"@reach/tabs": "^0.10.5",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@babel/cli": "7.24.5",
|
|
93
93
|
"@babel/core": "7.24.5",
|
|
94
|
-
"@babel/eslint-parser": "7.24.
|
|
94
|
+
"@babel/eslint-parser": "^7.24.6",
|
|
95
95
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
96
96
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
97
97
|
"@babel/plugin-proposal-optional-chaining": "^7.18.9",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"@commitlint/config-conventional": "^8.2.0",
|
|
103
103
|
"@commitlint/lint": "^12.1.4",
|
|
104
104
|
"@commitlint/load": "^12.1.4",
|
|
105
|
-
"@emotion/babel-preset-css-prop": "^11.
|
|
105
|
+
"@emotion/babel-preset-css-prop": "^11.2.0",
|
|
106
106
|
"@octokit/rest": "^18.12.0",
|
|
107
107
|
"@semantic-release/changelog": "^5.0.1",
|
|
108
108
|
"@semantic-release/commit-analyzer": "^8.0.1",
|
|
@@ -156,9 +156,8 @@
|
|
|
156
156
|
"@types/react-virtualized": "^9.21.10",
|
|
157
157
|
"@types/semantic-release": "^17.1.0",
|
|
158
158
|
"@types/testing-library__jest-dom": "^5.0.0",
|
|
159
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
160
|
-
"@typescript-eslint/parser": "^
|
|
161
|
-
"babel-eslint": "^10.1.0",
|
|
159
|
+
"@typescript-eslint/eslint-plugin": "^7.11.0",
|
|
160
|
+
"@typescript-eslint/parser": "^7.11.0",
|
|
162
161
|
"babel-jest": "29.7.0",
|
|
163
162
|
"babel-loader": "9.1.3",
|
|
164
163
|
"babel-plugin-autoinstrument": "2.1.3",
|
|
@@ -171,14 +170,13 @@
|
|
|
171
170
|
"dependency-cruiser": "^12.11.0",
|
|
172
171
|
"differencify": "^1.5.5",
|
|
173
172
|
"empty": "^0.10.1",
|
|
174
|
-
"eslint": "^
|
|
173
|
+
"eslint": "^8.57.0",
|
|
175
174
|
"eslint-config-prettier": "^6.4.0",
|
|
176
175
|
"eslint-config-standard": "^14.1.0",
|
|
177
176
|
"eslint-config-standard-jsx": "^8.1.0",
|
|
178
|
-
"eslint-import-resolver-typescript": "^
|
|
179
|
-
"eslint-plugin-deprecation": "^1.
|
|
180
|
-
"eslint-plugin-
|
|
181
|
-
"eslint-plugin-import": "^2.8.0",
|
|
177
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
178
|
+
"eslint-plugin-deprecation": "^1.3.0",
|
|
179
|
+
"eslint-plugin-import": "^2.27.2",
|
|
182
180
|
"eslint-plugin-node": "^10.0.0",
|
|
183
181
|
"eslint-plugin-prettier": "^3.1.1",
|
|
184
182
|
"eslint-plugin-promise": "^4.2.1",
|