Skip to content

Commit 8313a04

Browse files
authored
[WIP] remove @textea/dev-kit from dependencies (#141)
* remove @textea/dev-kit from dependencies * add dependencies extended from @textea/dev-kit * regenerate yarn.lock after changing dependencies
1 parent a7e0dfd commit 8313a04

File tree

8 files changed

+562
-401
lines changed

8 files changed

+562
-401
lines changed

.eslintrc.js

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,106 @@
11
module.exports = {
22
root: true,
3-
extends: './node_modules/@textea/dev-kit/config/eslint',
43
settings: {
54
react: {
65
version: 'detect'
76
}
87
},
98
env: {
109
browser: true, es6: true
11-
}
10+
},
11+
extends: ['eslint:recommended', 'plugin:react/recommended', 'standard'],
12+
globals: {
13+
Atomics: 'readonly', SharedArrayBuffer: 'readonly'
14+
},
15+
parser: '@typescript-eslint/parser',
16+
parserOptions: {
17+
ecmaFeatures: {
18+
globalReturn: false, impliedStrict: true, jsx: true
19+
},
20+
ecmaVersion: 'latest',
21+
sourceType: 'module'
22+
},
23+
plugins: [
24+
'react',
25+
'react-hooks',
26+
'@typescript-eslint',
27+
'simple-import-sort',
28+
'import',
29+
'unused-imports'
30+
],
31+
rules: {
32+
eqeqeq: 'error',
33+
'no-eval': 'error',
34+
'no-var': 'error',
35+
'prefer-const': 'error',
36+
'sort-imports': 'off',
37+
'import/order': 'off',
38+
'simple-import-sort/imports': 'error',
39+
'simple-import-sort/exports': 'error',
40+
'import/first': 'error',
41+
'import/newline-after-import': 'error',
42+
'import/no-duplicates': 'error',
43+
'no-unused-vars': 'off',
44+
'unused-imports/no-unused-imports': 'error',
45+
'unused-imports/no-unused-vars': [
46+
'warn', {
47+
vars: 'all',
48+
varsIgnorePattern: '^_',
49+
args: 'after-used',
50+
argsIgnorePattern: '^_'
51+
}],
52+
'no-use-before-define': 'off',
53+
'@typescript-eslint/no-use-before-define': ['error'],
54+
'no-redeclare': 'off',
55+
'@typescript-eslint/no-redeclare': ['error'],
56+
'no-unused-expressions': 'warn',
57+
'react/jsx-filename-extension': [
58+
1, {
59+
extensions: ['.js', '.jsx', '.ts', '.tsx']
60+
}],
61+
'import/prefer-default-export': 'off',
62+
'jsx-quotes': ['error', 'prefer-single'],
63+
camelcase: 'off',
64+
'react/prop-types': 'off',
65+
'react/display-name': 'off',
66+
'@typescript-eslint/no-var-requires': 'off',
67+
'@typescript-eslint/camelcase': 'off',
68+
'@typescript-eslint/ban-ts-ignore': 'off',
69+
'@typescript-eslint/member-delimiter-style': [
70+
'error', {
71+
multiline: {
72+
delimiter: 'none', requireLast: true
73+
},
74+
singleline: {
75+
delimiter: 'semi', requireLast: false
76+
}
77+
}],
78+
'@typescript-eslint/explicit-function-return-type': 'off',
79+
'react-hooks/rules-of-hooks': 'error',
80+
'react-hooks/exhaustive-deps': 'warn',
81+
'no-restricted-imports': 'off',
82+
'@typescript-eslint/no-restricted-imports': [
83+
'error',
84+
{
85+
patterns: [
86+
{
87+
group: ['**/dist'],
88+
message: 'Don\'t import from dist',
89+
allowTypeImports: false
90+
}
91+
]
92+
}
93+
]
94+
},
95+
overrides: [
96+
{
97+
files: ['*.d.ts'],
98+
rules: {
99+
'no-undef': 'off'
100+
}
101+
},
102+
{
103+
files: ['*.test.ts', '*.test.tsx'], env: { jest: true }
104+
}
105+
]
12106
}

