@pezkuwi/dev 0.85.12 → 0.86.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.
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.packageInfo = void 0;
4
- exports.packageInfo = { name: '@pezkuwi/dev', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '0.85.12' };
4
+ exports.packageInfo = { name: '@pezkuwi/dev', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '0.86.0' };
@@ -23,7 +23,6 @@ async function dynamic(a, b) {
23
23
  // NOTE we go via this path so it points to the same location in both ESM
24
24
  // and CJS output (a './dynamic' import would be different otherwise)
25
25
  const { sum } = await import('@pezkuwi/dev/rootJs/dynamic.mjs');
26
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
27
26
  return sum(a, b);
28
27
  }
29
28
  /** Function to ensure we have json correctly imported */
package/config/eslint.js CHANGED
@@ -1,34 +1,44 @@
1
1
  // Copyright 2017-2026 @pezkuwi/dev authors & contributors
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- // @ts-expect-error No definition for this one
4
+ import { fixupPluginRules } from '@eslint/compat';
5
5
  import eslintJs from '@eslint/js';
6
+ import stylisticPlugin from '@stylistic/eslint-plugin';
6
7
  import tsPlugin from '@typescript-eslint/eslint-plugin';
7
8
  import tsParser from '@typescript-eslint/parser';
8
9
  // @ts-expect-error No definition for this one
9
- import standardConfig from 'eslint-config-standard';
10
- import deprecationPlugin from 'eslint-plugin-deprecation';
11
- // @ts-expect-error No definition for this one
12
10
  import headerPlugin from 'eslint-plugin-header';
13
- import importPlugin from 'eslint-plugin-import';
14
11
  // @ts-expect-error No definition for this one
15
12
  import importNewlinesPlugin from 'eslint-plugin-import-newlines';
16
- // @ts-expect-error No definition for this one
13
+ import importPlugin from 'eslint-plugin-import-x';
17
14
  import jestPlugin from 'eslint-plugin-jest';
18
- // @ts-expect-error No definition for this one
19
15
  import nPlugin from 'eslint-plugin-n';
20
16
  // @ts-expect-error No definition for this one
21
17
  import promisePlugin from 'eslint-plugin-promise';
22
18
  import reactPlugin from 'eslint-plugin-react';
23
- // @ts-expect-error No definition for this one
24
19
  import reactHooksPlugin from 'eslint-plugin-react-hooks';
25
- // @ts-expect-error No definition for this one
26
20
  import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
27
21
  // @ts-expect-error No definition for this one
28
22
  import sortDestructureKeysPlugin from 'eslint-plugin-sort-destructure-keys';
29
23
  import globals from 'globals';
30
24
 
31
25
  import { overrideAll, overrideJs, overrideJsx, overrideSpec } from './eslint.rules.js';
26
+ import { standardRules } from './eslint.standard.js';
27
+
28
+ /**
29
+ * eslint-plugin-header declares no options schema, and eslint 9+ rejects
30
+ * options for a rule without one. `schema: false` is how a rule says it
31
+ * validates its own options; the rule itself is unchanged.
32
+ */
33
+ const headerPluginFixed = {
34
+ ...headerPlugin,
35
+ rules: {
36
+ header: {
37
+ ...headerPlugin.rules.header,
38
+ meta: { ...headerPlugin.rules.header.meta, schema: false }
39
+ }
40
+ }
41
+ };
32
42
 
33
43
  const EXT_JS = ['.cjs', '.js', '.mjs'];
34
44
  const EXT_TS = ['.ts', '.tsx'];
@@ -82,23 +92,27 @@ export default [
82
92
  }
83
93
  },
84
94
  plugins: {
95
+ '@stylistic': stylisticPlugin,
85
96
  '@typescript-eslint': tsPlugin,
86
- deprecation: deprecationPlugin,
87
- header: headerPlugin,
88
- import: importPlugin,
97
+ // eslint-plugin-header reports at the first token after the leading
98
+ // comments, so a generated file's /* eslint-disable */ covers it; the
99
+ // maintained fork reports at line 1 instead. The compat layer supplies the
100
+ // context methods eslint 10 removed; headerPluginFixed, the options schema.
101
+ header: fixupPluginRules(headerPluginFixed),
89
102
  'import-newlines': importNewlinesPlugin,
103
+ 'import-x': importPlugin,
90
104
  n: nPlugin,
91
105
  promise: promisePlugin,
92
106
  'simple-import-sort': simpleImportSortPlugin,
93
107
  'sort-destructure-keys': sortDestructureKeysPlugin
94
108
  },
