Skip to content

Commit

Permalink
Migrate NX, storybook to latest version (#147)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
JYC-99 and Yucong Jin authored May 30, 2024
1 parent 8cfb0f5 commit ebb56d6
Show file tree
Hide file tree
Showing 242 changed files with 157,549 additions and 18,108 deletions.
7 changes: 4 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Editor configuration, see http://editorconfig.org
# editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 120
quote_type = double
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
84 changes: 68 additions & 16 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"extends": ["plugin:prettier/recommended"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -18,37 +19,88 @@
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"plugins": ["import"],
"extends": ["plugin:@nx/typescript"],
"rules": {
"no-var": "error",
"consistent-return": "error",
"@typescript-eslint/no-shadow": [
"error",
{
"hoist": "all"
}
],
"@typescript-eslint/array-type": [
"error",
{
"default": "array-simple"
}
],
"no-restricted-imports": [
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
"name": "lodash",
"message": "Use lodash-es instead"
"accessibility": "explicit",
"overrides": {
"accessors": "off",
"constructors": "off"
}
}
],
"array-callback-return": "error"
"import/no-cycle": [
"warn",
{
"ignoreExternal": true
}
],
"import/no-default-export": "error",
"import/no-duplicates": "error",
"import/no-self-import": "error",
"import/order": [
"error",
{
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"no-console": "error"
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"files": ["*.tsx"],
"plugins": ["react-refresh"],
"extends": ["plugin:react/recommended", "plugin:react-hooks/recommended"],
"rules": {
"@typescript-eslint/no-empty-interface": "off",
"prefer-spread": "off",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-unused-vars": "error"
"react-refresh/only-export-components": "warn",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {}
},
{
"files": ["*.test.ts", "*.test.tsx"],
"files": ["*.stories.tsx", "*.stories.jsx", "vite.config.ts", ".storybook/**"],
"rules": {
"@typescript-eslint/no-non-null-assertion": "warn"
"import/no-default-export": "off"
}
}
]
Expand Down
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
dist
tmp
/out-tsc

# dependencies
/node_modules
node_modules

# IDEs and editors
/.idea
Expand Down Expand Up @@ -37,3 +37,8 @@ testem.log
# System Files
.DS_Store
Thumbs.db

.nx/cache


storybook-static
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

14 changes: 2 additions & 12 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# Add files here to ignore them from prettier formatting

**/*.*
!**/*.ts
!**/*.tsx
!**/*.js
!**/*.jsx
!**/*.json
!**/*.mjs
!**/*.mts
!.eslintignore
!.eslintrc

/dist
/coverage
/.nx/cache
.yarn
8 changes: 3 additions & 5 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"endOfLine": "lf",
"printWidth": 80,
"semi": true,
"singleQuote": false,
"useTabs": false
"endOfLine": "auto",
"trailingComma": "all",
"arrowParens": "avoid"
}
10 changes: 0 additions & 10 deletions .storybook/main.js

This file was deleted.

10 changes: 0 additions & 10 deletions .storybook/tsconfig.json

This file was deleted.

7 changes: 1 addition & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"mrmlnc.vscode-scss",
"streetsidesoftware.code-spell-checker"
]
"recommendations": ["nrwl.angular-console", "esbenp.prettier-vscode", "firsttris.vscode-jest-runner"]
}
18 changes: 0 additions & 18 deletions .vscode/launch.json

This file was deleted.

Loading

0 comments on commit ebb56d6

Please sign in to comment.