@naturalcycles/dev-lib 20.43.1 → 20.44.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.
- package/cfg/eslint-rules.js +1 -1
- package/cfg/lint-staged.config.js +18 -7
- package/cfg/oxlint.config.js +7 -0
- package/cfg/vitest.config.js +7 -1
- package/dist/check.util.js +2 -1
- package/package.json +1 -1
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(' ')
|
|
@@ -69,16 +70,12 @@ const stylelintCmd = stylelintExists ? `stylelint --fix --config ${stylelintConf
|
|
|
69
70
|
|
|
70
71
|
const linters = {
|
|
71
72
|
// oxlint, eslint, stylelint, oxfmt
|
|
72
|
-
[
|
|
73
|
-
runOxlintEslintStylelintOxfmt(match),
|
|
74
|
-
|
|
75
|
-
// Files in root dir: oxfmt
|
|
76
|
-
[`./*.{${prettierExtensionsAll}}`]: runOxfmt,
|
|
73
|
+
[`./**/*.{${prettierExtensionsAll}}`]: match => runOxlintEslintStylelintOxfmt(match),
|
|
77
74
|
|
|
78
75
|
// ktlint
|
|
79
76
|
'**/*.{kt,kts}': runKtlint,
|
|
80
77
|
|
|
81
|
-
'./.github/**/*.{yml,yaml}':
|
|
78
|
+
'./.github/**/*.{yml,yaml}': runActionlint,
|
|
82
79
|
}
|
|
83
80
|
|
|
84
81
|
export function runOxlintEslintStylelintOxfmt(match) {
|
|
@@ -115,6 +112,20 @@ export function runKtlint(match) {
|
|
|
115
112
|
return [`${dir}/resources/ktlint -F ${filesList}`]
|
|
116
113
|
}
|
|
117
114
|
|
|
115
|
+
export function runActionlint(match) {
|
|
116
|
+
if (!match.length) return []
|
|
117
|
+
|
|
118
|
+
if (!canRunBinary('actionlint')) {
|
|
119
|
+
console.log(
|
|
120
|
+
`actionlint is not installed and won't be run.\nThis is how to install it: https://github.com/rhysd/actionlint/blob/main/docs/install.md`,
|
|
121
|
+
)
|
|
122
|
+
return []
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
requireActionlintVersion()
|
|
126
|
+
return ['actionlint']
|
|
127
|
+
}
|
|
128
|
+
|
|
118
129
|
export function runActionlintOxfmt(match) {
|
|
119
130
|
if (!match.length) return []
|
|
120
131
|
|
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;
|