@naturalcycles/dev-lib 20.26.1 → 20.27.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.js CHANGED
@@ -7,7 +7,7 @@ const prettierExtensionsAll =
7
7
  const eslintExtensions = 'ts,tsx,cts,mts,html'
8
8
  const stylelintExtensions = 'css,scss'
9
9
  const lintExclude = ['./**/__exclude/**', './**/dist/**', './**/cache/**', './CHANGELOG.md']
10
- const minActionlintVersion = '1.7.7'
10
+ const minActionlintVersion = '1.7.10'
11
11
 
12
12
  export {
13
13
  prettierDirs,
package/cfg/biome.jsonc CHANGED
@@ -2,14 +2,7 @@
2
2
  "$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
3
3
  "root": false,
4
4
  "files": {
5
- "includes": [
6
- "**/*.ts",
7
- "**/*.tsx",
8
- "**/*.js",
9
- "**/*.jsx",
10
- "!**/__exclude",
11
- "!**/try.ts"
12
- ]
5
+ "includes": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "!**/__exclude", "!**/try.ts"],
13
6
  },
14
7
  "formatter": {
15
8
  "enabled": true,
@@ -18,7 +11,7 @@
18
11
  "indentWidth": 2,
19
12
  "lineEnding": "lf",
20
13
  "lineWidth": 100,
21
- "attributePosition": "auto"
14
+ "attributePosition": "auto",
22
15
  },
23
16
  "assist": { "actions": { "source": { "organizeImports": "off" } } },
24
17
  "linter": {
@@ -28,7 +21,7 @@
28
21
  "performance": {
29
22
  "noAccumulatingSpread": "off", // oxlint
30
23
  // "useTopLevelRegex": "error" // consider
31
- "noDelete": "off" // oxlint
24
+ "noDelete": "off", // oxlint
32
25
  },
33
26
  "correctness": {
34
27
  "useImportExtensions": "off", // oxlint
@@ -41,8 +34,8 @@
41
34
  "noUnusedVariables": {
42
35
  "fix": "none",
43
36
  "level": "off", // oxlint
44
- "options": {}
45
- }
37
+ "options": {},
38
+ },
46
39
  },
47
40
  "style": {
48
41
  // "useDefaultSwitchClause": "error", // consider`
@@ -68,7 +61,7 @@
68
61
  "useSingleVarDeclarator": "error",
69
62
  "noInferrableTypes": "error",
70
63
  "noUselessElse": "error",
71
- "useArrayLiterals": "error"
64
+ "useArrayLiterals": "error",
72
65
  // "noCommonJs": "error" // oxlint
73
66
  },
74
67
  "suspicious": {
@@ -86,7 +79,7 @@
86
79
  "noImportAssign": "off",
87
80
  "noDoubleEquals": "off", // oxlint
88
81
  "noDocumentCookie": "off", // ox
89
- "noEmptyInterface": "off"
82
+ "noEmptyInterface": "off",
90
83
  },
91
84
  "complexity": {
92
85
  "useDateNow": "error",
@@ -99,10 +92,10 @@
99
92
  "useLiteralKeys": "off",
100
93
  "noBannedTypes": "off",
101
94
  "noCommaOperator": "off", // ox
102
- "noArguments": "error"
95
+ "noArguments": "error",
103
96
  },
104
- "nursery": {}
105
- }
97
+ "nursery": {},
98
+ },
106
99
  },
107
100
  "javascript": {
108
101
  "formatter": {
@@ -114,8 +107,8 @@
114
107
  "bracketSpacing": true,
115
108
  "bracketSameLine": false,
116
109
  "quoteStyle": "single",
117
- "attributePosition": "auto"
118
- }
110
+ "attributePosition": "auto",
111
+ },
119
112
  },
120
113
  "overrides": [
121
114
  {
@@ -125,10 +118,10 @@
125
118
  "correctness": {
126
119
  // doesn't work well with *.vue files
127
120
  "noUnusedImports": "off",
128
- "noUnusedVariables": "off"
129
- }
130
- }
131
- }
132
- }
133
- ]
121
+ "noUnusedVariables": "off",
122
+ },
123
+ },
124
+ },
125
+ },
126
+ ],
134
127
  }
