@domain.js/main 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.js CHANGED
@@ -1,67 +1,32 @@
1
1
  module.exports = {
2
- parser: "@typescript-eslint/parser",
3
- plugins: ["@typescript-eslint"],
4
- extends: ["airbnb", "eslint:recommended", "plugin:@typescript-eslint/recommended"],
5
- ignorePatterns: [".eslintrc.js"],
6
- root: true,
2
+ parser: "@typescript-eslint/parser", // 解析ts 代码编译器,将ts 语法树转化为 eslint 期望的
3
+ extends: ["alloy", "alloy/typescript"],
4
+ plugins: ["simple-import-sort", "unused-imports"],
7
5
  env: {
8
- es6: true,
6
+ // Your environments (which contains several predefined global variables)
7
+ //
9
8
  node: true,
10
- jest: true,
9
+ commonjs: true,
10
+ es6: true,
11
11
  },
12
- settings: {
13
- react: {
14
- version: "999.999.999",
15
- },
12
+ globals: {
13
+ // Your global variables (setting to false means it's not allowed to be reassigned)
14
+ //
15
+ // myGlobal: false
16
16
  },
17
17
  rules: {
18
- "nonblock-statement-body-position": "off",
19
- "operator-linebreak": ["error", "after"],
20
- "prefer-destructuring": ["error", { object: true, array: true }],
21
- indent: ["error", 2],
22
- "no-use-before-define": ["error", { functions: true, classes: true, variables: true }],
23
- "no-param-reassign": 0,
24
- "no-continue": 0,
25
- "no-console": 0,
26
- "no-debugger": 1,
27
- "no-var": 1,
28
- semi: ["error", "always"],
29
- "no-trailing-spaces": "error",
30
- "eol-last": 1,
31
- "no-underscore-dangle": 0,
32
- "no-empty": "error",
33
- "no-loop-func": "error",
34
- "no-bitwise": "off", // "error",
35
- quotes: ["error", "double"],
36
- "comma-dangle": ["error", "only-multiline"],
37
- "arrow-parens": ["error", "always"],
38
- "object-curly-newline": 0,
39
- "function-paren-newline": 0,
40
- "implicit-arrow-linebreak": 0,
41
- curly: 0,
42
- "no-mixed-operators": "error",
43
- "no-restricted-syntax": 0,
44
- "no-lone-blocks": "error",
45
- "lines-between-class-members": "off",
46
- yoda: "error",
47
- "no-plusplus": 0,
48
- "import/export": 0,
49
- "no-cond-assign": "error",
50
- "no-shadow": 0,
51
- camelcase: 0,
52
- "prefer-destructuring": 0,
53
- "import/prefer-default-export": "off",
54
- "newline-per-chained-call": 0,
55
- "@typescript-eslint/interface-name-prefix": "off",
56
- "@typescript-eslint/explicit-function-return-type": "off",
57
- "@typescript-eslint/explicit-module-boundary-types": "off",
58
- "@typescript-eslint/no-explicit-any": "off",
59
- "@typescript-eslint/no-namespace": 0,
60
- "@typescript-eslint/ban-types": 0,
61
- "import/export": 0,
62
- "import/no-unresolved": 0,
63
- "import/extensions": 0,
64
- "@typescript-eslint/no-var-requires": 0,
65
- "@typescript-eslint/no-this-alias": 0,
18
+ // Customize your rules
19
+ "spaced-comment": "off", // 注释前有空白检查
20
+ "simple-import-sort/imports": "error", // 优化import 顺序
21
+ "simple-import-sort/exports": "error", // 优化 export 顺序
22
+ "no-multiple-empty-lines": ["warn", { max: 2 }], // 强制最大连续空行数为 2
23
+ complexity: ["error", 20], // https://cn.eslint.org/docs/rules/complexity
24
+ "no-template-curly-in-string": "error", //禁止在常规字符串中出现模板字面量占位符语法
25
+ "unused-imports/no-unused-imports": "warn",
26
+ "@typescript-eslint/explicit-member-accessibility": "off", // 不强制设置类成员的可访问性
27
+ "@typescript-eslint/member-ordering": "off", // 不严格限制类成员顺序
28
+ "max-params": ["error", 6], // 函数最多6个参数
29
+ "@typescript-eslint/no-require-imports": "off", // 部分第三方库不支持 esModuleInterop 编译选项
30
+ "@typescript-eslint/prefer-optional-chain": "off", // 过多使用可选操作符降低代码可读性 foo?.a?.b?.c
66
31
  },
67
32
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domain.js/main",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "DDD framework",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -22,21 +22,24 @@
22
22
  "@typescript-eslint/parser": "^4.22.0",
23
23
  "babel-eslint": "^10.1.0",
24
24
  "codecov": "^3.8.3",
25
- "eslint": "^7.11.0",
25
+ "eslint": "^8.8.0",
26
26
  "eslint-config-airbnb": "^18.2.0",
27
+ "eslint-config-alloy": "^4.4.0",
27
28
  "eslint-config-prettier": "^8.3.0",
28
29
  "eslint-plugin-import": "^2.22.1",
29
30
  "eslint-plugin-jsx-a11y": "^6.3.1",
30
31
  "eslint-plugin-prettier": "^3.4.0",
31
32
  "eslint-plugin-react": "^7.21.4",
33
+ "eslint-plugin-simple-import-sort": "^7.0.0",
34
+ "eslint-plugin-unused-imports": "^2.0.0",
32
35
  "husky": "^7.0.0",
33
36
  "jest": "^27.3.1",
34
37
  "lint-staged": "^11.0.0",
35
38
  "prettier": "^2.3.0",
36
39
  "sequelize-json-schema": "^2.1.1",
37
40
  "ts-jest": "^27.0.7",
38
- "ts-node": "^10.4.0",
39
- "typescript": "^4.5.2"
41
+ "ts-node": "^10.5.0",
42
+ "typescript": "^4.5.5"
40
43
  },
41
44
  "prettier": {
42
45
  "printWidth": 100,
package/tsconfig.json CHANGED
@@ -6,7 +6,8 @@
6
6
  "declaration": true,
7
7
  "outDir": "./dist",
8
8
  "strict": true,
9
- "rootDir": "./src/"
9
+ "rootDir": "./src/",
10
+ "esModuleInterop": true
10
11
  },
11
12
  "include": ["./"],
12
13
  "exclude": ["./src/**/*.test.ts", "./src/**/samples/*", "node_modules", "dist"]