@naturalcycles/dev-lib 13.49.2 → 13.51.0

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.
@@ -283,6 +283,7 @@ module.exports = {
283
283
  'no-unused-labels': 2,
284
284
  'no-useless-catch': 2,
285
285
  'no-useless-escape': 2,
286
+ 'no-useless-assignment': 2,
286
287
  'no-unneeded-ternary': 2,
287
288
  'no-duplicate-imports': 0, // too many false-positives (with e.g import type + import on next line)
288
289
  'no-var': 2,
@@ -1,5 +1,6 @@
1
1
  export declare const projectDir: string;
2
2
  export declare const srcDir: string;
3
+ export declare const testDir: string;
3
4
  export declare const cfgDir: string;
4
5
  export declare const cfgOverwriteDir: string;
5
6
  export declare const scriptsDir: string;
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.scriptsDir = exports.cfgOverwriteDir = exports.cfgDir = exports.srcDir = exports.projectDir = void 0;
3
+ exports.scriptsDir = exports.cfgOverwriteDir = exports.cfgDir = exports.testDir = exports.srcDir = exports.projectDir = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const node_path_1 = tslib_1.__importDefault(require("node:path"));
6
6
  exports.projectDir = node_path_1.default.join(__dirname, '../..');
7
7
  exports.srcDir = `${exports.projectDir}/src`;
8
+ exports.testDir = `${exports.srcDir}/test`;
8
9
  exports.cfgDir = `${exports.projectDir}/cfg`;
9
10
  exports.cfgOverwriteDir = `${exports.projectDir}/cfg/overwrite`;
10
11
  exports.scriptsDir = `${exports.projectDir}/scripts`;
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
6
6
  const nodejs_lib_1 = require("@naturalcycles/nodejs-lib");
7
7
  const paths_cnst_1 = require("../cnst/paths.cnst");
8
+ const ESLINT_USE_FLAT_CONFIG = 'false';
8
9
  function getTSConfigPath() {
9
10
  // this is to support "Solution style tsconfig.json" (as used in Angular10, for example)
10
11
  // return [`./tsconfig.base.json`].find(p => fs.existsSync(p)) || `./tsconfig.json`
@@ -18,13 +19,21 @@ exports.getTSConfigPathScripts = getTSConfigPathScripts;
18
19
  function runESLint(dir, eslintConfigPath, tsconfigPath, extensions = ['ts', 'tsx', 'vue'], fix = true) {
19
20
  if (!node_fs_1.default.existsSync(dir))
20
21
  return; // faster to bail-out like this
21
- (0, nodejs_lib_1.execVoidCommandSync)('eslint', getEslintArgs(dir, eslintConfigPath, tsconfigPath, extensions, fix));
22
+ (0, nodejs_lib_1.execVoidCommandSync)('eslint', getEslintArgs(dir, eslintConfigPath, tsconfigPath, extensions, fix), {
23
+ env: {
24
+ ESLINT_USE_FLAT_CONFIG,
25
+ },
26
+ });
22
27
  }
23
28
  exports.runESLint = runESLint;
24
29
  async function runESLintAsync(dir, eslintConfigPath, tsconfigPath, extensions = ['ts', 'tsx', 'vue'], fix = true) {
25
30
  if (!node_fs_1.default.existsSync(dir))
26
31
  return; // faster to bail-out like this
27
- await (0, nodejs_lib_1.execVoidCommand)('eslint', getEslintArgs(dir, eslintConfigPath, tsconfigPath, extensions, fix));
32
+ await (0, nodejs_lib_1.execVoidCommand)('eslint', getEslintArgs(dir, eslintConfigPath, tsconfigPath, extensions, fix), {
33
+ env: {
34
+ ESLINT_USE_FLAT_CONFIG,
35
+ },
36
+ });
28
37
  }
29
38
  exports.runESLintAsync = runESLintAsync;
30
39
  function getEslintArgs(dir, eslintConfigPath, tsconfigPath, extensions = ['ts', 'tsx', 'vue'], fix = true) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
- "version": "13.49.2",
3
+ "version": "13.51.0",
4
4
  "scripts": {
5
5
  "prepare": "husky",
6
6
  "tsn-debug": "tsn testScript.ts",
7
- "bt": "tsn ./src/bin/bt.ts",
7
+ "bt": "tsn ./src/bin/bt.ts && tsn eslintPrintConfig",
8
8
  "btl": "tsn ./src/bin/btl.ts",
9
9
  "build": "tsn ./src/bin/build.ts",
10
10
  "tsc-prod": "tsn ./src/bin/tsc-prod.ts",
@@ -26,7 +26,6 @@
26
26
  "eslint-all": "tsn ./src/bin/eslint-all.ts",
27
27
  "up": "tsn ./src/bin/up.ts",
28
28
  "upnc": "tsn ./src/bin/upnc.ts",
29
- "eslint-print-config": "eslint --print-config src/index.ts > tmp/eslint.config.json",
30
29
  "update-from-dev-lib": "tsn ./src/bin/update-from-dev-lib.ts"
31
30
  },
32
31
  "dependencies": {
@@ -40,12 +39,12 @@
40
39
  "@types/yargs": "^16.0.0",
41
40
  "@typescript-eslint/eslint-plugin": "^7.0.1",
42
41
  "@typescript-eslint/parser": "^7.0.1",
43
- "eslint": "^8.0.0",
42
+ "eslint": "^9.0.0",
44
43
  "eslint-config-prettier": "^9.0.0",
45
44
  "eslint-plugin-import": "^2.22.1",
46
- "eslint-plugin-jest": "^27.0.1",
45
+ "eslint-plugin-jest": "^28.0.0",
47
46
  "eslint-plugin-jsdoc": "^48.0.1",
48
- "eslint-plugin-unicorn": "^51.0.1",
47
+ "eslint-plugin-unicorn": "^52.0.0",
49
48
  "eslint-plugin-unused-imports": "^3.0.0",
50
49
  "eslint-plugin-vue": "^9.0.0",
51
50
  "expect-type": "^0.19.0",