@@ -168,21 +168,21 @@ export default {
168
168
  'undefined',
169
169
  ],
170
170
  'id-match': 2,
171
- 'simple-import-sort/imports': [
172
- 2,
173
- {
174
- // This is what "removes any newlines between imports":
175
- groups: [[String.raw`^\u0000`, '^node:', String.raw`^@?\w`, '^', String.raw`^\.`]],
176
- },
177
- ],
178
- 'simple-import-sort/exports': 2,
171
+ // 'simple-import-sort/imports': [
172
+ // 2,
173
+ // {
174
+ // // This is what "removes any newlines between imports":
175
+ // groups: [[String.raw`^\u0000`, '^node:', String.raw`^@?\w`, '^', String.raw`^\.`]],
176
+ // },
177
+ // ],
178
+ // 'simple-import-sort/exports': 2,
179
179
  // 'import-x/order': 0, // disabled in favor of `simple-import-sort`
180
180
  // 'import-x/namespace': 0, // issues with e.g globby
181
181
  // 'import-x/no-unresolved': 0, // breaks for type-aliases, e.g '@/store'
182
- 'import-x/no-anonymous-default-export': 0, // oxlint
183
- 'import-x/no-duplicates': [0, { 'prefer-inline': false }], // oxlint
184
- 'import-x/export': 2, // todo: oxlint when it matures
185
- 'import-x/no-empty-named-blocks': 0, // oxlint
182
+ // 'import-x/no-anonymous-default-export': 0, // oxlint
183
+ // 'import-x/no-duplicates': [0, { 'prefer-inline': false }], // oxlint
184
+ // 'import-x/export': 2, // todo: oxlint when it matures
185
+ // 'import-x/no-empty-named-blocks': 0, // oxlint
186
186
  // Disabling no-cycle as the slowest rule. Oxlint is to be adopted instead
187
187
  // 'import-x/no-cycle': [
188
188
  // 2,
