Skip to content

Commit ebb56d6

Browse files
JYC-99Yucong Jin
andauthored
Migrate NX, storybook to latest version (#147)
* chore: update npm dependencies * migrate directories * chore: Remove unnecessary configuration files * update * move files * chore: Update eslint ignorePatterns to include "node_modules" * chore: Remove unnecessary configuration files * update * chore: Refactor test files and update dependencies * Add CODE_OF_CONDUCT.md, LICENSE, SUPPORT.md, and SECURITY.md files * Add Jest runner extension and Jest target to nx.json and tsconfig.json * Update package.json scripts to use yarn * Add test step to GitHub Actions workflow --------- Co-authored-by: Yucong Jin <[email protected]>
1 parent 8cfb0f5 commit ebb56d6

File tree

242 files changed

+157549
-18108
lines changed

Some content is hidden

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

242 files changed

+157549
-18108
lines changed

.editorconfig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
# Editor configuration, see http://editorconfig.org
1+
# editorconfig.org
22
root = true
33

44
[*]
55
charset = utf-8
6-
indent_style = space
76
indent_size = 2
7+
indent_style = space
88
insert_final_newline = true
9+
max_line_length = 120
10+
quote_type = double
911
trim_trailing_whitespace = true
1012

1113
[*.md]
12-
max_line_length = off
1314
trim_trailing_whitespace = false

.eslintrc.json

Lines changed: 68 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"root": true,
33
"ignorePatterns": ["**/*"],
4-
"plugins": ["@nrwl/nx"],
4+
"plugins": ["@nx"],
55
"overrides": [
66
{
77
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8+
"extends": ["plugin:prettier/recommended"],
89
"rules": {
9-
"@nrwl/nx/enforce-module-boundaries": [
10+
"@nx/enforce-module-boundaries": [
1011
"error",
1112
{
1213
"enforceBuildableLibDependency": true,
@@ -18,37 +19,88 @@
1819
}
1920
]
2021
}
22+
]
23+
}
24+
},
25+
{
26+
"files": ["*.ts", "*.tsx"],
27+
"plugins": ["import"],
28+
"extends": ["plugin:@nx/typescript"],
29+
"rules": {
30+
"no-var": "error",
31+
"consistent-return": "error",
32+
"@typescript-eslint/no-shadow": [
33+
"error",
34+
{
35+
"hoist": "all"
36+
}
37+
],
38+
"@typescript-eslint/array-type": [
39+
"error",
40+
{
41+
"default": "array-simple"
42+
}
2143
],
22-
"no-restricted-imports": [
44+
"@typescript-eslint/explicit-function-return-type": "warn",
45+
"@typescript-eslint/no-unused-vars": "off",
46+
"@typescript-eslint/explicit-member-accessibility": [
2347
"error",
2448
{
25-
"name": "lodash",
26-
"message": "Use lodash-es instead"
49+
"accessibility": "explicit",
50+
"overrides": {
51+
"accessors": "off",
52+
"constructors": "off"
53+
}
2754
}
2855
],
29-
"array-callback-return": "error"
56+
"import/no-cycle": [
57+
"warn",
58+
{
59+
"ignoreExternal": true
60+
}
61+
],
62+
"import/no-default-export": "error",
63+
"import/no-duplicates": "error",
64+
"import/no-self-import": "error",
65+
"import/order": [
66+
"error",
67+
{
68+
"alphabetize": {
69+
"order": "asc",
70+
"caseInsensitive": true
71+
}
72+
}
73+
],
74+
"no-console": "error"
3075
}
3176
},
3277
{
33-
"files": ["*.ts", "*.tsx"],
34-
"extends": ["plugin:@nrwl/nx/typescript"],
78+
"files": ["*.tsx"],
79+
"plugins": ["react-refresh"],
80+
"extends": ["plugin:react/recommended", "plugin:react-hooks/recommended"],
3581
"rules": {
36-
"@typescript-eslint/no-empty-interface": "off",
37-
"prefer-spread": "off",
38-
"@typescript-eslint/no-non-null-assertion": "error",
39-
"@typescript-eslint/no-explicit-any": "error",
40-
"@typescript-eslint/no-unused-vars": "error"
82+
"react-refresh/only-export-components": "warn",
83+
"react/jsx-uses-react": "off",
84+
"react/react-in-jsx-scope": "off",
85+
"react/prop-types": "off"
4186
}
4287
},
4388
{
4489
"files": ["*.js", "*.jsx"],
45-
"extends": ["plugin:@nrwl/nx/javascript"],
90+
"extends": ["plugin:@nx/javascript"],
91+
"rules": {}
92+
},
93+
{
94+
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
95+
"env": {
96+
"jest": true
97+
},
4698
"rules": {}
4799
},
48100
{
49-
"files": ["*.test.ts", "*.test.tsx"],
101+
"files": ["*.stories.tsx", "*.stories.jsx", "vite.config.ts", ".storybook/**"],
50102
"rules": {
51-
"@typescript-eslint/no-non-null-assertion": "warn"
103+
"import/no-default-export": "off"
52104
}
53105
}
54106
]

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# See http://help.github.com/ignore-files/ for more about ignoring files.
22

33
# compiled output
4-
/dist
5-
/tmp
4+
dist
5+
tmp
66
/out-tsc
77

88
# dependencies
9-
/node_modules
9+
node_modules
1010

1111
# IDEs and editors
1212
/.idea
@@ -37,3 +37,8 @@ testem.log
3737
# System Files
3838
.DS_Store
3939
Thumbs.db
40+
41+
.nx/cache
42+
43+
44+
storybook-static

.husky/pre-commit

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

.prettierignore

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
# Add files here to ignore them from prettier formatting
2-
3-
**/*.*
4-
!**/*.ts
5-
!**/*.tsx
6-
!**/*.js
7-
!**/*.jsx
8-
!**/*.json
9-
!**/*.mjs
10-
!**/*.mts
11-
!.eslintignore
12-
!.eslintrc
13-
142
/dist
153
/coverage
4+
/.nx/cache
5+
.yarn

.prettierrc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"endOfLine": "lf",
3-
"printWidth": 80,
4-
"semi": true,
5-
"singleQuote": false,
6-
"useTabs": false
2+
"endOfLine": "auto",
3+
"trailingComma": "all",
4+
"arrowParens": "avoid"
75
}

.storybook/main.js

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

.storybook/tsconfig.json

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

.vscode/extensions.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
{
2-
"recommendations": [
3-
"dbaeumer.vscode-eslint",
4-
"esbenp.prettier-vscode",
5-
"mrmlnc.vscode-scss",
6-
"streetsidesoftware.code-spell-checker"
7-
]
2+
"recommendations": ["nrwl.angular-console", "esbenp.prettier-vscode", "firsttris.vscode-jest-runner"]
83
}

.vscode/launch.json

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

0 commit comments

Comments
 (0)