Skip to content

Commit 4889f0f

Browse files
committed
monorepo support
1 parent 04ec41e commit 4889f0f

File tree

182 files changed

+11868
-10690
lines changed

Some content is hidden

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

182 files changed

+11868
-10690
lines changed

.eslintrc.js

+10-59
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,23 @@
11
module.exports = {
2+
root: true,
23
env: {
3-
browser: true,
4-
es2021: true,
5-
jest: true,
4+
node: true,
65
},
7-
extends: [
8-
"eslint:recommended",
9-
"plugin:import/recommended",
10-
"plugin:import/typescript",
11-
"plugin:react/recommended", // React rules
12-
"plugin:@typescript-eslint/recommended", // TypeScript rules
13-
"plugin:react-hooks/recommended", // React hooks rules
14-
"plugin:jsx-a11y/recommended", // Accessibility rules
15-
"plugin:react/jsx-runtime", // new JSX runtime for react
16-
"prettier",
17-
],
18-
ignorePatterns: [
19-
"node_modules/*",
20-
"script/*",
21-
"dist/*",
22-
"dev/*",
23-
"src/__mocks__/*",
24-
"coverage/*",
25-
"!.prettierrc",
26-
".eslintrc.js",
27-
"babel.config.js",
28-
"postcss.config.js",
29-
"jest.config.js",
30-
], // We don't want to lint generated files nor node_modules, but we want to lint .prettierrc.js (ignored by default by eslint)
316
parser: "@typescript-eslint/parser",
32-
root: true,
33-
parserOptions: {
34-
ecmaFeatures: {
35-
jsx: true,
36-
},
37-
ecmaVersion: 12,
38-
sourceType: "module",
39-
project: "./tsconfig.json",
40-
},
41-
plugins: ["react", "@typescript-eslint", "react-hooks", "prettier", "import"],
42-
settings: {
43-
react: {
44-
version: "detect",
45-
},
46-
"import/parsers": {
47-
"@typescript-eslint/parser": [".ts", ".tsx"],
48-
},
49-
"import/resolver": {
50-
typescript: {
51-
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
52-
53-
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
54-
},
55-
},
56-
},
7+
ignorePatterns: ["node_modules/*", "**/*.js", "dist/*", "dev/*", "coverage/*", "!.prettierrc"],
8+
plugins: ["@typescript-eslint", "prettier", "import"],
9+
extends: ["eslint:recommended", "plugin:import/recommended", "plugin:import/typescript", "plugin:@typescript-eslint/recommended", "prettier"],
5710
rules: {
5811
// General
5912
// "no-console": "warn",
6013

61-
// TypeScript
62-
// We will use TypeScript's types for component props instead
63-
"react/prop-types": "off",
14+
"max-lines": ["error", { max: 400, skipBlankLines: true }],
15+
16+
"import/first": "error",
6417

65-
// No need to import React when using Next.js
66-
// "react/react-in-jsx-scope": "off",
18+
"import/newline-after-import": "error",
6719

68-
// This rule is not compatible with Next.js's <Link /> components
69-
"jsx-a11y/anchor-is-valid": "off",
20+
"import/no-duplicates": "error",
7021

7122
// Why would you want unused vars?
7223
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],

.gitignore

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

33
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
4+
node_modules
75

86
# testing
9-
/coverage
7+
coverage
108

11-
/dist
9+
dist
1210

13-
/dev
11+
dev
1412

15-
# production
16-
/build
13+
.cache
1714

1815
# misc
1916
.DS_Store

.prettierignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
pnpm-lock.yaml
3+
**/dist
4+
**/dev
5+
**/.github
6+
**/.changeset
7+
**/.husky
8+
**/.vscode
9+
**/node_modules

.prettierrc

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
"singleQuote": false,
55
"tabWidth": 2,
66
"useTabs": false,
7-
"printWidth": 160,
8-
"parser": "typescript"
7+
"printWidth": 160
98
}

.swcrc

-19
This file was deleted.

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 MrWangJustToDo
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

jest.config.js

-198
This file was deleted.

0 commit comments

Comments
 (0)