docs/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
"dependencies": {
1010
"@textea/json-viewer": "workspace:^",
1111
"gray-matter": "^4.0.3",
12-
"next": "^12.3.4",
12+
"next": "^13.1.1",
1313
"nextra": "^2.0.0-beta.42",
1414
"nextra-theme-docs": "^2.0.0-beta.42",
1515
"react": "^18.2.0",
1616
"react-dom": "^18.2.0"
1717
},
1818
"devDependencies": {
19-
"@textea/dev-kit": "^1.1.0",
2019
"@types/node": "^18.11.9",
2120
"@types/react": "^18.0.25",
2221
"@types/react-dom": "^18.0.9",

docs/tsconfig.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "@textea/dev-kit/config/tsconfig.root.json",
2+
// "extends": "@textea/dev-kit/config/tsconfig.root.json", // todo: to remove
33
"compilerOptions": {
44
"paths": {
55
"@textea/json-viewer": [
@@ -8,7 +8,23 @@
88
},
99
"jsx": "preserve",
1010
"incremental": true,
11-
"noEmit": true
11+
"noEmit": true,
12+
// "target": "es5",
13+
"target": "ES2020",
14+
"lib": [
15+
"dom",
16+
"dom.iterable",
17+
"esnext"
18+
],
19+
"allowJs": true,
20+
"skipLibCheck": true,
21+
"strict": false,
22+
"forceConsistentCasingInFileNames": true,
23+
"esModuleInterop": true,
24+
"module": "esnext",
25+
"moduleResolution": "node",
26+
"resolveJsonModule": true,
27+
"isolatedModules": true,
1228
},
1329
"include": [
1430
"next-env.d.ts",

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,19 @@
6363
"@emotion/styled": "^11.10.5",
6464
"@mui/icons-material": "^5.11.0",
6565
"@mui/material": "^5.11.1",
66-
"@textea/dev-kit": "^1.1.0",
66+
"@typescript-eslint/eslint-plugin": "^5.40.0",
67+
"@typescript-eslint/parser": "^5.40.0",
6768
"copy-to-clipboard": "^3.3.3",
69+
"eslint": "^8.25.0",
70+
"eslint-config-standard": "^17.0.0",
71+
"eslint-plugin-cypress": "^2.12.1",
72+
"eslint-plugin-import": "^2.26.0",
73+
"eslint-plugin-n": "^15.3.0",
74+
"eslint-plugin-promise": "^6.1.0",
75+
"eslint-plugin-react": "^7.31.10",
76+
"eslint-plugin-react-hooks": "^4.6.0",
77+
"eslint-plugin-simple-import-sort": "^8.0.0",
78+
"eslint-plugin-unused-imports": "^2.0.0",
6879
"group-items": "^2.2.0",
6980
"zustand": "^4.1.5"
7081
},

rollup.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ const external = [
3737
'react',
3838
'react/jsx-runtime',
3939
'react-dom',
40-
'react-dom/client',
41-
'@textea/dev-kit/utils'
40+
'react-dom/client'
4241
]
4342
const outputMatrix = (
4443
name: string, format: ModuleFormat[]): OutputOptions[] => {

src/stores/typeRegistry.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Box } from '@mui/material'
2-
import { DevelopmentError } from '@textea/dev-kit/utils'
32
import React, { memo, SetStateAction, useMemo, useState } from 'react'
43
import create from 'zustand'
54
import createStore from 'zustand/context'
@@ -74,7 +73,7 @@ export function matchTypeComponents<Value> (
7473
if (typeof value === 'object') {
7574
return objectType as unknown as DataType<Value>
7675
}
77-
throw new DevelopmentError('this is not possible')
76+
throw new Error('this is not possible')
7877
}
7978
return potential
8079
}

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
2-
"extends": "./node_modules/@textea/dev-kit/config/tsconfig.root.json",
32
"compilerOptions": {
43
"target": "ES5",
54
"outDir": "./dist/out/",
65
"rootDir": "./src/",
76
"jsx": "react-jsx",
87
"jsxImportSource": "@emotion/react",
98
"incremental": false,
10-
"declaration": true
9+
"declaration": true,
10+
"moduleResolution": "node",
11+
"allowSyntheticDefaultImports": true
1112
},
1213
"include": [
1314
"src/**/*.ts"

0 commit comments

Comments
 (0)