e22m4u 3 дней назад
Родитель
Сommit
0a6a874761
7 измененных файлов с 32 добавлено и 15 удалено
  1. 0 4
      .mocharc.cjs
  2. 4 0
      .mocharc.json
  3. 1 0
      dist/cjs/index.cjs
  4. 15 1
      eslint.config.js
  5. 8 5
      package.json
  6. 1 2
      src/empty-values-service.js
  7. 3 3
      tsconfig.json

+ 0 - 4
.mocharc.cjs

@@ -1,4 +0,0 @@
-module.exports = {
-  extension: ['js'],
-  spec: 'src/**/*.spec.js',
-}

+ 4 - 0
.mocharc.json

@@ -0,0 +1,4 @@
+{
+  "extension": ["js"],
+  "spec": "src/**/*.spec.js"
+}

+ 1 - 0
dist/cjs/index.cjs

@@ -1,3 +1,4 @@
+"use strict";
 var __defProp = Object.defineProperty;
 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
 var __getOwnPropNames = Object.getOwnPropertyNames;

+ 15 - 1
eslint.config.js

@@ -1,6 +1,8 @@
 import globals from 'globals';
 import eslintJs from '@eslint/js';
+import eslintJsdocPlugin from 'eslint-plugin-jsdoc';
 import eslintMochaPlugin from 'eslint-plugin-mocha';
+import eslintImportPlugin from 'eslint-plugin-import';
 import eslintPrettierConfig from 'eslint-config-prettier';
 import eslintChaiExpectPlugin from 'eslint-plugin-chai-expect';
 
@@ -13,14 +15,26 @@ export default [{
     },
   },
   plugins: {
+    'jsdoc': eslintJsdocPlugin,
     'mocha': eslintMochaPlugin,
+    'import': eslintImportPlugin,
     'chai-expect': eslintChaiExpectPlugin,
   },
   rules: {
     ...eslintJs.configs.recommended.rules,
     ...eslintPrettierConfig.rules,
-     ...eslintMochaPlugin.configs.recommended.rules,
+    ...eslintImportPlugin.flatConfigs.recommended.rules,
+    ...eslintMochaPlugin.configs.recommended.rules,
     ...eslintChaiExpectPlugin.configs['recommended-flat'].rules,
+    ...eslintJsdocPlugin.configs['flat/recommended-error'].rules,
+    'no-duplicate-imports': 'error',
+    'import/export': 0,
+    'jsdoc/reject-any-type': 0,
+    'jsdoc/reject-function-type': 0,
+    'jsdoc/require-param-description': 0,
+    'jsdoc/require-returns-description': 0,
+    'jsdoc/require-property-description': 0,
+    'jsdoc/tag-lines': ['error', 'any', {startLines: 1}],
   },
   files: ['src/**/*.js'],
 }];

+ 8 - 5
package.json

@@ -10,10 +10,10 @@
     "value",
     "undefined"
   ],
-  "homepage": "https://github.com/e22m4u/js-empty-values",
+  "homepage": "https://gitrepos.ru/e22m4u/js-empty-values",
   "repository": {
     "type": "git",
-    "url": "git+https://github.com/e22m4u/js-empty-values.git"
+    "url": "git+https://gitrepos.ru/e22m4u/js-empty-values.git"
   },
   "type": "module",
   "types": "./src/index.d.ts",
@@ -37,13 +37,14 @@
     "prepare": "husky"
   },
   "dependencies": {
-    "@e22m4u/js-format": "~0.2.1",
-    "@e22m4u/js-service": "~0.4.6"
+    "@e22m4u/js-format": "~0.3.0",
+    "@e22m4u/js-service": "~0.5.0"
   },
   "devDependencies": {
     "@commitlint/cli": "~20.1.0",
     "@commitlint/config-conventional": "~20.0.0",
     "@eslint/js": "~9.39.1",
+    "@types/chai": "~5.2.3",
     "@types/mocha": "~10.0.10",
     "c8": "~10.1.3",
     "chai": "~6.2.1",
@@ -51,11 +52,13 @@
     "eslint": "~9.39.1",
     "eslint-config-prettier": "~10.1.8",
     "eslint-plugin-chai-expect": "~3.1.0",
+    "eslint-plugin-import": "~2.32.0",
+    "eslint-plugin-jsdoc": "~61.4.1",
     "eslint-plugin-mocha": "~11.2.0",
     "globals": "~16.5.0",
     "husky": "~9.1.7",
     "mocha": "~11.7.5",
-    "prettier": "~3.7.2",
+    "prettier": "~3.7.4",
     "rimraf": "~6.1.2",
     "typescript": "~5.9.3"
   }

+ 1 - 2
src/empty-values-service.js

@@ -1,8 +1,7 @@
 import {DataType} from './data-type.js';
 import {Errorf} from '@e22m4u/js-format';
 import {Service} from '@e22m4u/js-service';
-import {isDeepEqual} from './utils/index.js';
-import {getDataTypeOf} from './utils/index.js';
+import {isDeepEqual, getDataTypeOf} from './utils/index.js';
 
 /**
  * Empty values service.

+ 3 - 3
tsconfig.json

@@ -1,11 +1,11 @@
 {
   "compilerOptions": {
-    "noEmit": true,
+    "strict": true,
     "target": "es2022",
     "module": "NodeNext",
     "moduleResolution": "NodeNext",
-    "allowJs": true,
-    "checkJs": true
+    "noEmit": true,
+    "allowJs": true
   },
   "include": [
     "./src/**/*.ts",