Skip to content

Commit 9580a11

Browse files
committed
remove jest in favor of vitest
1 parent 60fa004 commit 9580a11

89 files changed

Lines changed: 18164 additions & 20411 deletions

File tree

Some content is hidden

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

.eslintignore

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

eslint.config.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import typescriptParser from '@typescript-eslint/parser';
55
import prettierPluginRecommended from 'eslint-plugin-prettier/recommended';
66
import reactPlugin from 'eslint-plugin-react';
77
import reactHooksPlugin from 'eslint-plugin-react-hooks';
8+
import globals from 'globals';
89

910
export default [
1011
// global
@@ -18,6 +19,22 @@ export default [
1819
importPlugin.flatConfigs.recommended,
1920
prettierPluginRecommended,
2021
{
22+
rules: {
23+
'import/order': [
24+
'error',
25+
{
26+
groups: ['builtin', 'external', 'index', 'internal', 'unknown', 'type'],
27+
pathGroups: [
28+
{
29+
pattern: '*.{css,scss,sass}',
30+
group: 'unknown',
31+
patternOptions: { matchBase: true },
32+
position: 'after',
33+
},
34+
],
35+
},
36+
],
37+
},
2138
settings: {
2239
'import/resolver': {
2340
typescript: {
@@ -37,6 +54,11 @@ export default [
3754
languageOptions: {
3855
ecmaVersion: 'latest',
3956
sourceType: 'module',
57+
globals: {
58+
...globals.browser,
59+
...globals.node,
60+
...globals.nodeBuiltin,
61+
},
4062
},
4163
},
4264
].map((configObj) => ({
@@ -52,6 +74,11 @@ export default [
5274
languageOptions: {
5375
ecmaVersion: 'latest',
5476
sourceType: 'module',
77+
globals: {
78+
browser: true,
79+
node: true,
80+
es6: true,
81+
},
5582
parser: typescriptParser,
5683
parserOptions: {
5784
tsconfigRootDir: import.meta.dirname,
@@ -83,4 +110,37 @@ export default [
83110
},
84111
},
85112
})),
113+
114+
// test
115+
{
116+
files: ['**/test/**/*'],
117+
rules: {
118+
'no-empty': 'off',
119+
'no-shadow': 'off',
120+
'no-use-before-define': 'off',
121+
'no-restricted-syntax': 'off',
122+
'no-console': 'off',
123+
'consistent-return': 'off',
124+
'symbol-description': 'off',
125+
'no-new-wrappers': 'off',
126+
'no-prototype-builtins': 'off',
127+
'no-void': 'off',
128+
'no-empty-function': 'off',
129+
'no-new-func': 'off',
130+
131+
// typescript
132+
'@typescript-eslint/ban-ts-comment': 'off',
133+
'@typescript-eslint/no-explicit-any': 'off',
134+
'@typescript-eslint/no-non-null-assertion': 'off',
135+
'@typescript-eslint/no-empty-function': 'off',
136+
'@typescript-eslint/ban-types': 'off',
137+
'@typescript-eslint/no-floating-promises': 'off',
138+
139+
// react
140+
'react-hooks/rules-of-hooks': 'off',
141+
'react/no-unescaped-entities': 'off',
142+
'react/display-name': 'off',
143+
'react/prop-types': 'off',
144+
},
145+
},
86146
];

local/config/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
"exports": {
66
"./resolve": "./src/resolve.json",
77
"./playwright": "./src/playwright.js",
8-
"./playwright.coverage": "./src/playwright.coverage.js",
9-
"./jest": "./src/jest.js",
10-
"./jest-babel": "./src/jest.babel.cjs",
8+
"./playwright-coverage": "./src/playwright-coverage.js",
119
"./full-coverage": "./src/full-coverage.js",
1210
"./vitest": "./src/vitest.js",
13-
"./vitest.new-jsdom.env": "./src/vitest.new-jsdom.env.js"
11+
"./vitest-coverage": "./src/vitest-coverage.js"
1412
},
1513
"version": "0.0.0"
1614
}

local/config/src/full-coverage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default {
1+
export const fullCoverage = {
22
tmpCoverageDirectory: './.coverage/.nycFull',
33
coverageDirectory: './.coverage/full',
44
};

local/config/src/jest.babel.cjs

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

local/config/src/jest.fileMock.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

local/config/src/jest.js

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

local/config/src/jest.setup.jsdom.js

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

local/config/src/mocks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// eslint-disable-next-line @typescript-eslint/no-empty-function
21
const noop = function () {};
32

43
export const mockAnimationApi = () => {
@@ -46,6 +45,7 @@ export const mockComputedStyles = () => {
4645
try {
4746
const cmptdStyle = window.getComputedStyle;
4847
window.getComputedStyle = (a) => cmptdStyle(a);
48+
// eslint-disable-next-line no-empty
4949
} catch {}
5050
};
5151

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default {
1+
export const playwrightCoverage = {
22
tmpCoverageDirectory: './.coverage/.nycPlaywright',
33
coverageDirectory: './.coverage/e2e',
44
};

0 commit comments

Comments
 (0)