Skip to content

Commit 89957b7

Browse files
committed
feat(init): setting up the development environment
1 parent 85e97a7 commit 89957b7

10 files changed

+4447
-0
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
dist/
3+
.idea
4+
.cache
5+
*.tgz
6+
.DS_Store

.npmignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
node_modules
2+
.idea
3+
/src
4+
/demo
5+
/test
6+
.prettierrc
7+
tsconfig.json
8+
tsconfig.build.json
9+
tslint.json
10+
yarn.lock
11+
*.tgz
12+
.cache
13+
jest.config.js

.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 100,
3+
"semi": false,
4+
"trailingComma": "all",
5+
"singleQuote": true,
6+
"arrowParens": "always",
7+
"jsxBracketSameLine": false,
8+
"bracketSpacing": true
9+
}

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# [WIP]Ayanami
2+
A better way to react with state.

jest.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const { pathsToModuleNameMapper } = require('ts-jest/utils')
2+
3+
const { compilerOptions } = require('./tsconfig.json')
4+
5+
module.exports = {
6+
preset: 'ts-jest',
7+
testEnvironment: 'node',
8+
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
9+
}

package.json

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"name": "ayanami",
3+
"version": "0.0.1",
4+
"description": "A better way to react with state",
5+
"main": "./dist/index.js",
6+
"types": "./dist/index.d.ts",
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/LeetCode-OpenSource/ayanami.git"
10+
},
11+
"bugs": {
12+
"url": "https://github.com/LeetCode-OpenSource/ayanami/issues"
13+
},
14+
"homepage": "https://github.com/LeetCode-OpenSource/ayanami#readme",
15+
"scripts": {
16+
"build": "rm -rf ./dist && tsc -p ./tsconfig.build.json",
17+
"prettier": "prettier '@(src|demo)/**/*.@(ts|tsx|html|less)' --write",
18+
"lint": "tslint -p tsconfig.json --fix",
19+
"test": "jest"
20+
},
21+
"husky": {
22+
"hooks": {
23+
"pre-commit": "lint-staged"
24+
}
25+
},
26+
"lint-staged": {
27+
"*.{ts,tsx}": [
28+
"prettier --write",
29+
"tslint -p tsconfig.json --fix",
30+
"git add"
31+
],
32+
"*.{less,html}": [
33+
"prettier --write",
34+
"git add"
35+
]
36+
},
37+
"keywords": [
38+
"React",
39+
"hooks",
40+
"Observables",
41+
"Observable",
42+
"model",
43+
"state",
44+
"Rx",
45+
"RxJS",
46+
"ReactiveX"
47+
],
48+
"author": "LeetCode front-end team",
49+
"license": "MIT",
50+
"dependencies": {
51+
"reflect-metadata": "^0.1.13",
52+
"rxjs": "^6.4.0",
53+
"shallowequal": "^1.1.0"
54+
},
55+
"devDependencies": {
56+
"@types/jest": "^24.0.11",
57+
"@types/react": "^16.8.10",
58+
"@types/shallowequal": "^1.1.1",
59+
"husky": "^1.3.1",
60+
"jest": "^24.5.0",
61+
"lint-staged": "^8.1.5",
62+
"prettier": "^1.16.4",
63+
"react": "^16.8.6",
64+
"ts-jest": "^24.0.0",
65+
"tslib": "^1.9.3",
66+
"tslint": "^5.14.0",
67+
"tslint-eslint-rules": "^5.4.0",
68+
"tslint-react": "^4.0.0",
69+
"tslint-sonarts": "^1.9.0",
70+
"typescript": "^3.3.4000"
71+
},
72+
"peerDependencies": {
73+
"react": "^16.8.0"
74+
}
75+
}

tsconfig.build.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["src"]
4+
}

tsconfig.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "dist/",
4+
"declaration": true,
5+
"removeComments": true,
6+
"preserveConstEnums": true,
7+
"strict": true,
8+
"emitDecoratorMetadata": true,
9+
"experimentalDecorators": true,
10+
"allowSyntheticDefaultImports": true,
11+
"noUnusedParameters": true,
12+
"noUnusedLocals": true,
13+
"noImplicitAny": true,
14+
"noImplicitReturns": true,
15+
"moduleResolution": "node",
16+
"lib": ["es2015"],
17+
"jsx": "react",
18+
"target": "es5"
19+
},
20+
"include": ["src", "demo", "test"]
21+
}

tslint.json

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"extends": [
3+
"tslint-react",
4+
"tslint-eslint-rules",
5+
"tslint-sonarts"
6+
],
7+
"defaultSeverity": "error",
8+
"rules": {
9+
"array-bracket-spacing": [true, "never", {
10+
"arraysInArrays": false,
11+
"singleValue": false,
12+
"objectsInArrays": false
13+
}],
14+
"jsx-boolean-value": false,
15+
"block-spacing": [true, "always"],
16+
"import-spacing": true,
17+
"no-boolean-literal-compare": true,
18+
"no-console": [true, "log", "time", "trace"],
19+
"no-duplicate-variable": true,
20+
"no-multi-spaces": true,
21+
"no-return-await": true,
22+
"no-string-literal": true,
23+
"no-string-throw": true,
24+
"no-trailing-whitespace": true,
25+
"no-unnecessary-initializer": true,
26+
"no-var-keyword": true,
27+
"object-curly-spacing": [true, "always"],
28+
"one-variable-per-declaration": [true, "ignore-for-loop"],
29+
"prefer-const": true,
30+
"quotemark": [true, "single", "jsx-double"],
31+
"ter-arrow-spacing": [true, { "before": true, "after": true }],
32+
"triple-equals": [true, "allow-null-check", "allow-undefined-check"],
33+
"whitespace": [
34+
true,
35+
"check-branch",
36+
"check-decl",
37+
"check-operator",
38+
"check-module",
39+
"check-separator",
40+
"check-rest-spread",
41+
"check-type",
42+
"check-typecast",
43+
"check-type-operator",
44+
"check-preblock"
45+
],
46+
"interface-over-type-literal": true,
47+
"no-consecutive-blank-lines": true,
48+
"space-before-function-paren": [true, {
49+
"anonymous": "never",
50+
"named": "never",
51+
"asyncArrow": "always"
52+
}],
53+
"space-within-parens": [true, 0],
54+
"jsx-curly-spacing": [true, "never"],
55+
"jsx-no-multiline-js": false,
56+
"jsx-equals-spacing": false,
57+
"jsx-no-bind": true,
58+
"jsx-key": true,
59+
"jsx-no-lambda": true,
60+
"jsx-no-string-ref": true,
61+
"jsx-wrap-multiline": true,
62+
"jsx-self-close": true,
63+
"cognitive-complexity": false,
64+
"no-duplicate-string": false,
65+
"no-big-function": false,
66+
"no-small-switch": false,
67+
"max-union-size": [true, 20],
68+
"parameters-max-number": false
69+
}
70+
}

0 commit comments

Comments
 (0)