@naturalcycles/dev-lib 20.43.2 → 20.44.1
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/cfg/_cnst.d.ts +0 -1
- package/cfg/_cnst.js +2 -5
- package/cfg/eslint-rules.js +1 -1
- package/cfg/lint-staged.config.js +15 -5
- package/cfg/oxlint.config.js +7 -0
- package/cfg/vitest.config.js +7 -1
- package/dist/check.util.js +2 -1
- package/package.json +2 -2
package/cfg/_cnst.d.ts
CHANGED
package/cfg/_cnst.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
const prettierDirs = ['src,scripts,e2e,docs,cfg,resources,.github,public,static']
|
|
2
|
-
// ts,tsx,css,scss excluded, cause they need to run in special order (overlap between >1 tool):
|
|
3
|
-
const prettierExtensionsExclusive = 'js,jsx,json,md,graphql,yml,yaml,html'
|
|
4
2
|
// everything that prettier supports:
|
|
5
3
|
const prettierExtensionsAll =
|
|
6
4
|
'ts,tsx,cts,mts,css,scss,js,jsx,cjs,mjs,json,md,graphql,yml,yaml,html,vue'
|
|
7
|
-
const eslintExtensions = 'ts,tsx,
|
|
5
|
+
const eslintExtensions = 'ts,tsx,html'
|
|
8
6
|
const stylelintExtensions = 'css,scss'
|
|
9
|
-
const lintExclude = ['
|
|
7
|
+
const lintExclude = ['**/__exclude/**']
|
|
10
8
|
const minActionlintVersion = '1.7.12'
|
|
11
9
|
|
|
12
10
|
export {
|
|
13
11
|
prettierDirs,
|
|
14
|
-
prettierExtensionsExclusive,
|
|
15
12
|
prettierExtensionsAll,
|
|
16
13
|
eslintExtensions,
|
|
17
14
|
stylelintExtensions,
|
package/cfg/eslint-rules.js
CHANGED
|
@@ -491,7 +491,7 @@ export default {
|
|
|
491
491
|
'@typescript-eslint/prefer-string-starts-ends-with': 0, // ox
|
|
492
492
|
'@typescript-eslint/prefer-ts-expect-error': 0, // ox
|
|
493
493
|
'@typescript-eslint/explicit-member-accessibility': [
|
|
494
|
-
|
|
494
|
+
0, // ox
|
|
495
495
|
{
|
|
496
496
|
accessibility: 'no-public',
|
|
497
497
|
overrides: { parameterProperties: 'off' },
|
|
@@ -30,7 +30,7 @@ const oxlintConfigPath = ['oxlint.config.ts'].find(fs.existsSync)
|
|
|
30
30
|
let oxfmtCmd = undefined
|
|
31
31
|
|
|
32
32
|
if (oxfmtConfigPath) {
|
|
33
|
-
oxfmtCmd = 'oxfmt --no-error-on-unmatched-pattern'
|
|
33
|
+
oxfmtCmd = 'oxfmt --no-error-on-unmatched-pattern --disable-nested-config'
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
let eslintCmd = undefined
|
|
@@ -56,6 +56,7 @@ if (oxlintConfigPath) {
|
|
|
56
56
|
'--fix-suggestions',
|
|
57
57
|
'--fix-dangerously',
|
|
58
58
|
'--no-error-on-unmatched-pattern',
|
|
59
|
+
'--disable-nested-config',
|
|
59
60
|
]
|
|
60
61
|
.filter(Boolean)
|
|
61
62
|
.join(' ')
|
|
@@ -80,10 +81,14 @@ const linters = {
|
|
|
80
81
|
export function runOxlintEslintStylelintOxfmt(match) {
|
|
81
82
|
const filesList = getFilesList(match)
|
|
82
83
|
if (!filesList) return []
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
const eslintFilesList = eslintCmd && getEslintFilesList(match)
|
|
85
|
+
|
|
86
|
+
return [
|
|
87
|
+
oxlintCmd && `${oxlintCmd} ${filesList}`,
|
|
88
|
+
eslintFilesList && `${eslintCmd} ${eslintFilesList}`,
|
|
89
|
+
stylelintCmd && `${stylelintCmd} ${filesList}`,
|
|
90
|
+
oxfmtCmd && `${oxfmtCmd} ${filesList}`,
|
|
91
|
+
].filter(Boolean)
|
|
87
92
|
}
|
|
88
93
|
|
|
89
94
|
export function runOxlintOxfmt(match) {
|
|
@@ -152,6 +157,11 @@ function getFilesList(match) {
|
|
|
152
157
|
return match.filter(f => !isExcluded(f)).join(' ')
|
|
153
158
|
}
|
|
154
159
|
|
|
160
|
+
function getEslintFilesList(match) {
|
|
161
|
+
const isIncluded = picomatch('./{src,scripts,e2e}/**/*.{ts,tsx,html}')
|
|
162
|
+
return match.filter(f => isIncluded(f)).join(' ')
|
|
163
|
+
}
|
|
164
|
+
|
|
155
165
|
function canRunBinary(name) {
|
|
156
166
|
try {
|
|
157
167
|
execSync(`which ${name}`)
|
package/cfg/oxlint.config.js
CHANGED
|
@@ -254,6 +254,13 @@ export const sharedConfig = {
|
|
|
254
254
|
'typescript/require-array-sort-compare': 0, // not good
|
|
255
255
|
'typescript/restrict-template-expressions': 0, // not good
|
|
256
256
|
'typescript/no-redundant-type-constituents': 0, // `'a' | string` is still useful for DX
|
|
257
|
+
'@typescript-eslint/explicit-member-accessibility': [
|
|
258
|
+
2,
|
|
259
|
+
{
|
|
260
|
+
accessibility: 'no-public',
|
|
261
|
+
overrides: { parameterProperties: 'off' },
|
|
262
|
+
},
|
|
263
|
+
],
|
|
257
264
|
'typescript/no-restricted-types': [
|
|
258
265
|
2,
|
|
259
266
|
{
|
package/cfg/vitest.config.js
CHANGED
|
@@ -93,7 +93,12 @@ export function getSharedConfig(cwd) {
|
|
|
93
93
|
exclude,
|
|
94
94
|
reporters: getReporters(junitReporterEnabled, testType),
|
|
95
95
|
// outputFile location is specified for compatibility with the previous jest config
|
|
96
|
-
outputFile: junitReporterEnabled
|
|
96
|
+
outputFile: junitReporterEnabled
|
|
97
|
+
? {
|
|
98
|
+
junit: `./tmp/jest/${testType}.xml`,
|
|
99
|
+
json: `./tmp/jest/${testType}.json`,
|
|
100
|
+
}
|
|
101
|
+
: undefined,
|
|
97
102
|
coverage: {
|
|
98
103
|
enabled: coverageEnabled,
|
|
99
104
|
reporter: ['html', 'lcov', 'json', 'json-summary', !isCI && 'text'].filter(Boolean),
|
|
@@ -136,6 +141,7 @@ function getReporters(junitReporterEnabled, testType) {
|
|
|
136
141
|
'default',
|
|
137
142
|
GITHUB_ACTIONS && 'github-actions',
|
|
138
143
|
new SummaryReporter(),
|
|
144
|
+
junitReporterEnabled && 'json',
|
|
139
145
|
junitReporterEnabled && [
|
|
140
146
|
'junit',
|
|
141
147
|
{
|
package/dist/check.util.js
CHANGED
|
@@ -204,6 +204,7 @@ export function runOxlint(fix = true) {
|
|
|
204
204
|
name: ['oxlint', !fix && '--no-fix'].filter(Boolean).join(' '),
|
|
205
205
|
args: [
|
|
206
206
|
'--no-error-on-unmatched-pattern',
|
|
207
|
+
'--disable-nested-config',
|
|
207
208
|
fix && '--fix',
|
|
208
209
|
fix && '--fix-suggestions',
|
|
209
210
|
fix && '--fix-dangerously',
|
|
@@ -223,7 +224,7 @@ export function runOxfmt(fix = true) {
|
|
|
223
224
|
const oxlintPath = findPackageBinPath('oxfmt', 'oxfmt');
|
|
224
225
|
exec2.spawn(oxlintPath, {
|
|
225
226
|
name: ['oxfmt', !fix && '--check'].filter(Boolean).join(' '),
|
|
226
|
-
args: [!fix && '--check', '--no-error-on-unmatched-pattern'].filter(_isTruthy),
|
|
227
|
+
args: [!fix && '--check', '--no-error-on-unmatched-pattern', '--disable-nested-config'].filter(_isTruthy),
|
|
227
228
|
shell: false,
|
|
228
229
|
});
|
|
229
230
|
return true;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/dev-lib",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "20.
|
|
4
|
+
"version": "20.44.1",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@naturalcycles/js-lib": "^15",
|
|
7
7
|
"@naturalcycles/nodejs-lib": "^15",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/node": "^25",
|
|
50
50
|
"@types/prompts": "^2",
|
|
51
|
-
"@typescript/native-preview": "
|
|
51
|
+
"@typescript/native-preview": "beta"
|
|
52
52
|
},
|
|
53
53
|
"exports": {
|
|
54
54
|
"./cfg/": "./cfg/",
|