@@ -192,8 +192,8 @@ export default {
192
192
  // maxDepth: 10,
193
193
  // },
194
194
  // ],
195
- 'import-x/no-useless-path-segments': 2,
196
- 'import-x/no-default-export': 0, // biome, oxlint
195
+ // 'import-x/no-useless-path-segments': 2,
196
+ // 'import-x/no-default-export': 0, // biome, oxlint
197
197
  // 'import-x/no-commonjs': 2, // biome `noCommonJs`
198
198
  // 'import-x/extensions': [2, 'always'], // biome useImportExtensions
199
199
  'no-array-constructor': 0,
@@ -4,15 +4,13 @@
4
4
  * Shared eslint FLAT config.
5
5
  */
6
6
 
7
- import globals from 'globals'
8
7
  import eslint from '@eslint/js'
9
- import tseslint from 'typescript-eslint'
10
8
  import eslintPluginOxlint from 'eslint-plugin-oxlint'
11
- import eslintPluginImportX from 'eslint-plugin-import-x'
12
- import eslintPluginSimpleImportSort from 'eslint-plugin-simple-import-sort'
13
- import eslintRules from './eslint-rules.js'
14
- import eslintPrettierRules from './eslint-prettier-rules.js'
9
+ import globals from 'globals'
10
+ import tseslint from 'typescript-eslint'
15
11
  import eslintBiomeRules from './eslint-biome-rules.js'
12
+ import eslintPrettierRules from './eslint-prettier-rules.js'
13
+ import eslintRules from './eslint-rules.js'
16
14
 
17
15
  const defaultFiles = ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts']
18
16
  const srcFiles = ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.cts', 'src/**/*.mts']
@@ -95,9 +93,9 @@ function getConfig(_tsconfigPath) {
95
93
  return {
96
94
  plugins: {
97
95
  '@typescript-eslint': tseslint.plugin,
98
- 'import-x': eslintPluginImportX,
96
+ // 'import-x': eslintPluginImportX,
99
97
  // 'unused-imports': require('eslint-plugin-unused-imports'), // disabled in favor of biome rules
100
- 'simple-import-sort': eslintPluginSimpleImportSort,
98
+ // 'simple-import-sort': eslintPluginSimpleImportSort,
101
99
  // jsdoc: eslintPluginJsdoc, // oxlint
102
100
  // '@stylistic': eslintPluginStylistic, // oxlint custom plugin
103
101
  },
@@ -12,16 +12,15 @@ const {
12
12
 
13
13
  console.log(`lint-staged.config.js runs on node ${node} ${platform} ${arch}`)
14
14
 
15
- import fs from 'node:fs'
16
- import micromatch from 'micromatch'
17
15
  import { execSync } from 'node:child_process'
16
+ import fs from 'node:fs'
18
17
  import { _assert } from '@naturalcycles/js-lib/error/assert.js'
19
18
  import { semver2 } from '@naturalcycles/js-lib/semver'
20
19
  import { exec2 } from '@naturalcycles/nodejs-lib/exec2'
21
- import { fs2 } from '@naturalcycles/nodejs-lib/fs2'
20
+ import micromatch from 'micromatch'
22
21
  import { prettierExtensionsAll, lintExclude, minActionlintVersion } from './_cnst.js'
23
22
 
24
- const prettierConfigPath = [`prettier.config.js`].find(fs.existsSync)
23
+ const oxfmtConfigPath = ['.oxfmtrc.jsonc', '.oxfmtrc.json'].find(fs.existsSync)
25
24
 
26
25
  const stylelintConfigPath = [`stylelint.config.js`].find(fs.existsSync)
27
26
 
@@ -29,20 +28,10 @@ const eslintConfigPath = ['eslint.config.js'].find(fs.existsSync)
29
28
 
30
29
  const oxlintConfigPath = ['.oxlintrc.json'].find(fs.existsSync)
31
30
 
32
- let prettierCmd = undefined
33
-
34
- if (prettierConfigPath) {
35
- const experimental = !hasPrettierOverrides()
36
- prettierCmd = [
37
- 'prettier --write --log-level=warn',
38
- experimental && '--cache-location',
39
- experimental && 'node_modules/.cache/prettier',
40
- experimental && `--experimental-cli`,
41
- experimental ? '--config-path' : `--config`,
42
- prettierConfigPath,
43
- ]
44
- .filter(Boolean)
45
- .join(' ')
31
+ let oxfmtCmd = undefined
32
+
33
+ if (oxfmtConfigPath) {
34
+ oxfmtCmd = 'oxfmt'
46
35
  }
47
36
 
48
37
  let eslintCmd = undefined
@@ -89,12 +78,12 @@ const biomeConfigPath = ['biome.jsonc'].find(p => fs.existsSync(p))
89
78
  const biomeCmd = biomeConfigPath && `biome lint --write --unsafe --no-errors-on-unmatched`
90
79
 
91
80
  const linters = {
92
- // biome, oxlint, eslint, stylelint, prettier
81
+ // biome, oxlint, eslint, stylelint, oxfmt
93
82
  [`./{src,scripts,e2e}/**/*.{${prettierExtensionsAll}}`]: match =>
94
- runBiomeEslintStylelintPrettier(match),
83
+ runBiomeEslintStylelintOxfmt(match),
95
84
 
96
- // Files in root dir: prettier
97
- [`./*.{${prettierExtensionsAll}}`]: runPrettier,
85
+ // Files in root dir: oxfmt
86
+ [`./*.{${prettierExtensionsAll}}`]: runOxfmt,
98
87
 
99
88
  // ktlint
100
89
  '**/*.{kt,kts}': runKtlint,
@@ -102,31 +91,31 @@ const linters = {
102
91
  './.github/**/*.{yml,yaml}': runActionlint,
103
92
  }
104
93
 
105
- export function runBiomeEslintStylelintPrettier(match) {
94
+ export function runBiomeEslintStylelintOxfmt(match) {
106
95
  const filesList = getFilesList(match)
107
96
  if (!filesList) return []
108
97
 
109
- return [biomeCmd, oxlintCmd, eslintCmd, stylelintCmd, prettierCmd]
98
+ return [biomeCmd, oxlintCmd, eslintCmd, stylelintCmd, oxfmtCmd]
110
99
  .filter(Boolean)
111
100
  .map(s => `${s} ${filesList}`)
112
101
  }
113
102
 
114
- export function runBiomeOxlintPrettier(match) {
103
+ export function runBiomeOxlintOxfmt(match) {
115
104
  const filesList = getFilesList(match)
116
105
  if (!filesList) return []
117
- return [biomeCmd, oxlintCmd, prettierCmd].filter(Boolean).map(s => `${s} ${filesList}`)
106
+ return [biomeCmd, oxlintCmd, oxfmtCmd].filter(Boolean).map(s => `${s} ${filesList}`)
118
107
  }
119
108
 
120
- export function runOxlintPrettier(match) {
109
+ export function runOxlintOxfmt(match) {
121
110
  const filesList = getFilesList(match)
122
111
  if (!filesList) return []
123
- return [oxlintCmd, prettierCmd].filter(Boolean).map(s => `${s} ${filesList}`)
112
+ return [oxlintCmd, oxfmtCmd].filter(Boolean).map(s => `${s} ${filesList}`)
124
113
  }
125
114
 
126
- export function runPrettier(match) {
115
+ export function runOxfmt(match) {
127
116
  const filesList = getFilesList(match)
128
- if (!filesList || !prettierCmd) return []
129
- return [prettierCmd].map(s => `${s} ${filesList}`)
117
+ if (!filesList || !oxfmtCmd) return []
118
+ return [oxfmtCmd].map(s => `${s} ${filesList}`)
130
119
  }
131
120
 
132
121
  export function runKtlint(match) {
@@ -194,12 +183,4 @@ function getActionLintVersion() {
194
183
  }
195
184
  }
196
185
 
197
- function hasPrettierOverrides() {
198
- try {
199
- return fs2.readText('prettier.config.js').includes('overrides')
200
- } catch {
201
- return false
202
- }
203
- }
204
-
205
186
  export default linters
@@ -1,8 +1,8 @@
1
1
  import fs from 'node:fs'
2
- import { VitestAlphabeticSequencer } from './vitestAlphabeticSequencer.js'
3
2
  import { defineConfig } from 'vitest/config'
4
- import { SummaryReporter } from './summaryReporter.js'
5
3
  import { SummaryOnlyReporter } from './summaryOnlyReporter.js'
4
+ import { SummaryReporter } from './summaryReporter.js'
5
+ import { VitestAlphabeticSequencer } from './vitestAlphabeticSequencer.js'
6
6
  export { SummaryReporter } from './summaryReporter.js'
7
7
  export { CollectReporter } from './collectReporter.js'
8
8
  export { SummaryOnlyReporter } from './summaryOnlyReporter.js'
@@ -1,5 +1,5 @@
1
- import { BaseSequencer } from 'vitest/node'
2
1
  import { _sortBy } from '@naturalcycles/js-lib/array/sort.js'
2
+ import { BaseSequencer } from 'vitest/node'
3
3
 
4
4
  export class VitestAlphabeticSequencer extends BaseSequencer {
5
5
  async sort(files) {
@@ -3,7 +3,7 @@ import { _by } from '@naturalcycles/js-lib/array/array.util.js';
3
3
  import { _assert } from '@naturalcycles/js-lib/error/assert.js';
4
4
  import { fs2 } from '@naturalcycles/nodejs-lib/fs2';
5
5
  import { runScript } from '@naturalcycles/nodejs-lib/runScript';
6
- import { buildCopy, buildProd, eslintAll, lintStagedCommand, requireOxlintConfig, runBiome, runCheck, runOxlint, runPrettier, runTest, stylelintAll, typecheckWithTS, typecheckWithTSC, typecheckWithTSGO, } from '../check.util.js';
6
+ import { buildCopy, buildProd, eslintAll, lintStagedCommand, requireOxlintConfig, runBiome, runCheck, runOxfmt, runOxlint, runTest, stylelintAll, typecheckWithTS, typecheckWithTSC, typecheckWithTSGO, } from '../check.util.js';
7
7
  import { runCommitlint } from '../commitlint.js';
8
8
  const commands = [
9
9
  { name: 'check', fn: runCheck, desc: '"Run all possible checks": lint, typecheck, then test.' },
@@ -70,7 +70,7 @@ const commands = [
70
70
  typecheck: false,
71
71
  test: false,
72
72
  }),
73
- desc: 'Run all linters: eslint, prettier, stylelint, ktlint, actionlint.',
73
+ desc: 'Run all linters: eslint, oxfmt, stylelint, ktlint, actionlint.',
74
74
  },
75
75
  {
76
76
  name: 'lint-staged',
@@ -105,7 +105,7 @@ const commands = [
105
105
  desc: 'Run biome linter on all files with "auto-fix" disabled. Useful for debugging.',
106
106
  interactiveOnly: true,
107
107
  },
108
- { name: 'prettier', fn: runPrettier, desc: 'Run prettier on all files.' },
108
+ { name: 'oxfmt', fn: runOxfmt, desc: 'Run oxfmt on all files.' },
109
109
  { name: 'stylelint', fn: stylelintAll, desc: 'Run stylelint on all files.' },
110
110
  {
111
111
  name: 'stylelint --no-fix',
@@ -164,7 +164,7 @@ runScript(async () => {
164
164
  async function quickCheck() {
165
165
  await runCheck({
166
166
  eslint: false,
167
- prettier: false,
167
+ oxfmt: false,
168
168
  stylelint: false,
169
169
  typecheck: false,
170
170
  });
@@ -7,7 +7,7 @@ export interface CheckOptions {
7
7
  fastLinters?: boolean;
8
8
  eslint?: boolean;
9
9
  stylelint?: boolean;
10
- prettier?: boolean;
10
+ oxfmt?: boolean;
11
11
  ktlint?: boolean;
12
12
  /**
13
13
  * true - run tsgo, otherwise tsc
@@ -38,16 +38,13 @@ export declare function eslintAll(opt?: EslintAllOptions): boolean;
38
38
  * Returns true if it ran.
39
39
  */
40
40
  export declare function runOxlint(fix?: boolean): boolean;
41
- export declare function requireOxlintConfig(): void;
42
- export declare function hasOxlintConfig(): boolean;
43
- interface RunPrettierOptions {
44
- experimentalCli?: boolean;
45
- fix?: boolean;
46
- }
47
41
  /**
48
42
  * Returns true if it ran.
49
43
  */
50
- export declare function runPrettier(opt?: RunPrettierOptions): boolean;
44
+ export declare function runOxfmt(fix?: boolean): boolean;
45
+ export declare function requireOxlintConfig(): void;
46
+ export declare function hasOxlintConfig(): boolean;
47
+ export declare function hasOxfmtConfig(): boolean;
51
48
  /**
52
49
  * Returns true if it ran.
53
50
  */
@@ -14,7 +14,7 @@ import { exec2 } from '@naturalcycles/nodejs-lib/exec2';
14
14
  import { fs2 } from '@naturalcycles/nodejs-lib/fs2';
15
15
  import { kpySync } from '@naturalcycles/nodejs-lib/kpy';
16
16
  import { _yargs } from '@naturalcycles/nodejs-lib/yargs';
17
- import { eslintExtensions, lintExclude, minActionlintVersion, prettierDirs, prettierExtensionsAll, stylelintExtensions, } from '../cfg/_cnst.js';
17
+ import { eslintExtensions, lintExclude, minActionlintVersion, prettierDirs, stylelintExtensions, } from '../cfg/_cnst.js';
18
18
  import { cfgDir } from './paths.js';
19
19
  const { CI, ESLINT_CONCURRENCY } = process.env;
20
20
  /**
@@ -23,7 +23,7 @@ const { CI, ESLINT_CONCURRENCY } = process.env;
23
23
  * If full=false - the "slow" linters are skipped.
24
24
  */
25
25
  export async function runCheck(opt = {}) {
26
- const { fastLinters = true, eslint = true, stylelint = true, prettier = true, ktlint = true, typecheck = true, test = true, } = opt;
26
+ const { fastLinters = true, eslint = true, stylelint = true, oxfmt = true, ktlint = true, typecheck = true, test = true, } = opt;
27
27
  const started = Date.now();
28
28
  let s;
29
29
  const timings = {};
@@ -75,10 +75,10 @@ export async function runCheck(opt = {}) {
75
75
  timings['stylelint'] = Date.now() - s;
76
76
  }
77
77
  }
78
- if (prettier) {
78
+ if (oxfmt) {
79
79
  s = Date.now();
80
- if (runPrettier({ fix })) {
81
- timings['prettier'] = Date.now() - s;
80
+ if (runOxfmt(fix)) {
81
+ timings['oxfmt'] = Date.now() - s;
82
82
  }
83
83
  }
84
84
  if (ktlint) {
@@ -217,56 +217,32 @@ export function runOxlint(fix = true) {
217
217
  });
218
218
  return true;
219
219
  }
220
- export function requireOxlintConfig() {
221
- _assert(hasOxlintConfig(), '.oxlintrc.json config is not found');
222
- }
223
- export function hasOxlintConfig() {
224
- const oxlintConfigPath = `.oxlintrc.json`;
225
- return existsSync(oxlintConfigPath);
226
- }
227
- const prettierPaths = [
228
- // Everything inside these folders
229
- `./{${prettierDirs.join(',')}}/**/*.{${prettierExtensionsAll}}`,
230
- // Root
231
- `./*.{${prettierExtensionsAll}}`,
232
- // Exclude
233
- ...lintExclude.map((s) => `!${s}`),
234
- ];
235
220
  /**
236
221
  * Returns true if it ran.
237
222
  */
238
- export function runPrettier(opt = {}) {
239
- let { experimentalCli = true, fix = true } = opt;
240
- const prettierConfigPath = [`./prettier.config.js`].find(f => existsSync(f));
241
- if (!prettierConfigPath) {
223
+ export function runOxfmt(fix = true) {
224
+ if (!hasOxfmtConfig()) {
225
+ console.log('.oxfmtrc.json(c) is not found, skipping to run oxfmt');
242
226
  return false;
243
227
  }
244
- const prettierPath = findPackageBinPath('prettier', 'prettier');
245
- const cacheLocation = 'node_modules/.cache/prettier';
246
- const cacheFound = existsSync(cacheLocation);
247
- console.log(dimGrey(`${check(cacheFound)}prettier cache found: ${cacheFound}`));
248
- if (hasPrettierOverrides()) {
249
- experimentalCli = false;
250
- console.log(' prettier experimental mode disabled due to "overrides" in prettier.config.js');
251
- }
252
- // prettier --write 'src/**/*.{js,ts,css,scss,graphql}'
253
- exec2.spawn(prettierPath, {
254
- name: fix ? 'prettier' : 'prettier --check',
255
- args: [
256
- fix ? `--write` : '--check',
257
- `--log-level=warn`,
258
- // non-experimental-cli has different cache format, hence disabling it
259
- experimentalCli && '--cache-location',
260
- experimentalCli && cacheLocation,
261
- experimentalCli && `--experimental-cli`,
262
- experimentalCli ? '--config-path' : `--config`,
263
- prettierConfigPath,
264
- ...prettierPaths,
265
- ].filter(_isTruthy),
228
+ const oxlintPath = findPackageBinPath('oxfmt', 'oxfmt');
229
+ exec2.spawn(oxlintPath, {
230
+ name: ['oxfmt', !fix && '--check'].filter(Boolean).join(' '),
231
+ args: [!fix && '--check', '--no-error-on-unmatched-pattern'].filter(_isTruthy),
266
232
  shell: false,
267
233
  });
268
234
  return true;
269
235
  }
236
+ export function requireOxlintConfig() {
237
+ _assert(hasOxlintConfig(), '.oxlintrc.json config is not found');
238
+ }
239
+ export function hasOxlintConfig() {
240
+ const oxlintConfigPath = `.oxlintrc.json`;
241
+ return existsSync(oxlintConfigPath);
242
+ }
243
+ export function hasOxfmtConfig() {
244
+ return ['.oxfmtrc.jsonc', '.oxfmtrc.json'].some(existsSync);
245
+ }
270
246
  const stylelintPaths = [
271
247
  // Everything inside these folders
272
248
  `./{${prettierDirs.join(',')}}/**/*.{${stylelintExtensions}}`,
@@ -541,14 +517,6 @@ export function findPackageBinPath(pkg, cmd) {
541
517
  const { bin } = fs2.readJson(packageJsonPath);
542
518
  return path.join(path.dirname(packageJsonPath), typeof bin === 'string' ? bin : bin[cmd]);
543
519
  }
544
- function hasPrettierOverrides() {
545
- try {
546
- return fs2.readText('prettier.config.js').includes('overrides');
547
- }
548
- catch {
549
- return false;
550
- }
551
- }
552
520
  function check(predicate) {
553
521
  return predicate ? ' ✓ ' : ' ';
554
522
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
3
  "type": "module",
4
- "version": "20.26.1",
4
+ "version": "20.27.1",
5
5
  "dependencies": {
6
6
  "@biomejs/biome": "^2",
7
7
  "@eslint/js": "^9",
@@ -10,15 +10,13 @@
10
10
  "@naturalcycles/nodejs-lib": "^15",
11
11
  "@vitest/coverage-v8": "^4",
12
12
  "eslint": "^9",
13
- "eslint-plugin-import-x": "^4",
14
13
  "eslint-plugin-oxlint": "^1",
15
- "eslint-plugin-simple-import-sort": "^12",
16
14
  "globals": "^17",
17
15
  "lint-staged": "^16",
18
16
  "micromatch": "^4",
17
+ "oxfmt": "^0",
19
18
  "oxlint": "^1",
20
19
  "oxlint-tsgolint": "*",
21
- "prettier": "^3",
22
20
  "typescript-eslint": "^8"
23
21
  },
24
22
  "peerDependencies": {
@@ -48,7 +46,6 @@
48
46
  "./cfg/biome.jsonc": "./cfg/biome.jsonc",
49
47
  "./cfg/eslint.config.js": "./cfg/eslint.config.js",
50
48
  "./cfg/oxlint.config.json": "./cfg/oxlint.config.json",
51
- "./cfg/prettier.config.js": "./cfg/prettier.config.js",
52
49
  "./cfg/stylelint.config.js": "./cfg/stylelint.config.js",
53
50
  "./cfg/tsconfig.src.json": "./cfg/tsconfig.src.json",
54
51
  "./cfg/tsconfig.scripts.json": "./cfg/tsconfig.scripts.json",
@@ -1,4 +0,0 @@
1
- #
2
- # .prettierignore
3
- #
4
- /**/__exclude/**/*
@@ -1,3 +0,0 @@
1
- import sharedConfig from '@naturalcycles/dev-lib/cfg/prettier.config.js'
2
-
3
- export default sharedConfig
@@ -1,30 +0,0 @@
1
- /**
2
- * Default config for `prettier`.
3
- * Extendable.
4
- */
5
-
6
- export default {
7
- printWidth: 100,
8
- tabWidth: 2,
9
- useTabs: false,
10
- semi: false,
11
- singleQuote: true,
12
- quoteProps: 'as-needed',
13
- jsxSingleQuote: false,
14
- trailingComma: 'all',
15
- bracketSpacing: true,
16
- bracketSameLine: false,
17
- arrowParens: 'avoid',
18
- proseWrap: 'always',
19
- htmlWhitespaceSensitivity: 'css',
20
- endOfLine: 'lf',
21
- overrides: [
22
- {
23
- // https://github.com/prettier/prettier/blob/main/CHANGELOG.md#use-json-parser-for-tsconfigjson-by-default-16012-by-sosukesuzuki
24
- files: ['**/tsconfig.json', '**/tsconfig.*.json'],
25
- options: {
26
- parser: 'jsonc',
27
- },
28
- },
29
- ],
30
- }