95
109
  settings: {
96
- 'import/extensions': EXT_ALL,
97
- 'import/parsers': {
110
+ 'import-x/extensions': EXT_ALL,
111
+ 'import-x/parsers': {
98
112
  '@typescript-eslint/parser': EXT_TS,
99
113
  espree: EXT_JS
100
114
  },
101
- 'import/resolver': {
115
+ 'import-x/resolver': {
102
116
  node: {
103
117
  extensions: EXT_ALL
104
118
  },
@@ -112,7 +126,7 @@ export default [
112
126
  files: extsToGlobs(EXT_ALL),
113
127
  rules: {
114
128
  ...eslintJs.configs.recommended.rules,
115
- ...standardConfig.rules,
129
+ ...standardRules,
116
130
  ...tsPlugin.configs['recommended-type-checked'].rules,
117
131
  ...tsPlugin.configs['stylistic-type-checked'].rules,
118
132
  ...overrideAll
@@ -130,7 +144,9 @@ export default [
130
144
  '**/use*.ts'
131
145
  ],
132
146
  plugins: {
133
- react: reactPlugin,
147
+ // eslint-plugin-react still calls context methods eslint 10 removed
148
+ // (getFilename and others); the compat layer provides them.
149
+ react: fixupPluginRules(reactPlugin),
134
150
  'react-hooks': reactHooksPlugin
135
151
  },
136
152
  rules: {
@@ -59,12 +59,56 @@ function getHeaderPattern () {
59
59
 
60
60
  export const overrideAll = {
61
61
  ...FIXME,
62
+ '@stylistic/arrow-parens': ['error', 'always'],
63
+ '@stylistic/brace-style': ['error', '1tbs'],
64
+ '@stylistic/function-call-argument-newline': ['error', 'consistent'],
65
+ '@stylistic/indent': ['error', 2],
66
+ '@stylistic/no-extra-semi': 'error',
67
+ '@stylistic/object-curly-newline': ['error', {
68
+ ExportDeclaration: { minProperties: 2048 },
69
+ ImportDeclaration: { minProperties: 2048 },
70
+ ObjectPattern: { minProperties: 2048 }
71
+ }],
72
+ '@stylistic/padding-line-between-statements': [
73
+ 'error',
74
+ { blankLine: 'always', next: '*', prev: ['const', 'let', 'var'] },
75
+ { blankLine: 'any', next: ['const', 'let', 'var'], prev: ['const', 'let', 'var'] },
76
+ { blankLine: 'always', next: 'block-like', prev: '*' },
77
+ { blankLine: 'always', next: '*', prev: 'block-like' },
78
+ { blankLine: 'always', next: 'function', prev: '*' },
79
+ { blankLine: 'always', next: '*', prev: 'function' },
80
+ { blankLine: 'always', next: 'try', prev: '*' },
81
+ { blankLine: 'always', next: '*', prev: 'try' },
82
+ { blankLine: 'always', next: 'return', prev: '*' },
83
+ { blankLine: 'always', next: 'import', prev: '*' },
84
+ { blankLine: 'always', next: '*', prev: 'import' },
85
+ { blankLine: 'any', next: 'import', prev: 'import' }
86
+ ],
87
+ '@stylistic/semi': ['error', 'always'],
88
+ '@stylistic/spaced-comment': ['error', 'always', {
89
+ block: {
90
+ // pure export helpers
91
+ markers: ['#__PURE__']
92
+ },
93
+ line: {
94
+ // TS reference types
95
+ markers: ['/ <reference']
96
+ }
97
+ }],
98
+ '@stylistic/type-annotation-spacing': 'error',
62
99
  // the next 2 enforce isolatedModules & verbatimModuleSyntax
63
100
  '@typescript-eslint/consistent-type-exports': 'error',
64
101
  '@typescript-eslint/consistent-type-imports': 'error',
65
102
  '@typescript-eslint/dot-notation': 'error',
66
- '@typescript-eslint/indent': ['error', 2],
103
+ '@typescript-eslint/no-deprecated': 'error',
67
104
  '@typescript-eslint/no-non-null-assertion': 'error',
105
+ // standard's options for the core rule, which the TypeScript preset turns off
106
+ // in favour of this one (with defaults that reject a && b() and a ? b() : c())
107
+ '@typescript-eslint/no-unused-expressions': ['error', {
108
+ allowShortCircuit: true,
109
+ allowTaggedTemplates: true,
110
+ allowTernary: true
111
+ }],
68
112
  // ts itself checks and ignores those starting with _, align the linting
69
113
  '@typescript-eslint/no-unused-vars': ['error', {
70
114
  args: 'all',
@@ -75,20 +119,15 @@ export const overrideAll = {
75
119
  vars: 'all',
76
120
  varsIgnorePattern: '^_'
77
121
  }],
78
- '@typescript-eslint/type-annotation-spacing': 'error',
79
- 'arrow-parens': ['error', 'always'],
80
- 'brace-style': ['error', '1tbs'],
81
122
  curly: ['error', 'all'],
82
123
  'default-param-last': 'off', // conflicts with TS version
83
- 'deprecation/deprecation': 'error',
84
124
  'dot-notation': 'off', // conflicts with TS version
85
125
  'func-style': ['error', 'declaration', {
86
126
  allowArrowFunctions: true
87
127
  }],
88
128
  // this does help with declarations, but also
89
129
  // applies to invocations, which is an issue...
90
- // 'function-paren-newline': ['error', 'never'],
91
- 'function-call-argument-newline': ['error', 'consistent'],
130
+ // '@stylistic/function-paren-newline': ['error', 'never'],
92
131
  'header/header': ['error', 'line', [
93
132
  { pattern: getHeaderPattern() },
94
133
  ' SPDX-License-Identifier: Apache-2.0'
@@ -97,8 +136,8 @@ export const overrideAll = {
97
136
  forceSingleLine: true,
98
137
  items: 2048
99
138
  }],
100
- 'import/export': 'error',
101
- 'import/extensions': ['error', 'ignorePackages', {
139
+ 'import-x/export': 'error',
140
+ 'import-x/extensions': ['error', 'ignorePackages', {
102
141
  cjs: 'always',
103
142
  js: 'always',
104
143
  json: 'always',
@@ -107,35 +146,12 @@ export const overrideAll = {
107
146
  ts: 'never',
108
147
  tsx: 'never'
109
148
  }],
110
- 'import/first': 'error',
111
- 'import/newline-after-import': 'error',
112
- 'import/no-duplicates': 'error',
113
- 'import/order': 'off', // conflicts with simple-import-sort
114
- indent: 'off', // required as 'off' since typescript-eslint has own versions
115
- 'no-extra-semi': 'error',
149
+ 'import-x/first': 'error',
150
+ 'import-x/newline-after-import': 'error',
151
+ 'import-x/no-duplicates': 'error',
152
+ 'import-x/order': 'off', // conflicts with simple-import-sort
116
153
  'no-unused-vars': 'off',
117
154
  'no-use-before-define': 'off',
118
- 'object-curly-newline': ['error', {
119
- ExportDeclaration: { minProperties: 2048 },
120
- ImportDeclaration: { minProperties: 2048 },
121
- ObjectPattern: { minProperties: 2048 }
122
- }],
123
- 'padding-line-between-statements': [
124
- 'error',
125
- { blankLine: 'always', next: '*', prev: ['const', 'let', 'var'] },
126
- { blankLine: 'any', next: ['const', 'let', 'var'], prev: ['const', 'let', 'var'] },
127
- { blankLine: 'always', next: 'block-like', prev: '*' },
128
- { blankLine: 'always', next: '*', prev: 'block-like' },
129
- { blankLine: 'always', next: 'function', prev: '*' },
130
- { blankLine: 'always', next: '*', prev: 'function' },
131
- { blankLine: 'always', next: 'try', prev: '*' },
132
- { blankLine: 'always', next: '*', prev: 'try' },
133
- { blankLine: 'always', next: 'return', prev: '*' },
134
- { blankLine: 'always', next: 'import', prev: '*' },
135
- { blankLine: 'always', next: '*', prev: 'import' },
136
- { blankLine: 'any', next: 'import', prev: 'import' }
137
- ],
138
- semi: ['error', 'always'],
139
155
  'simple-import-sort/exports': 'error',
140
156
  'simple-import-sort/imports': ['error', {
141
157
  groups: [
@@ -150,55 +166,45 @@ export const overrideAll = {
150
166
  'sort-destructure-keys/sort-destructure-keys': ['error', {
151
167
  caseSensitive: true
152
168
  }],
153
- 'sort-keys': 'error',
154
- 'spaced-comment': ['error', 'always', {
155
- block: {
156
- // pure export helpers
157
- markers: ['#__PURE__']
158
- },
159
- line: {
160
- // TS reference types
161
- markers: ['/ <reference']
162
- }
163
- }]
169
+ 'sort-keys': 'error'
164
170
  };
165
171
 
166
172
  export const overrideJsx = {
167
- 'jsx-quotes': ['error', 'prefer-single'],
168
- // swap from recommended warning to error
169
- 'react-hooks/exhaustive-deps': 'error',
170
- 'react/jsx-closing-bracket-location': ['warn', 'tag-aligned'],
171
- 'react/jsx-first-prop-new-line': ['warn', 'multiline-multiprop'],
172
- 'react/jsx-fragments': 'error',
173
- 'react/jsx-max-props-per-line': ['warn', {
173
+ '@stylistic/jsx-closing-bracket-location': ['warn', 'tag-aligned'],
174
+ '@stylistic/jsx-first-prop-new-line': ['warn', 'multiline-multiprop'],
175
+ '@stylistic/jsx-max-props-per-line': ['warn', {
174
176
  maximum: 1,
175
177
  when: 'always'
176
178
  }],
177
- 'react/jsx-newline': ['error', {
179
+ '@stylistic/jsx-newline': ['error', {
178
180
  prevent: true
179
181
  }],
180
- 'react/jsx-no-bind': 'error',
181
- 'react/jsx-props-no-multi-spaces': 'error',
182
- 'react/jsx-sort-props': ['warn', {
182
+ '@stylistic/jsx-props-no-multi-spaces': 'error',
183
+ '@stylistic/jsx-quotes': ['error', 'prefer-single'],
184
+ '@stylistic/jsx-sort-props': ['warn', {
183
185
  noSortAlphabetically: false
184
186
  }],
185
- 'react/jsx-tag-spacing': ['error', {
187
+ '@stylistic/jsx-tag-spacing': ['error', {
186
188
  afterOpening: 'never',
187
189
  beforeClosing: 'never',
188
190
  beforeSelfClosing: 'always',
189
191
  closingSlash: 'never'
190
192
  }],
193
+ // swap from recommended warning to error
194
+ 'react-hooks/exhaustive-deps': 'error',
195
+ 'react/jsx-fragments': 'error',
196
+ 'react/jsx-no-bind': 'error',
191
197
  'react/prop-types': 'off' // this is a completely broken rule
192
198
  };
193
199
 
194
200
  export const overrideJs = {
195
201
  '@typescript-eslint/explicit-function-return-type': 'off',
202
+ '@typescript-eslint/no-require-imports': 'off',
196
203
  '@typescript-eslint/no-unsafe-argument': 'off',
197
204
  '@typescript-eslint/no-unsafe-assignment': 'off',
198
205
  '@typescript-eslint/no-unsafe-call': 'off',
199
206
  '@typescript-eslint/no-unsafe-member-access': 'off',
200
207
  '@typescript-eslint/no-unsafe-return': 'off',
201
- '@typescript-eslint/no-var-requires': 'off',
202
208
  '@typescript-eslint/restrict-plus-operands': 'off',
203
209
  '@typescript-eslint/restrict-template-expressions': 'off'
204
210
  };
@@ -0,0 +1,585 @@
1
+ // Copyright 2017-2026 @pezkuwi/dev authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ // The rules of eslint-config-standard 17.1.0 (MIT, Copyright Feross Aboukhadijeh,
5
+ // https://github.com/standard/eslint-config-standard), carried here once and with
6
+ // the same options, so the lint stays what it was: that package is written for
7
+ // eslint 8. Its formatting rules are deprecated in eslint core and continue in
8
+ // @stylistic under the same names (func-call-spacing is function-call-spacing
9
+ // there). no-new-object and no-new-symbol, deprecated too, are no-object-constructor
10
+ // and no-new-native-nonconstructor here; import/* is import-x/*.
11
+
12
+ export const standardRules = {
13
+ '@stylistic/array-bracket-spacing': [
14
+ 'error',
15
+ 'never'
16
+ ],
17
+ '@stylistic/arrow-spacing': [
18
+ 'error',
19
+ {
20
+ after: true,
21
+ before: true
22
+ }
23
+ ],
24
+ '@stylistic/block-spacing': [
25
+ 'error',
26
+ 'always'
27
+ ],
28
+ '@stylistic/brace-style': [
29
+ 'error',
30
+ '1tbs',
31
+ {
32
+ allowSingleLine: true
33
+ }
34
+ ],
35
+ '@stylistic/comma-dangle': [
36
+ 'error',
37
+ {
38
+ arrays: 'never',
39
+ exports: 'never',
40
+ functions: 'never',
41
+ imports: 'never',
42
+ objects: 'never'
43
+ }
44
+ ],
45
+ '@stylistic/comma-spacing': [
46
+ 'error',
47
+ {
48
+ after: true,
49
+ before: false
50
+ }
51
+ ],
52
+ '@stylistic/comma-style': [
53
+ 'error',
54
+ 'last'
55
+ ],
56
+ '@stylistic/computed-property-spacing': [
57
+ 'error',
58
+ 'never',
59
+ {
60
+ enforceForClassMembers: true
61
+ }
62
+ ],
63
+ '@stylistic/dot-location': [
64
+ 'error',
65
+ 'property'
66
+ ],
67
+ '@stylistic/eol-last': 'error',
68
+ '@stylistic/function-call-spacing': [
69
+ 'error',
70
+ 'never'
71
+ ],
72
+ '@stylistic/generator-star-spacing': [
73
+ 'error',
74
+ {
75
+ after: true,
76
+ before: true
77
+ }
78
+ ],
79
+ '@stylistic/indent': [
80
+ 'error',
81
+ 2,
82
+ {
83
+ ArrayExpression: 1,
84
+ CallExpression: {
85
+ arguments: 1
86
+ },
87
+ FunctionDeclaration: {
88
+ body: 1,
89
+ parameters: 1
90
+ },
91
+ FunctionExpression: {
92
+ body: 1,
93
+ parameters: 1
94
+ },
95
+ ImportDeclaration: 1,
96
+ MemberExpression: 1,
97
+ ObjectExpression: 1,
98
+ SwitchCase: 1,
99
+ VariableDeclarator: 1,
100
+ flatTernaryExpressions: false,
101
+ ignoreComments: false,
102
+ ignoredNodes: [
103
+ 'TemplateLiteral *',
104
+ 'JSXElement',
105
+ 'JSXElement > *',
106
+ 'JSXAttribute',
107
+ 'JSXIdentifier',
108
+ 'JSXNamespacedName',
109
+ 'JSXMemberExpression',
110
+ 'JSXSpreadAttribute',
111
+ 'JSXExpressionContainer',
112
+ 'JSXOpeningElement',
113
+ 'JSXClosingElement',
114
+ 'JSXFragment',
115
+ 'JSXOpeningFragment',
116
+ 'JSXClosingFragment',
117
+ 'JSXText',
118
+ 'JSXEmptyExpression',
119
+ 'JSXSpreadChild'
120
+ ],
121
+ offsetTernaryExpressions: true,
122
+ outerIIFEBody: 1
123
+ }
124
+ ],
125
+ '@stylistic/key-spacing': [
126
+ 'error',
127
+ {
128
+ afterColon: true,
129
+ beforeColon: false
130
+ }
131
+ ],
132
+ '@stylistic/keyword-spacing': [
133
+ 'error',
134
+ {
135
+ after: true,
136
+ before: true
137
+ }
138
+ ],
139
+ '@stylistic/lines-between-class-members': [
140
+ 'error',
141
+ 'always',
142
+ {
143
+ exceptAfterSingleLine: true
144
+ }
145
+ ],
146
+ '@stylistic/multiline-ternary': [
147
+ 'error',
148
+ 'always-multiline'
149
+ ],
150
+ '@stylistic/new-parens': 'error',
151
+ '@stylistic/no-extra-parens': [
152
+ 'error',
153
+ 'functions'
154
+ ],
155
+ '@stylistic/no-floating-decimal': 'error',
156
+ '@stylistic/no-mixed-operators': [
157
+ 'error',
158
+ {
159
+ allowSamePrecedence: true,
160
+ groups: [
161
+ [
162
+ '==',
163
+ '!=',
164
+ '===',
165
+ '!==',
166
+ '>',
167
+ '>=',
168
+ '<',
169
+ '<='
170
+ ],
171
+ [
172
+ '&&',
173
+ '||'
174
+ ],
175
+ [
176
+ 'in',
177
+ 'instanceof'
178
+ ]
179
+ ]
180
+ }
181
+ ],
182
+ '@stylistic/no-mixed-spaces-and-tabs': 'error',
183
+ '@stylistic/no-multi-spaces': 'error',
184
+ '@stylistic/no-multiple-empty-lines': [
185
+ 'error',
186
+ {
187
+ max: 1,
188
+ maxBOF: 0,
189
+ maxEOF: 0
190
+ }
191
+ ],
192
+ '@stylistic/no-tabs': 'error',
193
+ '@stylistic/no-trailing-spaces': 'error',
194
+ '@stylistic/no-whitespace-before-property': 'error',
195
+ '@stylistic/object-curly-newline': [
196
+ 'error',
197
+ {
198
+ consistent: true,
199
+ multiline: true
200
+ }
201
+ ],
202
+ '@stylistic/object-curly-spacing': [
203
+ 'error',
204
+ 'always'
205
+ ],
206
+ // allowMultiplePropertiesPerLine was core's alias for allowAllPropertiesOnSameLine
207
+ // (the two were OR-ed); @stylistic only takes the latter.
208
+ '@stylistic/object-property-newline': [
209
+ 'error',
210
+ {
211
+ allowAllPropertiesOnSameLine: true
212
+ }
213
+ ],
214
+ '@stylistic/operator-linebreak': [
215
+ 'error',
216
+ 'after',
217
+ {
218
+ overrides: {
219
+ ':': 'before',
220
+ '?': 'before',
221
+ '|>': 'before'
222
+ }
223
+ }
224
+ ],
225
+ '@stylistic/padded-blocks': [
226
+ 'error',
227
+ {
228
+ blocks: 'never',
229
+ classes: 'never',
230
+ switches: 'never'
231
+ }
232
+ ],
233
+ '@stylistic/quote-props': [
234
+ 'error',
235
+ 'as-needed'
236
+ ],
237
+ '@stylistic/quotes': [
238
+ 'error',
239
+ 'single',
240
+ {
241
+ allowTemplateLiterals: 'never',
242
+ avoidEscape: true
243
+ }
244
+ ],
245
+ '@stylistic/rest-spread-spacing': [
246
+ 'error',
247
+ 'never'
248
+ ],
249
+ '@stylistic/semi': [
250
+ 'error',
251
+ 'never'
252
+ ],
253
+ '@stylistic/semi-spacing': [
254
+ 'error',
255
+ {
256
+ after: true,
257
+ before: false
258
+ }
259
+ ],
260
+ '@stylistic/space-before-blocks': [
261
+ 'error',
262
+ 'always'
263
+ ],
264
+ '@stylistic/space-before-function-paren': [
265
+ 'error',
266
+ 'always'
267
+ ],
268
+ '@stylistic/space-in-parens': [
269
+ 'error',
270
+ 'never'
271
+ ],
272
+ '@stylistic/space-infix-ops': 'error',
273
+ '@stylistic/space-unary-ops': [
274
+ 'error',
275
+ {
276
+ nonwords: false,
277
+ words: true
278
+ }
279
+ ],
280
+ '@stylistic/spaced-comment': [
281
+ 'error',
282
+ 'always',
283
+ {
284
+ block: {
285
+ balanced: true,
286
+ exceptions: [
287
+ '*'
288
+ ],
289
+ markers: [
290
+ '*package',
291
+ '!',
292
+ ',',
293
+ ':',
294
+ '::',
295
+ 'flow-include'
296
+ ]
297
+ },
298
+ line: {
299
+ markers: [
300
+ '*package',
301
+ '!',
302
+ '/',
303
+ ',',
304
+ '='
305
+ ]
306
+ }
307
+ }
308
+ ],
309
+ '@stylistic/template-curly-spacing': [
310
+ 'error',
311
+ 'never'
312
+ ],
313
+ '@stylistic/template-tag-spacing': [
314
+ 'error',
315
+ 'never'
316
+ ],
317
+ '@stylistic/wrap-iife': [
318
+ 'error',
319
+ 'any',
320
+ {
321
+ functionPrototypeMethods: true
322
+ }
323
+ ],
324
+ '@stylistic/yield-star-spacing': [
325
+ 'error',
326
+ 'both'
327
+ ],
328
+ 'accessor-pairs': [
329
+ 'error',
330
+ {
331
+ enforceForClassMembers: true,
332
+ setWithoutGet: true
333
+ }
334
+ ],
335
+ 'array-callback-return': [
336
+ 'error',
337
+ {
338
+ allowImplicit: false,
339
+ checkForEach: false
340
+ }
341
+ ],
342
+ camelcase: [
343
+ 'error',
344
+ {
345
+ allow: [
346
+ '^UNSAFE_'
347
+ ],
348
+ ignoreGlobals: true,
349
+ properties: 'never'
350
+ }
351
+ ],
352
+ 'constructor-super': 'error',
353
+ curly: [
354
+ 'error',
355
+ 'multi-line'
356
+ ],
357
+ 'default-case-last': 'error',
358
+ 'dot-notation': [
359
+ 'error',
360
+ {
361
+ allowKeywords: true
362
+ }
363
+ ],
364
+ eqeqeq: [
365
+ 'error',
366
+ 'always',
367
+ {
368
+ null: 'ignore'
369
+ }
370
+ ],
371
+ 'import-x/export': 'error',
372
+ 'import-x/first': 'error',
373
+ 'import-x/no-absolute-path': [
374
+ 'error',
375
+ {
376
+ amd: false,
377
+ commonjs: true,
378
+ esmodule: true
379
+ }
380
+ ],
381
+ 'import-x/no-duplicates': 'error',
382
+ 'import-x/no-named-default': 'error',
383
+ 'import-x/no-webpack-loader-syntax': 'error',
384
+ 'n/handle-callback-err': [
385
+ 'error',
386
+ '^(err|error)$'
387
+ ],
388
+ 'n/no-callback-literal': 'error',
389
+ 'n/no-deprecated-api': 'error',
390
+ 'n/no-exports-assign': 'error',
391
+ 'n/no-new-require': 'error',
392
+ 'n/no-path-concat': 'error',
393
+ 'n/process-exit-as-throw': 'error',
394
+ 'new-cap': [
395
+ 'error',
396
+ {
397
+ capIsNew: false,
398
+ newIsCap: true,
399
+ properties: true
400
+ }
401
+ ],
402
+ 'no-array-constructor': 'error',
403
+ 'no-async-promise-executor': 'error',
404
+ 'no-caller': 'error',
405
+ 'no-case-declarations': 'error',
406
+ 'no-class-assign': 'error',
407
+ 'no-compare-neg-zero': 'error',
408
+ 'no-cond-assign': 'error',
409
+ 'no-const-assign': 'error',
410
+ 'no-constant-condition': [
411
+ 'error',
412
+ {
413
+ checkLoops: false
414
+ }
415
+ ],
416
+ 'no-control-regex': 'error',
417
+ 'no-debugger': 'error',
418
+ 'no-delete-var': 'error',
419
+ 'no-dupe-args': 'error',
420
+ 'no-dupe-class-members': 'error',
421
+ 'no-dupe-keys': 'error',
422
+ 'no-duplicate-case': 'error',
423
+ 'no-empty': [
424
+ 'error',
425
+ {
426
+ allowEmptyCatch: true
427
+ }
428
+ ],
429
+ 'no-empty-character-class': 'error',
430
+ 'no-empty-pattern': 'error',
431
+ 'no-eval': 'error',
432
+ 'no-ex-assign': 'error',
433
+ 'no-extend-native': 'error',
434
+ 'no-extra-bind': 'error',
435
+ 'no-extra-boolean-cast': 'error',
436
+ 'no-fallthrough': 'error',
437
+ 'no-func-assign': 'error',
438
+ 'no-global-assign': 'error',
439
+ 'no-implied-eval': 'error',
440
+ 'no-import-assign': 'error',
441
+ 'no-invalid-regexp': 'error',
442
+ 'no-irregular-whitespace': 'error',
443
+ 'no-iterator': 'error',
444
+ 'no-labels': [
445
+ 'error',
446
+ {
447
+ allowLoop: false,
448
+ allowSwitch: false
449
+ }
450
+ ],
451
+ 'no-lone-blocks': 'error',
452
+ 'no-loss-of-precision': 'error',
453
+ 'no-misleading-character-class': 'error',
454
+ 'no-multi-str': 'error',
455
+ 'no-new': 'error',
456
+ 'no-new-func': 'error',
457
+ 'no-new-native-nonconstructor': 'error',
458
+ 'no-new-wrappers': 'error',
459
+ 'no-obj-calls': 'error',
460
+ 'no-object-constructor': 'error',
461
+ 'no-octal': 'error',
462
+ 'no-octal-escape': 'error',
463
+ 'no-proto': 'error',
464
+ 'no-prototype-builtins': 'error',
465
+ 'no-redeclare': [
466
+ 'error',
467
+ {
468
+ builtinGlobals: false
469
+ }
470
+ ],
471
+ 'no-regex-spaces': 'error',
472
+ 'no-return-assign': [
473
+ 'error',
474
+ 'except-parens'
475
+ ],
476
+ 'no-self-assign': [
477
+ 'error',
478
+ {
479
+ props: true
480
+ }
481
+ ],
482
+ 'no-self-compare': 'error',
483
+ 'no-sequences': 'error',
484
+ 'no-shadow-restricted-names': 'error',
485
+ 'no-sparse-arrays': 'error',
486
+ 'no-template-curly-in-string': 'error',
487
+ 'no-this-before-super': 'error',
488
+ 'no-throw-literal': 'error',
489
+ 'no-undef': 'error',
490
+ 'no-undef-init': 'error',
491
+ 'no-unexpected-multiline': 'error',
492
+ 'no-unmodified-loop-condition': 'error',
493
+ 'no-unneeded-ternary': [
494
+ 'error',
495
+ {
496
+ defaultAssignment: false
497
+ }
498
+ ],
499
+ 'no-unreachable': 'error',
500
+ 'no-unreachable-loop': 'error',
501
+ 'no-unsafe-finally': 'error',
502
+ 'no-unsafe-negation': 'error',
503
+ 'no-unused-expressions': [
504
+ 'error',
505
+ {
506
+ allowShortCircuit: true,
507
+ allowTaggedTemplates: true,
508
+ allowTernary: true
509
+ }
510
+ ],
511
+ 'no-unused-vars': [
512
+ 'error',
513
+ {
514
+ args: 'none',
515
+ caughtErrors: 'none',
516
+ ignoreRestSiblings: true,
517
+ vars: 'all'
518
+ }
519
+ ],
520
+ 'no-use-before-define': [
521
+ 'error',
522
+ {
523
+ classes: false,
524
+ functions: false,
525
+ variables: false
526
+ }
527
+ ],
528
+ 'no-useless-backreference': 'error',
529
+ 'no-useless-call': 'error',
530
+ 'no-useless-catch': 'error',
531
+ 'no-useless-computed-key': 'error',
532
+ 'no-useless-constructor': 'error',
533
+ 'no-useless-escape': 'error',
534
+ 'no-useless-rename': 'error',
535
+ 'no-useless-return': 'error',
536
+ 'no-var': 'warn',
537
+ 'no-void': 'error',
538
+ 'no-with': 'error',
539
+ 'object-shorthand': [
540
+ 'warn',
541
+ 'properties'
542
+ ],
543
+ 'one-var': [
544
+ 'error',
545
+ {
546
+ initialized: 'never'
547
+ }
548
+ ],
549
+ 'prefer-const': [
550
+ 'error',
551
+ {
552
+ destructuring: 'all'
553
+ }
554
+ ],
555
+ 'prefer-promise-reject-errors': 'error',
556
+ 'prefer-regex-literals': [
557
+ 'error',
558
+ {
559
+ disallowRedundantWrapping: true
560
+ }
561
+ ],
562
+ 'promise/param-names': 'error',
563
+ 'symbol-description': 'error',
564
+ 'unicode-bom': [
565
+ 'error',
566
+ 'never'
567
+ ],
568
+ 'use-isnan': [
569
+ 'error',
570
+ {
571
+ enforceForIndexOf: true,
572
+ enforceForSwitchCase: true
573
+ }
574
+ ],
575
+ 'valid-typeof': [
576
+ 'error',
577
+ {
578
+ requireStringLiterals: true
579
+ }
580
+ ],
581
+ yoda: [
582
+ 'error',
583
+ 'never'
584
+ ]
585
+ };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "bugs": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev/issues",
4
4
  "description": "A collection of shared CI scripts and development environment used by @pezkuwi projects",
5
5
  "engines": {
6
- "node": ">=18"
6
+ "node": ">=20.19"
7
7
  },
8
8
  "homepage": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev/tree/master/packages/dev#readme",
9
9
  "license": "Apache-2.0",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "sideEffects": false,
17
17
  "type": "module",
18
- "version": "0.85.12",
18
+ "version": "0.86.0",
19
19
  "bin": {
20
20
  "pezkuwi-ci-ghact-build": "./scripts/pezkuwi-ci-ghact-build.mjs",
21
21
  "pezkuwi-ci-ghact-docs": "./scripts/pezkuwi-ci-ghact-docs.mjs",
@@ -63,6 +63,7 @@
63
63
  },
64
64
  "./config/eslint": "./config/eslint.js",
65
65
  "./config/eslint.rules": "./config/eslint.rules.js",
66
+ "./config/eslint.standard": "./config/eslint.standard.js",
66
67
  "./config/prettier.cjs": "./config/prettier.cjs",
67
68
  "./config/prettier": "./config/prettier.cjs",
68
69
  "./config/rollup": "./config/rollup.js",
@@ -282,47 +283,47 @@
282
283
  }
283
284
  },
284
285
  "dependencies": {
285
- "@eslint/js": "^8.56.0",
286
- "@pezkuwi/dev-test": "^0.85.12",
287
- "@pezkuwi/dev-ts": "^0.85.12",
286
+ "@eslint/compat": "^2.1.1",
287
+ "@eslint/js": "^10.0.1",
288
+ "@pezkuwi/dev-test": "^0.86.0",
289
+ "@pezkuwi/dev-ts": "^0.86.0",
288
290
  "@rollup/plugin-alias": "^5.1.1",
289
- "@rollup/plugin-commonjs": "^25.0.8",
291
+ "@rollup/plugin-commonjs": "^29.0.3",
290
292
  "@rollup/plugin-dynamic-import-vars": "^2.1.5",
291
293
  "@rollup/plugin-inject": "^5.0.5",
292
294
  "@rollup/plugin-json": "^6.1.0",
293
- "@rollup/plugin-node-resolve": "^15.3.1",
295
+ "@rollup/plugin-node-resolve": "^16.0.3",
296
+ "@stylistic/eslint-plugin": "^5.10.0",
294
297
  "@tsconfig/strictest": "^2.0.2",
295
- "@typescript-eslint/eslint-plugin": "^6.19.1",
296
- "@typescript-eslint/parser": "^6.19.1",
297
- "eslint": "^8.56.0",
298
- "eslint-config-standard": "^17.1.0",
298
+ "@typescript-eslint/eslint-plugin": "^8.71.1",
299
+ "@typescript-eslint/parser": "^8.71.1",
300
+ "eslint": "^10.12.0",
299
301
  "eslint-import-resolver-node": "^0.3.9",
300
- "eslint-import-resolver-typescript": "^3.6.1",
301
- "eslint-plugin-deprecation": "^2.0.0",
302
+ "eslint-import-resolver-typescript": "^4.4.5",
302
303
  "eslint-plugin-header": "^3.1.1",
303
- "eslint-plugin-import": "^2.29.1",
304
- "eslint-plugin-import-newlines": "^1.3.4",
305
- "eslint-plugin-jest": "^27.6.3",
306
- "eslint-plugin-n": "^16.6.2",
307
- "eslint-plugin-promise": "^6.1.1",
308
- "eslint-plugin-react": "^7.33.2",
309
- "eslint-plugin-react-hooks": "^4.6.0",
310
- "eslint-plugin-simple-import-sort": "^10.0.0",
311
- "eslint-plugin-sort-destructure-keys": "^1.5.0",
312
- "espree": "^9.6.1",
304
+ "eslint-plugin-import-newlines": "^2.0.0",
305
+ "eslint-plugin-import-x": "^4.17.1",
306
+ "eslint-plugin-jest": "^29.16.6",
307
+ "eslint-plugin-n": "^18.4.1",
308
+ "eslint-plugin-promise": "^7.3.0",
309
+ "eslint-plugin-react": "^7.37.5",
310
+ "eslint-plugin-react-hooks": "^7.1.1",
311
+ "eslint-plugin-simple-import-sort": "^14.0.0",
312
+ "eslint-plugin-sort-destructure-keys": "^3.0.0",
313
+ "espree": "^11.2.0",
313
314
  "gh-pages": "^6.1.1",
314
- "gh-release": "^7.0.2",
315
- "globals": "^13.24.0",
315
+ "gh-release": "^8.1.0",
316
+ "globals": "^17.13.0",
316
317
  "json5": "^2.2.3",
317
- "madge": "^6.1.0",
318
+ "madge": "^8.0.0",
318
319
  "rollup": "^4.9.6",
319
320
  "rollup-plugin-cleanup": "^3.2.1",
320
321
  "tslib": "^2.7.0",
321
322
  "typescript": "^5.5.4",
322
323
  "webpack": "^5.89.0",
323
- "webpack-cli": "^5.1.4",
324
- "webpack-dev-server": "^4.15.1",
325
- "webpack-merge": "^5.10.0",
324
+ "webpack-cli": "^7.2.3",
325
+ "webpack-dev-server": "^6.0.0",
326
+ "webpack-merge": "^6.0.1",
326
327
  "webpack-subresource-integrity": "^5.2.0-rc.1",
327
328
  "yargs": "^17.7.2"
328
329
  }
package/packageInfo.js CHANGED
@@ -1 +1 @@
1
- export const packageInfo = { name: '@pezkuwi/dev', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '0.85.12' };
1
+ export const packageInfo = { name: '@pezkuwi/dev', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '0.86.0' };
package/rootJs/index.js CHANGED
@@ -14,7 +14,6 @@ export async function dynamic(a, b) {
14
14
  // NOTE we go via this path so it points to the same location in both ESM
15
15
  // and CJS output (a './dynamic' import would be different otherwise)
16
16
  const { sum } = await import('@pezkuwi/dev/rootJs/dynamic.mjs');
17
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
18
17
  return sum(a, b);
19
18
  }
20
19
  /** Function to ensure we have json correctly imported */
@@ -1119,8 +1119,8 @@ function lintInput (dir) {
1119
1119
  // file will also be caught in the net, i.e. we expect all files to conform
1120
1120
  if (n === 0 && (
1121
1121
  !/\/\/ Copyright .* @pezkuwi\//.test(l) &&
1122
- !/\/\/ Auto-generated via `/.test(l) &&
1123
- !/#!\/usr\/bin\/env node/.test(l)
1122
+ !l.includes('// Auto-generated via `') &&
1123
+ !l.includes('#!/usr/bin/env node')
1124
1124
  )) {
1125
1125
  return createError(full, l, n, 'Invalid header definition');
1126
1126
  }
@@ -1281,7 +1281,7 @@ function extractPackageInfoImports (filepath, withDetectImport) {
1281
1281
  .readFileSync(filepath, { encoding: 'utf-8' })
1282
1282
  .split('\n')
1283
1283
  .forEach((l) => {
1284
- const match = l.match(/import \{ packageInfo as (.*) \}/);
1284
+ const match = /import \{ packageInfo as (.*) \}/.exec(l);
1285
1285
 
1286
1286
  if (match) {
1287
1287
  otherImports.push(l);
@@ -1290,8 +1290,8 @@ function extractPackageInfoImports (filepath, withDetectImport) {
1290
1290
  });
1291
1291
 
1292
1292
  otherImports.sort((a, b) => {
1293
- const am = a.match(/\} from '(.*)';/);
1294
- const bm = b.match(/\} from '(.*)';/);
1293
+ const am = /\} from '(.*)';/.exec(a);
1294
+ const bm = /\} from '(.*)';/.exec(b);
1295
1295
 
1296
1296
  if (!am) {
1297
1297
  throw new Error(`Unable to extract from import from ${a}`);
@@ -122,7 +122,7 @@ function getFilename (r) {
122
122
  .split('\n')
123
123
  .map((l) => l.trim())
124
124
  .filter((l) => l.startsWith('at ') && (l.includes('.spec.') || l.includes('.test.')))
125
- .map((l) => l.match(/\(.*:\d\d?:\d\d?\)$/)?.[0])
125
+ .map((l) => (/\(.*:\d\d?:\d\d?\)$/.exec(l))?.[0])
126
126
  .map((l) => l?.replace('(', '')?.replace(')', ''));
127
127
 
128
128
  if (stack.length) {
@@ -186,7 +186,7 @@ function complete () {
186
186
 
187
187
  if (typeof r === 'string') {
188
188
  console.log(r); // Node.js <= 18.14
189
- } else if (r.file && r.file.includes('@pezkuwi/dev/scripts')) {
189
+ } else if (r.file?.includes('@pezkuwi/dev/scripts')) {
190
190
  // Ignore internal diagnostics
191
191
  } else {
192
192
  if (lastFilename !== r.file) {
@@ -328,11 +328,11 @@ if (isMainThread) {
328
328
  } else {
329
329
  run({ files: workerData.files, timeout: 3_600_000 })
330
330
  .on('data', () => undefined)
331
- .on('end', () => parentPort && parentPort.postMessage(stats))
331
+ .on('end', () => parentPort?.postMessage(stats))
332
332
  .on('test:coverage', () => undefined)
333
333
  .on('test:diagnostic', (/** @type {DiagStat} */data) => {
334
334
  stats.diag.push(data);
335
- parentPort && parentPort.postMessage({ data: stats, type: 'result' });
335
+ parentPort?.postMessage({ data: stats, type: 'result' });
336
336
  })
337
337
  .on('test:fail', (/** @type {FailStat} */ data) => {
338
338
  const statFail = structuredClone(data);
@@ -343,7 +343,7 @@ if (isMainThread) {
343
343
 
344
344
  stats.fail.push(statFail);
345
345
  stats.total++;
346
- parentPort && parentPort.postMessage({ data: 'x', type: 'progress' });
346
+ parentPort?.postMessage({ data: 'x', type: 'progress' });
347
347
 
348
348
  if (bail) {
349
349
  complete();
@@ -361,7 +361,7 @@ if (isMainThread) {
361
361
  }
362
362
 
363
363
  stats.total++;
364
- parentPort && parentPort.postMessage({ data: symbol, type: 'progress' });
364
+ parentPort?.postMessage({ data: symbol, type: 'progress' });
365
365
  })
366
366
  .on('test:plan', () => undefined)
367
367
  .on('test:start', () => undefined);
package/scripts/util.mjs CHANGED
@@ -83,7 +83,7 @@ export function copyDirSync (src, dest, include, exclude) {
83
83
  if (fs.statSync(srcPath).isDirectory()) {
84
84
  copyDirSync(srcPath, path.join(dest, file), include, exclude);
85
85
  } else if (!include?.length || include.some((e) => file.endsWith(e))) {
86
- if (!exclude || !exclude.some((e) => file.endsWith(e))) {
86
+ if (!exclude?.some((e) => file.endsWith(e))) {
87
87
  copyFileSync(srcPath, dest);
88
88
  }
89
89
  }
@@ -480,7 +480,7 @@ export function topoSort (dirs) {
480
480
  visited[key] = true;
481
481
 
482
482
  node.vertices.forEach((i) => {
483
- if (ancestors.indexOf(i) >= 0) {
483
+ if (ancestors.includes(i)) {
484
484
  console.log('CIRCULAR: closed chain : ' + i + ' is in ' + id);
485
485
 
486
486
  if (nodes[id].vertices.includes(i)) {