@4mbl/lint 0.0.0-alpha.dd19431 → 0.0.0-alpha.e34f9fe

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/CHANGELOG.md CHANGED
@@ -1,5 +1,73 @@
1
1
  # @4mbl/lint
2
2
 
3
+ ## 1.0.0-beta.13
4
+
5
+ ### Minor Changes
6
+
7
+ - dd66007: Pin dependencies to ensure future compatibility
8
+ - 0feb87d: Remove unused dependencies and inline trivial imports
9
+ - 1d98a33: Disable `react/forbid-component-props` and `react/forbid-dom-props` to ensure Tailwind compatibility
10
+ - a9085f2: Extend inherited plugins in child presets
11
+ - 014d999: Allow `eslint/no-underscore-dangle` for `__dirname` and `__filename` in node
12
+
13
+ ## 1.0.0-beta.12
14
+
15
+ ### Minor Changes
16
+
17
+ - aee0259: Upgrade dependencies
18
+
19
+ ## 1.0.0-beta.11
20
+
21
+ ### Minor Changes
22
+
23
+ - 20b3dae: Use native rules for React when possible
24
+
25
+ ## 1.0.0-beta.10
26
+
27
+ ### Minor Changes
28
+
29
+ - 007a287: Configure more rules to reduce noise
30
+ - 007a287: Use native only-export-components rule instead of js plugin
31
+ - 007a287: Use correct namespace for Next.js rules
32
+
33
+ ## 1.0.0-beta.9
34
+
35
+ ### Minor Changes
36
+
37
+ - 491164e: Add --help flag to cli
38
+ - 491164e: Fallback to Oxlint config lookup if no preset is passed to CLI and Oxlint config exists within working directory.
39
+
40
+ ## 1.0.0-beta.8
41
+
42
+ ### Minor Changes
43
+
44
+ - a78f42b: Configure rules to reduce noise
45
+
46
+ ## 1.0.0-beta.7
47
+
48
+ ### Minor Changes
49
+
50
+ - 7c82f22: Upgrade dependencies
51
+
52
+ ## 1.0.0-beta.6
53
+
54
+ ### Minor Changes
55
+
56
+ - 0422e86: Upgrade dependencies
57
+
58
+ ## 1.0.0-beta.5
59
+
60
+ ### Minor Changes
61
+
62
+ - 125b851: Enable most rule categories
63
+ - 473bad0: Upgrade dependencies
64
+
65
+ ## 1.0.0-beta.4
66
+
67
+ ### Minor Changes
68
+
69
+ - 10abc93: Upgrade dependencies
70
+
3
71
  ## 1.0.0-beta.3
4
72
 
5
73
  ### Minor Changes
package/bin/cli.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { spawnSync } from 'node:child_process';
4
+ import { existsSync } from 'node:fs';
4
5
  import path from 'node:path';
5
6
  import { fileURLToPath } from 'node:url';
6
7
 
@@ -15,11 +16,38 @@ const wrapperArgs =
15
16
  separatorIndex === -1 ? rawArgs : rawArgs.slice(0, separatorIndex);
16
17
  const toolArgs = separatorIndex === -1 ? [] : rawArgs.slice(separatorIndex + 1);
17
18
 
19
+ if (wrapperArgs.includes('--help') || rawArgs.includes('-h')) {
20
+ console.log(`
21
+ Usage:
22
+ lint [options] -- [oxlint options]
23
+
24
+ Options:
25
+ --preset <name> Use a preset config (default: base if no config within cwd)
26
+
27
+ Examples:
28
+ lint
29
+ lint --preset node
30
+ lint -- src --fix
31
+
32
+ Notes:
33
+ Everything after "--" is passed directly to oxlint.
34
+ `);
35
+
36
+ process.exit(0);
37
+ }
38
+
18
39
  const presetArgIndex = wrapperArgs.findIndex((a) => a === '--preset');
40
+
19
41
  const presetName =
20
- presetArgIndex !== -1 ? wrapperArgs[presetArgIndex + 1] : 'base';
42
+ presetArgIndex !== -1
43
+ ? wrapperArgs[presetArgIndex + 1]
44
+ : !existsSync('./oxlint.config.ts') && !existsSync('./.oxlintrc.json')
45
+ ? 'base'
46
+ : undefined;
21
47
 
22
- const configPath = path.resolve(__dirname, `../dist/${presetName}.js`);
48
+ const configPath = presetName
49
+ ? path.resolve(__dirname, `../dist/${presetName}.js`)
50
+ : undefined;
23
51
 
24
52
  const hasPath = toolArgs.some((a) => !a.startsWith('-'));
25
53
  const hasMaxWarn = toolArgs.some((a) => a.startsWith('--max-warnings'));
@@ -28,7 +56,7 @@ const hasReportUnused = toolArgs.some((a) =>
28
56
  );
29
57
 
30
58
  const finalArgs = [
31
- '--config',
59
+ configPath ? '--config' : undefined,
32
60
  configPath,
33
61
  hasPath ? undefined : 'src',
34
62
  hasMaxWarn ? undefined : '--max-warnings=0',