@naturalcycles/dev-lib 14.0.2 → 14.1.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.
@@ -279,7 +279,8 @@ module.exports = {
279
279
  'no-shadow-restricted-names': 2,
280
280
  'no-sparse-arrays': 2,
281
281
  'no-this-before-super': 2,
282
- 'no-throw-literal': 2,
282
+ 'no-throw-literal': 0,
283
+ '@typescript-eslint/only-throw-error': 2,
283
284
  'no-undef': 0, // covered by TS, conflicts with typescript-eslint
284
285
  'no-undef-init': 2,
285
286
  'no-underscore-dangle': 0,
@@ -354,6 +355,9 @@ module.exports = {
354
355
  ],
355
356
  '@typescript-eslint/array-type': 2,
356
357
  '@typescript-eslint/prefer-regexp-exec': 0, // auto-fixer breaks code sometimes!
358
+ '@typescript-eslint/prefer-find': 2,
359
+ 'prefer-promise-reject-errors': 0,
360
+ '@typescript-eslint/prefer-promise-reject-errors': 2,
357
361
  'arrow-parens': [2, 'as-needed'],
358
362
  'arrow-body-style': 0,
359
363
  'unicorn/no-array-callback-reference': 0, // false positives
@@ -405,6 +409,11 @@ module.exports = {
405
409
  '@typescript-eslint/no-unsafe-assignment': 0,
406
410
  '@typescript-eslint/no-unsafe-member-access': 0,
407
411
  '@typescript-eslint/no-unsafe-call': 0,
412
+ '@typescript-eslint/no-unsafe-function-type': 2,
413
+ '@typescript-eslint/no-wrapper-object-types': 2,
414
+ '@typescript-eslint/no-empty-object-type': 2,
415
+ '@typescript-eslint/no-unnecessary-template-expression': 2,
416
+ '@typescript-eslint/no-unnecessary-parameter-property-assignment': 2,
408
417
  '@typescript-eslint/restrict-template-expressions': 0,
409
418
  '@typescript-eslint/no-unsafe-return': 0,
410
419
  '@typescript-eslint/restrict-plus-operands': 0,
@@ -48,5 +48,7 @@ module.exports = {
48
48
  'vue/v-for-delimiter-style': [2, 'of'],
49
49
  'vue/valid-define-options': 2,
50
50
  'vue/eqeqeq': 2,
51
+ 'vue/require-explicit-emits': 2,
52
+ 'vue/require-prop-types': 2,
51
53
  },
52
54
  }
@@ -12,30 +12,37 @@ const tseslint = require('typescript-eslint')
12
12
  const hasJest = require('node:fs').existsSync('./node_modules/jest')
13
13
  // console.log({ hasJest })
14
14
 
15
+ const defaultFiles = ['**/*.ts', '**/*.tsx']
16
+
15
17
  module.exports = [
16
- eslint.configs.recommended,
18
+ {
19
+ ...eslint.configs.recommended,
20
+ files: defaultFiles,
21
+ },
17
22
  // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-type-checked.ts
18
- ...tseslint.configs.recommendedTypeChecked,
23
+ ...tseslint.configs.recommendedTypeChecked.map(c => ({
24
+ ...c,
25
+ files: defaultFiles,
26
+ })),
19
27
  // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/stylistic-type-checked.ts
20
- ...tseslint.configs.stylisticTypeChecked,
28
+ ...tseslint.configs.stylisticTypeChecked.map(c => ({
29
+ ...c,
30
+ files: defaultFiles,
31
+ })),
21
32
  // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/configs/recommended.js
22
- require('eslint-plugin-unicorn').configs['flat/recommended'],
23
- // https://eslint.vuejs.org/user-guide/#user-guide
24
- ...require('eslint-plugin-vue').configs['flat/recommended'],
25
33
  {
26
- files: ['**/*.ts', '**/*.tsx'],
27
- ...getConfig(),
34
+ ...require('eslint-plugin-unicorn').configs['flat/recommended'],
35
+ files: defaultFiles,
28
36
  },
37
+ // https://eslint.vuejs.org/user-guide/#user-guide
38
+ // ...require('eslint-plugin-vue').configs['flat/recommended'],
39
+ ...require('eslint-plugin-vue').configs['flat/recommended'].map(c => ({
40
+ ...c,
41
+ files: defaultFiles,
42
+ })),
29
43
  {
30
- files: ['*.vue', '**/*.vue'],
31
- languageOptions: {
32
- parserOptions: {
33
- project: 'tsconfig.json',
34
- parser: tseslint.parser,
35
- },
36
- },
37
- plugins: getConfig().plugins,
38
- rules: getConfig().rules,
44
+ files: defaultFiles,
45
+ ...getConfig(),
39
46
  },
40
47
  {
41
48
  ignores: ['**/__exclude/**', '**/*.scss', '**/*.js'],
@@ -62,10 +69,10 @@ function getConfig() {
62
69
  // testcafe
63
70
  fixture: 'readonly',
64
71
  },
65
- parser: tseslint.parser,
72
+ // parser: tseslint.parser,
66
73
  parserOptions: {
67
74
  project: 'tsconfig.json',
68
- ecmaVersion: 'latest',
75
+ parser: tseslint.parser,
69
76
  extraFileExtensions: ['.vue', '.html'],
70
77
  },
71
78
  },
@@ -109,7 +109,7 @@ function runJest(opt = {}) {
109
109
  }
110
110
  const availableParallelism = node_os_1.default.availableParallelism?.();
111
111
  const cpus = node_os_1.default.cpus().length;
112
- console.log(`${(0, nodejs_lib_1.dimGrey)(Object.entries({
112
+ console.log((0, nodejs_lib_1.dimGrey)(Object.entries({
113
113
  node,
114
114
  NODE_OPTIONS,
115
115
  cpus,
@@ -117,7 +117,7 @@ function runJest(opt = {}) {
117
117
  cpuLimit,
118
118
  })
119
119
  .map(([k, v]) => `${k}: ${v}`)
120
- .join(', '))}`);
120
+ .join(', ')));
121
121
  if (JEST_SHARDS) {
122
122
  const totalShards = Number(JEST_SHARDS);
123
123
  const shards = (0, js_lib_1._range)(1, totalShards + 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
- "version": "14.0.2",
3
+ "version": "14.1.0",
4
4
  "scripts": {
5
5
  "prepare": "husky",
6
6
  "tsn-debug": "tsn testScript.ts",