@autofleet/lint 1.0.3 → 2.0.1-beta-56743d4c.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/.oxfmtrc.json +2 -14
- package/.prettierignore +28 -0
- package/MIGRATION_GAPS.md +17 -14
- package/README.md +18 -53
- package/bin/eslint.js +48 -0
- package/bin/{oxfmt.cjs → oxfmt.js} +9 -6
- package/bin/{oxlint.cjs → oxlint.js} +4 -3
- package/bin/prettier.js +38 -0
- package/oxlint.config.mjs +241 -0
- package/package.json +9 -10
- package/.oxlintrc.json +0 -255
- package/RULES.md +0 -396
- package/bin/postinstall.cjs +0 -87
package/.oxfmtrc.json
CHANGED
|
@@ -2,21 +2,9 @@
|
|
|
2
2
|
"semi": true,
|
|
3
3
|
"trailingComma": "all",
|
|
4
4
|
"singleQuote": true,
|
|
5
|
-
"printWidth":
|
|
5
|
+
"printWidth": 120,
|
|
6
6
|
"tabWidth": 2,
|
|
7
7
|
"useTabs": false,
|
|
8
8
|
"arrowParens": "always",
|
|
9
|
-
"endOfLine": "lf"
|
|
10
|
-
"ignorePatterns": [
|
|
11
|
-
"dist",
|
|
12
|
-
"build",
|
|
13
|
-
"node_modules",
|
|
14
|
-
"coverage",
|
|
15
|
-
"**/migrations/*",
|
|
16
|
-
"*.min.js",
|
|
17
|
-
"*.min.css",
|
|
18
|
-
"package-lock.json",
|
|
19
|
-
"pnpm-lock.yaml",
|
|
20
|
-
"yarn.lock"
|
|
21
|
-
]
|
|
9
|
+
"endOfLine": "lf"
|
|
22
10
|
}
|
package/.prettierignore
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# Build output
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
|
|
8
|
+
# Coverage
|
|
9
|
+
coverage/
|
|
10
|
+
|
|
11
|
+
# Logs
|
|
12
|
+
*.log
|
|
13
|
+
npm-debug.log*
|
|
14
|
+
|
|
15
|
+
# Environment files
|
|
16
|
+
.env
|
|
17
|
+
.env.*
|
|
18
|
+
|
|
19
|
+
# Generated files
|
|
20
|
+
**/migrations/
|
|
21
|
+
*.generated.*
|
|
22
|
+
|
|
23
|
+
# Test snapshots
|
|
24
|
+
*.snap
|
|
25
|
+
|
|
26
|
+
# Config files that shouldn't be formatted
|
|
27
|
+
package-lock.json
|
|
28
|
+
tsconfig*.json
|
package/MIGRATION_GAPS.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Migration Gaps: ESLint → Oxlint/Oxfmt
|
|
1
|
+
# Migration Gaps: ESLint/Prettier → Oxlint/Oxfmt
|
|
2
2
|
|
|
3
|
-
This document outlines the rules and features from our previous ESLint setup that are **NOT available** in Oxlint/Oxfmt.
|
|
3
|
+
This document outlines the rules and features from our previous ESLint + Prettier setup that are **NOT available** in Oxlint/Oxfmt.
|
|
4
4
|
|
|
5
5
|
## Summary
|
|
6
6
|
|
|
7
|
-
- **Previous Setup**: ESLint (190+ rules) + Oxlint (detection only)
|
|
7
|
+
- **Previous Setup**: ESLint (190+ rules) + Prettier + Oxlint (detection only)
|
|
8
8
|
- **New Setup**: Oxlint (140+ rules migrated) + Oxfmt
|
|
9
9
|
- **Total Gaps**: ~50 rules not supported + some configuration features
|
|
10
10
|
|
|
@@ -21,7 +21,7 @@ This document outlines the rules and features from our previous ESLint setup tha
|
|
|
21
21
|
| `import/extensions` | Not implemented | TypeScript handles this |
|
|
22
22
|
| `import/prefer-default-export` | Not implemented | Follow convention manually |
|
|
23
23
|
| `import/no-extraneous-dependencies` | Not implemented | Manual package.json review |
|
|
24
|
-
| `max-len` | Formatting rule - handled by Oxfmt differently | Oxfmt uses `printWidth:
|
|
24
|
+
| `max-len` | Formatting rule - handled by Oxfmt differently | Oxfmt uses `printWidth: 120` |
|
|
25
25
|
|
|
26
26
|
### TypeScript ESLint Rules (Not in Oxlint)
|
|
27
27
|
|
|
@@ -169,21 +169,24 @@ export default config;
|
|
|
169
169
|
|
|
170
170
|
---
|
|
171
171
|
|
|
172
|
-
## 🎨 Oxfmt
|
|
172
|
+
## 🎨 Oxfmt vs Prettier Feature Gaps
|
|
173
173
|
|
|
174
|
-
### Features NOT in Oxfmt
|
|
174
|
+
### Prettier Features NOT in Oxfmt
|
|
175
175
|
|
|
176
176
|
| Feature | Status | Impact |
|
|
177
177
|
|---------|--------|--------|
|
|
178
178
|
| Embedded language formatting (CSS-in-JS, HTML in JS) | ⏳ Coming in Beta | Medium - may need manual formatting for styled-components |
|
|
179
|
-
| Plugin system | ⏳ Researching for Beta | Low |
|
|
179
|
+
| Plugin system | ⏳ Researching for Beta | Low - we don't use Prettier plugins |
|
|
180
180
|
| Vue/Svelte/Astro support | ⏳ Coming in Beta | N/A - not used in task-ms |
|
|
181
|
+
| `.prettierignore` patterns | ⚠️ Manual copy needed | Low - copy patterns to consumer projects |
|
|
181
182
|
|
|
182
|
-
### Oxfmt
|
|
183
|
+
### Oxfmt Differences from Prettier
|
|
183
184
|
|
|
184
|
-
1. **Default Line Width**: Oxfmt defaults to 100
|
|
185
|
+
1. **Default Line Width**: Oxfmt defaults to 100 instead of Prettier's 80
|
|
186
|
+
- ✅ We set it to 120 in both, so no issue
|
|
185
187
|
|
|
186
|
-
2. **Formatting Algorithm**: May produce slightly different output in edge cases
|
|
188
|
+
2. **Formatting Algorithm**: May produce slightly different output in edge cases
|
|
189
|
+
- ✅ Oxfmt aims for 99.99% compatibility, currently at ~95%
|
|
187
190
|
|
|
188
191
|
3. **Configuration Options**: All major options supported
|
|
189
192
|
- ✅ Our config (semi, singleQuote, trailingComma, etc.) fully supported
|
|
@@ -233,13 +236,13 @@ export default config;
|
|
|
233
236
|
|
|
234
237
|
### Simplicity
|
|
235
238
|
|
|
236
|
-
- **Before**: 10 packages (ESLint + 6 plugins + TypeScript plugins)
|
|
239
|
+
- **Before**: 10 packages (ESLint + 6 plugins + TypeScript plugins + Prettier)
|
|
237
240
|
- **After**: 2 packages (Oxlint + Oxfmt)
|
|
238
241
|
- **Config Complexity**: Reduced from 220 lines to 140 lines
|
|
239
242
|
|
|
240
243
|
### Maintenance
|
|
241
244
|
|
|
242
|
-
- **Before**: Manage ESLint, TypeScript ESLint, Airbnb, Unicorn compatibility
|
|
245
|
+
- **Before**: Manage ESLint, TypeScript ESLint, Airbnb, Unicorn, Prettier compatibility
|
|
243
246
|
- **After**: Single Oxc project maintains all rules
|
|
244
247
|
|
|
245
248
|
---
|
|
@@ -295,5 +298,5 @@ Watch Oxc project for:
|
|
|
295
298
|
|
|
296
299
|
---
|
|
297
300
|
|
|
298
|
-
**Last Updated**: 2026-
|
|
299
|
-
**Migration Version**: ESLint 8.57 → Oxlint 1.
|
|
301
|
+
**Last Updated**: 2026-02-10
|
|
302
|
+
**Migration Version**: ESLint 8.57 + Prettier 3.8 → Oxlint 1.16 + Oxfmt 0.1
|
package/README.md
CHANGED
|
@@ -65,49 +65,28 @@ autofleet-fmt src/utils/**/*.ts
|
|
|
65
65
|
|
|
66
66
|
### Oxlint Configuration
|
|
67
67
|
|
|
68
|
-
✅ **
|
|
68
|
+
✅ **TypeScript Config** (since v1.43.0) - Create an `oxlint.config.ts` in your project:
|
|
69
69
|
|
|
70
|
-
```
|
|
71
|
-
{
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
**Override rules** for your specific project:
|
|
77
|
-
|
|
78
|
-
```json
|
|
79
|
-
{
|
|
80
|
-
"extends": ["./node_modules/@autofleet/lint/.oxlintrc.json"],
|
|
81
|
-
"rules": {
|
|
82
|
-
"no-console": "off",
|
|
83
|
-
"unicorn/no-array-callback-reference": "off"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
```
|
|
70
|
+
```typescript
|
|
71
|
+
import type { Linter } from 'oxlint';
|
|
72
|
+
import baseConfig from './node_modules/@autofleet/lint/oxlint.config';
|
|
87
73
|
|
|
88
|
-
|
|
74
|
+
const config: Linter.Config = {
|
|
75
|
+
...baseConfig,
|
|
76
|
+
// Project-specific rule overrides
|
|
77
|
+
rules: {
|
|
78
|
+
...baseConfig.rules,
|
|
79
|
+
'unicorn/no-array-callback-reference': 'off',
|
|
80
|
+
},
|
|
81
|
+
};
|
|
89
82
|
|
|
90
|
-
|
|
91
|
-
{
|
|
92
|
-
"extends": ["./node_modules/@autofleet/lint/.oxlintrc.json"],
|
|
93
|
-
"overrides": [
|
|
94
|
-
{
|
|
95
|
-
"files": ["scripts/**/*.js"],
|
|
96
|
-
"rules": {
|
|
97
|
-
"no-console": "off"
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"files": ["**/*.test.ts"],
|
|
102
|
-
"rules": {
|
|
103
|
-
"typescript/no-explicit-any": "off"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
}
|
|
83
|
+
export default config;
|
|
108
84
|
```
|
|
109
85
|
|
|
110
|
-
**
|
|
86
|
+
**Benefits:**
|
|
87
|
+
- ✅ Type safety with full autocomplete
|
|
88
|
+
- ✅ Inline documentation via TypeScript types
|
|
89
|
+
- ✅ No JSON limitations (real comments, dynamic logic)
|
|
111
90
|
|
|
112
91
|
### Oxfmt Configuration
|
|
113
92
|
|
|
@@ -128,24 +107,10 @@ Our default settings:
|
|
|
128
107
|
"tabWidth": 2,
|
|
129
108
|
"useTabs": false,
|
|
130
109
|
"arrowParens": "always",
|
|
131
|
-
"endOfLine": "lf"
|
|
132
|
-
"ignorePatterns": [
|
|
133
|
-
"dist",
|
|
134
|
-
"build",
|
|
135
|
-
"node_modules",
|
|
136
|
-
"coverage",
|
|
137
|
-
"**/migrations/*",
|
|
138
|
-
"*.min.js",
|
|
139
|
-
"*.min.css",
|
|
140
|
-
"package-lock.json",
|
|
141
|
-
"pnpm-lock.yaml",
|
|
142
|
-
"yarn.lock"
|
|
143
|
-
]
|
|
110
|
+
"endOfLine": "lf"
|
|
144
111
|
}
|
|
145
112
|
```
|
|
146
113
|
|
|
147
|
-
**Note**: Oxfmt also respects `.gitignore` files automatically.
|
|
148
|
-
|
|
149
114
|
## 🎨 VSCode Integration
|
|
150
115
|
|
|
151
116
|
Install the Oxc extension:
|
package/bin/eslint.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// Wrapper script to run ESLint from @autofleet/lint's dependencies
|
|
4
|
+
const { spawn } = require('child_process');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
// Resolve eslint binary from our package's dependencies
|
|
9
|
+
const eslintBinPath = require.resolve('eslint/package.json', {
|
|
10
|
+
paths: [__dirname]
|
|
11
|
+
});
|
|
12
|
+
const eslintPackageDir = path.dirname(eslintBinPath);
|
|
13
|
+
const eslintBin = path.join(eslintPackageDir, 'bin', 'eslint.js');
|
|
14
|
+
|
|
15
|
+
// Set NODE_PATH to include our package's node_modules for plugin resolution
|
|
16
|
+
const lintPackagePath = path.resolve(__dirname, '..');
|
|
17
|
+
const nodeModulesPath = path.join(lintPackagePath, 'node_modules');
|
|
18
|
+
|
|
19
|
+
const env = {
|
|
20
|
+
...process.env,
|
|
21
|
+
NODE_PATH: nodeModulesPath + (process.env.NODE_PATH ? `:${process.env.NODE_PATH}` : ''),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// Default to 'src' if no arguments provided (and not a flag like --fix)
|
|
25
|
+
const args = process.argv.slice(2);
|
|
26
|
+
const hasPath = args.some(arg => !arg.startsWith('-'));
|
|
27
|
+
if (!hasPath) {
|
|
28
|
+
args.unshift('src');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const child = spawn(process.execPath, [eslintBin, ...args], {
|
|
32
|
+
stdio: 'inherit',
|
|
33
|
+
env,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
child.on('exit', (code) => {
|
|
37
|
+
process.exit(code || 0);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
child.on('error', (err) => {
|
|
41
|
+
console.error('Failed to start eslint:', err.message);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
});
|
|
44
|
+
} catch (err) {
|
|
45
|
+
console.error('Could not find eslint. Make sure @autofleet/lint is properly installed.');
|
|
46
|
+
console.error(err.message);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// Wrapper script to run Oxfmt from @autofleet/lint's dependencies
|
|
4
|
-
const { spawn } = require('
|
|
5
|
-
const path = require('
|
|
4
|
+
const { spawn } = require('child_process');
|
|
5
|
+
const path = require('path');
|
|
6
6
|
|
|
7
7
|
try {
|
|
8
8
|
// Resolve oxfmt module from our package's dependencies
|
|
@@ -16,12 +16,15 @@ try {
|
|
|
16
16
|
// Get args from command line
|
|
17
17
|
const args = process.argv.slice(2);
|
|
18
18
|
|
|
19
|
-
// Check if user passed any
|
|
19
|
+
// Check if user passed any flags or patterns
|
|
20
|
+
const hasFlags = args.some(arg => arg.startsWith('-'));
|
|
20
21
|
const hasPattern = args.some(arg => !arg.startsWith('-'));
|
|
21
22
|
|
|
22
|
-
// Default to 'src' if no pattern provided
|
|
23
|
-
if (!hasPattern) {
|
|
24
|
-
args.push('src');
|
|
23
|
+
// Default to 'src/**/*.{ts,js,json}' if no pattern provided
|
|
24
|
+
if (!hasPattern && !hasFlags) {
|
|
25
|
+
args.push('src/**/*.{ts,js,json}');
|
|
26
|
+
} else if (!hasPattern && hasFlags) {
|
|
27
|
+
args.push('src/**/*.{ts,js,json}');
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
const child = spawn(oxfmtBin, args, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// Wrapper script to run Oxlint from @autofleet/lint's dependencies with auto-fix support
|
|
4
|
-
const { spawn } = require('
|
|
5
|
-
const path = require('
|
|
4
|
+
const { spawn } = require('child_process');
|
|
5
|
+
const path = require('path');
|
|
6
6
|
|
|
7
7
|
try {
|
|
8
8
|
// Resolve oxlint module from our package's dependencies
|
|
@@ -17,7 +17,8 @@ try {
|
|
|
17
17
|
// Get args from command line
|
|
18
18
|
const args = process.argv.slice(2);
|
|
19
19
|
|
|
20
|
-
// Check if user passed any
|
|
20
|
+
// Check if user passed any flags
|
|
21
|
+
const hasFlags = args.some(arg => arg.startsWith('-'));
|
|
21
22
|
const hasPath = args.some(arg => !arg.startsWith('-'));
|
|
22
23
|
|
|
23
24
|
// Default to 'src' if no path provided
|
package/bin/prettier.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// Wrapper script to run Prettier from @autofleet/lint's dependencies
|
|
4
|
+
const { spawn } = require('child_process');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
// Resolve prettier binary from our package's dependencies
|
|
9
|
+
const prettierBinPath = require.resolve('prettier/package.json', {
|
|
10
|
+
paths: [__dirname]
|
|
11
|
+
});
|
|
12
|
+
const prettierPackageDir = path.dirname(prettierBinPath);
|
|
13
|
+
const prettierBin = path.join(prettierPackageDir, 'bin', 'prettier.cjs');
|
|
14
|
+
|
|
15
|
+
// Default to 'src/**/*.{ts,js,json}' if no file pattern provided (only flags)
|
|
16
|
+
const args = process.argv.slice(2);
|
|
17
|
+
const hasPattern = args.some(arg => !arg.startsWith('-'));
|
|
18
|
+
if (!hasPattern) {
|
|
19
|
+
args.push('src/**/*.{ts,js,json}');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const child = spawn(process.execPath, [prettierBin, ...args], {
|
|
23
|
+
stdio: 'inherit',
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
child.on('exit', (code) => {
|
|
27
|
+
process.exit(code || 0);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
child.on('error', (err) => {
|
|
31
|
+
console.error('Failed to start prettier:', err.message);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
});
|
|
34
|
+
} catch (err) {
|
|
35
|
+
console.error('Could not find prettier. Make sure @autofleet/lint is properly installed.');
|
|
36
|
+
console.error(err.message);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { defineConfig } from 'oxlint';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
env: {
|
|
5
|
+
node: true,
|
|
6
|
+
jest: true,
|
|
7
|
+
es2022: true,
|
|
8
|
+
},
|
|
9
|
+
globals: {},
|
|
10
|
+
rules: {
|
|
11
|
+
// Core ESLint rules (migrated from .eslintrc.json)
|
|
12
|
+
'eqeqeq': 'error',
|
|
13
|
+
'curly': 'error',
|
|
14
|
+
'no-console': 'error',
|
|
15
|
+
'no-debugger': 'error',
|
|
16
|
+
'prefer-const': 'error',
|
|
17
|
+
'no-var': 'error',
|
|
18
|
+
'no-async-promise-executor': 'error',
|
|
19
|
+
'prefer-promise-reject-errors': 'error',
|
|
20
|
+
'no-await-in-loop': 'warn',
|
|
21
|
+
'no-constant-condition': 'warn',
|
|
22
|
+
'no-control-regex': 'error',
|
|
23
|
+
'no-duplicate-case': 'error',
|
|
24
|
+
'no-empty': 'warn',
|
|
25
|
+
'no-ex-assign': 'error',
|
|
26
|
+
'no-extra-boolean-cast': 'warn',
|
|
27
|
+
'no-func-assign': 'error',
|
|
28
|
+
'no-inner-declarations': 'error',
|
|
29
|
+
'no-invalid-regexp': 'error',
|
|
30
|
+
'no-irregular-whitespace': 'error',
|
|
31
|
+
'no-loss-of-precision': 'error',
|
|
32
|
+
'no-misleading-character-class': 'error',
|
|
33
|
+
'no-prototype-builtins': 'warn',
|
|
34
|
+
'no-regex-spaces': 'error',
|
|
35
|
+
'no-self-assign': 'error',
|
|
36
|
+
'no-self-compare': 'error',
|
|
37
|
+
'no-setter-return': 'error',
|
|
38
|
+
'no-sparse-arrays': 'error',
|
|
39
|
+
'no-this-before-super': 'error',
|
|
40
|
+
'no-unreachable': 'error',
|
|
41
|
+
'no-unsafe-finally': 'error',
|
|
42
|
+
'no-unsafe-negation': 'error',
|
|
43
|
+
'no-unsafe-optional-chaining': 'error',
|
|
44
|
+
'no-unused-labels': 'error',
|
|
45
|
+
'no-unused-vars': 'error',
|
|
46
|
+
'no-useless-catch': 'warn',
|
|
47
|
+
'no-useless-escape': 'warn',
|
|
48
|
+
'no-with': 'error',
|
|
49
|
+
'require-await': 'warn',
|
|
50
|
+
'use-isnan': 'error',
|
|
51
|
+
'valid-typeof': 'error',
|
|
52
|
+
'no-unused-private-class-members': 'warn',
|
|
53
|
+
'no-useless-backreference': 'error',
|
|
54
|
+
'no-useless-call': 'warn',
|
|
55
|
+
'no-useless-constructor': 'warn',
|
|
56
|
+
'no-useless-rename': 'warn',
|
|
57
|
+
'no-throw-literal': 'error',
|
|
58
|
+
'no-return-assign': 'warn',
|
|
59
|
+
'no-sequences': 'error',
|
|
60
|
+
'no-multi-assign': 'warn',
|
|
61
|
+
'no-nested-ternary': 'warn',
|
|
62
|
+
'no-param-reassign': 'warn',
|
|
63
|
+
'operator-assignment': 'warn',
|
|
64
|
+
'prefer-destructuring': 'warn',
|
|
65
|
+
'prefer-exponentiation-operator': 'warn',
|
|
66
|
+
'prefer-object-spread': 'warn',
|
|
67
|
+
'prefer-rest-params': 'warn',
|
|
68
|
+
'prefer-spread': 'warn',
|
|
69
|
+
'prefer-template': 'warn',
|
|
70
|
+
'no-const-assign': 'error',
|
|
71
|
+
'no-dupe-keys': 'error',
|
|
72
|
+
'no-import-assign': 'error',
|
|
73
|
+
|
|
74
|
+
// TypeScript ESLint rules (migrated from .eslintrc.json)
|
|
75
|
+
'typescript/no-explicit-any': 'warn',
|
|
76
|
+
'typescript/no-unused-vars': 'error',
|
|
77
|
+
'typescript/no-floating-promises': 'error',
|
|
78
|
+
'typescript/await-thenable': 'error',
|
|
79
|
+
'typescript/no-misused-promises': 'error',
|
|
80
|
+
'typescript/require-await': 'warn',
|
|
81
|
+
'typescript/ban-types': 'warn',
|
|
82
|
+
'typescript/no-array-delete': 'error',
|
|
83
|
+
'typescript/no-duplicate-enum-values': 'error',
|
|
84
|
+
'typescript/no-empty-interface': 'warn',
|
|
85
|
+
'typescript/no-extraneous-class': 'warn',
|
|
86
|
+
'typescript/no-for-in-array': 'error',
|
|
87
|
+
'typescript/no-implied-eval': 'error',
|
|
88
|
+
'typescript/no-misused-new': 'error',
|
|
89
|
+
'typescript/no-namespace': 'warn',
|
|
90
|
+
'typescript/no-non-null-assertion': 'warn',
|
|
91
|
+
'typescript/no-this-alias': 'warn',
|
|
92
|
+
'typescript/no-unnecessary-type-assertion': 'warn',
|
|
93
|
+
'typescript/no-unnecessary-type-constraint': 'warn',
|
|
94
|
+
'typescript/no-unsafe-argument': 'warn',
|
|
95
|
+
'typescript/no-unsafe-assignment': 'warn',
|
|
96
|
+
'typescript/no-unsafe-call': 'warn',
|
|
97
|
+
'typescript/no-unsafe-member-access': 'warn',
|
|
98
|
+
'typescript/no-unsafe-return': 'warn',
|
|
99
|
+
'typescript/prefer-as-const': 'warn',
|
|
100
|
+
'typescript/prefer-for-of': 'warn',
|
|
101
|
+
'typescript/prefer-function-type': 'warn',
|
|
102
|
+
'typescript/prefer-includes': 'warn',
|
|
103
|
+
'typescript/prefer-nullish-coalescing': 'warn',
|
|
104
|
+
'typescript/prefer-optional-chain': 'warn',
|
|
105
|
+
'typescript/prefer-ts-expect-error': 'warn',
|
|
106
|
+
'typescript/no-var-requires': 'off',
|
|
107
|
+
'typescript/consistent-type-imports': 'warn',
|
|
108
|
+
'typescript/no-import-type-side-effects': 'error',
|
|
109
|
+
'typescript/adjacent-overload-signatures': 'warn',
|
|
110
|
+
'typescript/array-type': 'warn',
|
|
111
|
+
'typescript/consistent-type-definitions': 'warn',
|
|
112
|
+
'typescript/no-base-to-string': 'warn',
|
|
113
|
+
'typescript/no-confusing-non-null-assertion': 'warn',
|
|
114
|
+
'typescript/no-duplicate-type-constituents': 'warn',
|
|
115
|
+
'typescript/no-extra-non-null-assertion': 'error',
|
|
116
|
+
'typescript/no-unnecessary-boolean-literal-compare': 'warn',
|
|
117
|
+
'typescript/prefer-literal-enum-member': 'warn',
|
|
118
|
+
'typescript/prefer-namespace-keyword': 'warn',
|
|
119
|
+
'typescript/prefer-return-this-type': 'warn',
|
|
120
|
+
|
|
121
|
+
// Unicorn rules (migrated from .eslintrc.json)
|
|
122
|
+
'unicorn/prefer-node-protocol': 'error',
|
|
123
|
+
'unicorn/prefer-array-some': 'error',
|
|
124
|
+
'unicorn/prefer-array-find': 'error',
|
|
125
|
+
'unicorn/prefer-includes': 'error',
|
|
126
|
+
'unicorn/prefer-string-starts-ends-with': 'error',
|
|
127
|
+
'unicorn/throw-new-error': 'error',
|
|
128
|
+
'unicorn/error-message': 'error',
|
|
129
|
+
'unicorn/no-instanceof-array': 'error',
|
|
130
|
+
'unicorn/prefer-default-parameters': 'warn',
|
|
131
|
+
'unicorn/prefer-optional-catch-binding': 'error',
|
|
132
|
+
'unicorn/no-thenable': 'off',
|
|
133
|
+
'unicorn/prefer-spread': 'warn',
|
|
134
|
+
'unicorn/prefer-ternary': 'warn',
|
|
135
|
+
'unicorn/consistent-function-scoping': 'warn',
|
|
136
|
+
'unicorn/no-useless-undefined': 'warn',
|
|
137
|
+
'unicorn/no-nested-ternary': 'warn',
|
|
138
|
+
'unicorn/prefer-at': 'warn',
|
|
139
|
+
'unicorn/prefer-array-flat-map': 'warn',
|
|
140
|
+
'unicorn/prefer-array-index-of': 'warn',
|
|
141
|
+
'unicorn/prefer-set-has': 'warn',
|
|
142
|
+
'unicorn/prefer-string-slice': 'warn',
|
|
143
|
+
'unicorn/prefer-string-replace-all': 'warn',
|
|
144
|
+
'unicorn/prefer-string-trim-start-end': 'warn',
|
|
145
|
+
'unicorn/prefer-math-min-max': 'warn',
|
|
146
|
+
'unicorn/prefer-number-properties': 'warn',
|
|
147
|
+
'unicorn/prefer-object-from-entries': 'warn',
|
|
148
|
+
'unicorn/number-literal-case': 'warn',
|
|
149
|
+
'unicorn/no-lonely-if': 'warn',
|
|
150
|
+
'unicorn/no-useless-spread': 'warn',
|
|
151
|
+
'unicorn/no-useless-fallback-in-spread': 'warn',
|
|
152
|
+
'unicorn/no-useless-length-check': 'warn',
|
|
153
|
+
'unicorn/no-useless-promise-resolve-reject': 'warn',
|
|
154
|
+
'unicorn/prefer-modern-math-apis': 'warn',
|
|
155
|
+
'unicorn/prefer-native-coercion-functions': 'warn',
|
|
156
|
+
'unicorn/prefer-add-event-listener': 'warn',
|
|
157
|
+
'unicorn/prefer-dom-node-append': 'warn',
|
|
158
|
+
'unicorn/prefer-dom-node-remove': 'warn',
|
|
159
|
+
'unicorn/prefer-dom-node-text-content': 'warn',
|
|
160
|
+
'unicorn/prefer-query-selector': 'warn',
|
|
161
|
+
'unicorn/prefer-reflect-apply': 'warn',
|
|
162
|
+
'unicorn/prefer-regexp-test': 'warn',
|
|
163
|
+
'unicorn/prefer-prototype-methods': 'warn',
|
|
164
|
+
'unicorn/prefer-code-point': 'warn',
|
|
165
|
+
'unicorn/prefer-date-now': 'warn',
|
|
166
|
+
'unicorn/prefer-array-flat': 'warn',
|
|
167
|
+
'unicorn/escape-case': 'warn',
|
|
168
|
+
'unicorn/new-for-builtins': 'error',
|
|
169
|
+
'unicorn/no-console-spaces': 'warn',
|
|
170
|
+
'unicorn/no-hex-escape': 'warn',
|
|
171
|
+
'unicorn/no-instanceof-builtins': 'error',
|
|
172
|
+
'unicorn/no-new-array': 'warn',
|
|
173
|
+
'unicorn/no-new-buffer': 'error',
|
|
174
|
+
'unicorn/no-typeof-undefined': 'warn',
|
|
175
|
+
'unicorn/no-unreadable-array-destructuring': 'warn',
|
|
176
|
+
'unicorn/no-unreadable-iife': 'warn',
|
|
177
|
+
'unicorn/consistent-empty-array-spread': 'warn',
|
|
178
|
+
'unicorn/prefer-structured-clone': 'warn',
|
|
179
|
+
'unicorn/prefer-type-error': 'warn',
|
|
180
|
+
'unicorn/relative-url-style': 'warn',
|
|
181
|
+
'unicorn/require-array-join-separator': 'warn',
|
|
182
|
+
'unicorn/require-number-to-fixed-digits-argument': 'warn',
|
|
183
|
+
|
|
184
|
+
// Import rules
|
|
185
|
+
'import/no-duplicates': 'error',
|
|
186
|
+
'import/no-self-import': 'error',
|
|
187
|
+
'import/no-cycle': 'warn',
|
|
188
|
+
'import/named': 'error',
|
|
189
|
+
'import/namespace': 'error',
|
|
190
|
+
'import/default': 'error',
|
|
191
|
+
'import/no-named-as-default': 'warn',
|
|
192
|
+
'import/no-named-as-default-member': 'warn',
|
|
193
|
+
|
|
194
|
+
// Jest rules
|
|
195
|
+
'jest/expect-expect': 'warn',
|
|
196
|
+
'jest/no-alias-methods': 'warn',
|
|
197
|
+
'jest/no-commented-out-tests': 'warn',
|
|
198
|
+
'jest/no-conditional-expect': 'error',
|
|
199
|
+
'jest/no-disabled-tests': 'warn',
|
|
200
|
+
'jest/no-focused-tests': 'error',
|
|
201
|
+
'jest/no-identical-title': 'error',
|
|
202
|
+
'jest/no-jasmine-globals': 'error',
|
|
203
|
+
'jest/no-mocks-import': 'error',
|
|
204
|
+
'jest/no-standalone-expect': 'error',
|
|
205
|
+
'jest/no-test-prefixes': 'warn',
|
|
206
|
+
'jest/valid-describe-callback': 'error',
|
|
207
|
+
'jest/valid-expect': 'error',
|
|
208
|
+
'jest/valid-title': 'warn',
|
|
209
|
+
'jest/prefer-hooks-on-top': 'warn',
|
|
210
|
+
'jest/prefer-spy-on': 'warn',
|
|
211
|
+
'jest/prefer-todo': 'warn',
|
|
212
|
+
|
|
213
|
+
// OXC custom rules
|
|
214
|
+
'oxc/approx-constant': 'warn',
|
|
215
|
+
'oxc/bad-array-method-on-arguments': 'error',
|
|
216
|
+
'oxc/bad-bitwise-operator': 'error',
|
|
217
|
+
'oxc/bad-char-at-comparison': 'error',
|
|
218
|
+
'oxc/bad-comparison-sequence': 'error',
|
|
219
|
+
'oxc/bad-min-max-func': 'error',
|
|
220
|
+
'oxc/bad-object-literal-comparison': 'error',
|
|
221
|
+
'oxc/bad-replace-all-arg': 'error',
|
|
222
|
+
'oxc/const-comparisons': 'error',
|
|
223
|
+
'oxc/double-comparisons': 'error',
|
|
224
|
+
'oxc/erasing-op': 'warn',
|
|
225
|
+
'oxc/misrefactored-assign-op': 'error',
|
|
226
|
+
'oxc/missing-throw': 'error',
|
|
227
|
+
'oxc/no-accumulating-spread': 'warn',
|
|
228
|
+
'oxc/number-arg-out-of-range': 'error',
|
|
229
|
+
'oxc/only-used-in-recursion': 'warn',
|
|
230
|
+
'oxc/uninvoked-array-callback': 'error',
|
|
231
|
+
},
|
|
232
|
+
ignorePatterns: [
|
|
233
|
+
'dist',
|
|
234
|
+
'build',
|
|
235
|
+
'node_modules',
|
|
236
|
+
'coverage',
|
|
237
|
+
'*.config.js',
|
|
238
|
+
'**/migrations/*',
|
|
239
|
+
'**/mock.ts',
|
|
240
|
+
],
|
|
241
|
+
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autofleet/lint",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1-beta-56743d4c.1",
|
|
4
4
|
"description": "Shared Oxlint and Oxfmt configuration for Autofleet projects (Rust-powered, ultra-fast)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"autofleet-lint": "./bin/oxlint.
|
|
8
|
-
"autofleet-fmt": "./bin/oxfmt.
|
|
7
|
+
"autofleet-lint": "./bin/oxlint.js",
|
|
8
|
+
"autofleet-fmt": "./bin/oxfmt.js"
|
|
9
9
|
},
|
|
10
10
|
"author": "Autofleet",
|
|
11
11
|
"license": "ISC",
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"bin/",
|
|
19
|
-
".
|
|
19
|
+
"oxlint.config.mjs",
|
|
20
20
|
".oxfmtrc.json",
|
|
21
|
+
".prettierignore",
|
|
21
22
|
"MIGRATION_GAPS.md",
|
|
22
|
-
"README.md"
|
|
23
|
-
"RULES.md"
|
|
23
|
+
"README.md"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
26
|
+
"oxlint": "^1.43.0",
|
|
27
|
+
"oxfmt": "^0.28.0"
|
|
28
28
|
},
|
|
29
29
|
"keywords": [
|
|
30
30
|
"oxlint",
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
"fast"
|
|
39
39
|
],
|
|
40
40
|
"scripts": {
|
|
41
|
-
"build": "echo 'No build needed - config files only'"
|
|
42
|
-
"postinstall": "node ./bin/postinstall.cjs"
|
|
41
|
+
"build": "echo 'No build needed - config files only'"
|
|
43
42
|
}
|
|
44
43
|
}
|