adamantite 0.17.0 → 0.19.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/README.md +88 -74
- package/dist/index.js +275 -145
- package/package.json +12 -11
- package/presets/oxlint/core.json +439 -0
- package/presets/oxlint/jest.json +65 -0
- package/presets/oxlint/nextjs.json +28 -0
- package/presets/oxlint/node.json +11 -0
- package/presets/oxlint/react.json +88 -0
- package/presets/oxlint/vitest.json +16 -0
- package/presets/oxlint/vue.json +27 -0
- package/presets/tsconfig.json +2 -0
- package/presets/biome.jsonc +0 -439
package/README.md
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<h1 align="center">💠 Adamantite</h1>
|
|
3
3
|
<p align="center">
|
|
4
|
-
<
|
|
5
|
-
</p>
|
|
6
|
-
<p align="center">
|
|
7
|
-
Opinionated linting, formatting, and type-safety presets for modern TypeScript applications.<br>
|
|
8
|
-
Designed for humans and AI.
|
|
4
|
+
<strong>Opinionated linting, formatting, type-safety and code quality presets for modern TypeScript applications.</strong>
|
|
9
5
|
</p>
|
|
10
6
|
</p>
|
|
11
7
|
|
|
@@ -21,6 +17,13 @@
|
|
|
21
17
|
</a>
|
|
22
18
|
</p>
|
|
23
19
|
|
|
20
|
+
Adamantite is a collection of presets for
|
|
21
|
+
[oxlint](https://oxc.rs/docs/guide/usage/linter.html),
|
|
22
|
+
[oxfmt](https://oxc.rs/docs/guide/usage/formatter.html),
|
|
23
|
+
[tsgo](https://github.com/microsoft/typescript-go) and
|
|
24
|
+
[sherif](https://github.com/QuiiBz/sherif) that are designed to help humans and agents write
|
|
25
|
+
maintainable and scalable type-safe code, both for individual projects and monorepos.
|
|
26
|
+
|
|
24
27
|
---
|
|
25
28
|
|
|
26
29
|
## Quick Start
|
|
@@ -33,14 +36,24 @@ npx adamantite init
|
|
|
33
36
|
|
|
34
37
|
Adamantite will automatically configure your project with linting, formatting, and type-safety rules.
|
|
35
38
|
|
|
39
|
+
```shell
|
|
40
|
+
adamantite check # Check code for issues without fixing using oxlint
|
|
41
|
+
adamantite fix # Fix code issues using oxlint
|
|
42
|
+
adamantite format # Format code using oxfmt
|
|
43
|
+
adamantite typecheck # Run TypeScript type checking using the strict preset
|
|
44
|
+
adamantite monorepo # Check monorepo for dependency issues using Sherif
|
|
45
|
+
adamantite update # Update Adamantite's dependencies to the latest compatible versions
|
|
46
|
+
```
|
|
47
|
+
|
|
36
48
|
## Features
|
|
37
49
|
|
|
38
|
-
- **⚡ Fast performance**: Built on
|
|
39
|
-
- **🔍 Extensive linting**:
|
|
50
|
+
- **⚡ Fast performance**: Built on oxc's Rust-based architecture for 10-40x faster linting than ESLint
|
|
51
|
+
- **🔍 Extensive linting**: 500+ rules covering correctness, performance, security, and accessibility
|
|
40
52
|
- **🎯 Zero configuration**: Works out of the box with sensible defaults, no setup required
|
|
41
|
-
- **🔧 Single tool solution**:
|
|
53
|
+
- **🔧 Single tool solution**: Leverages the oxc ecosystem for linting and formatting
|
|
42
54
|
- **🛡️ Strict type safety**: Comes with a strict TypeScript preset to improve type safety across your codebase
|
|
43
55
|
- **🏗️ Monorepo support**: Unified configuration and dependency management across workspace packages
|
|
56
|
+
- **⚙️ CI-friendly**: Automatically configures GitHub Actions workflows to run checks in CI
|
|
44
57
|
- **🤖 AI-friendly patterns**: Consistent code style designed for effective AI collaboration
|
|
45
58
|
|
|
46
59
|
## Installation
|
|
@@ -53,35 +66,19 @@ npx adamantite init
|
|
|
53
66
|
|
|
54
67
|
This interactive command will:
|
|
55
68
|
|
|
56
|
-
- Install Adamantite and [
|
|
57
|
-
- Create
|
|
69
|
+
- Install Adamantite, [oxlint](https://oxc.rs/docs/guide/usage/linter.html), and [oxfmt](https://oxc.rs/docs/guide/usage/formatter.html) as dev dependencies
|
|
70
|
+
- Create `.oxlintrc.json` with opinionated presets
|
|
71
|
+
- Create `.oxfmtrc.json` with formatting configuration
|
|
58
72
|
- Set up `tsconfig.json` with strict TypeScript rules
|
|
59
73
|
- Add lint/format scripts to your `package.json`
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
### Manual Setup
|
|
64
|
-
|
|
65
|
-
If you prefer manual configuration:
|
|
66
|
-
|
|
67
|
-
```shell
|
|
68
|
-
# Install dependencies
|
|
69
|
-
npm install --save-dev adamantite @biomejs/biome
|
|
70
|
-
|
|
71
|
-
# Extend the Biome configuration
|
|
72
|
-
echo '{ "extends": ["adamantite"] }' > biome.jsonc
|
|
73
|
-
|
|
74
|
-
# Extend TypeScript configuration
|
|
75
|
-
echo '{ "extends": "adamantite/typescript" }' > tsconfig.json
|
|
76
|
-
```
|
|
74
|
+
- Also adds monorepo-specific scripts if running a monorepo
|
|
75
|
+
- Configure editor settings
|
|
77
76
|
|
|
78
77
|
## 📋 Commands
|
|
79
78
|
|
|
80
|
-
Adamantite provides a comprehensive CLI for all your code quality needs:
|
|
81
|
-
|
|
82
79
|
### `adamantite check`
|
|
83
80
|
|
|
84
|
-
Check your code for issues without automatically fixing them:
|
|
81
|
+
Check your code for issues without automatically fixing them using oxlint:
|
|
85
82
|
|
|
86
83
|
```shell
|
|
87
84
|
# Check all files
|
|
@@ -89,9 +86,6 @@ adamantite check
|
|
|
89
86
|
|
|
90
87
|
# Check specific files
|
|
91
88
|
adamantite check src/components/**/*.ts
|
|
92
|
-
|
|
93
|
-
# Show summary of results
|
|
94
|
-
adamantite check --summary
|
|
95
89
|
```
|
|
96
90
|
|
|
97
91
|
### `adamantite fix`
|
|
@@ -105,23 +99,29 @@ adamantite fix
|
|
|
105
99
|
# Fix specific files
|
|
106
100
|
adamantite fix src/utils.ts
|
|
107
101
|
|
|
108
|
-
# Apply
|
|
109
|
-
adamantite fix --
|
|
102
|
+
# Apply suggested fixes
|
|
103
|
+
adamantite fix --suggested
|
|
104
|
+
|
|
105
|
+
# Apply dangerous fixes
|
|
106
|
+
adamantite fix --dangerous
|
|
107
|
+
|
|
108
|
+
# Apply all fixes
|
|
109
|
+
adamantite fix --all
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
### `adamantite
|
|
112
|
+
### `adamantite format`
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
Format your code using oxfmt:
|
|
115
115
|
|
|
116
116
|
```shell
|
|
117
|
-
#
|
|
118
|
-
adamantite
|
|
117
|
+
# Format all files
|
|
118
|
+
adamantite format
|
|
119
119
|
|
|
120
|
-
#
|
|
121
|
-
adamantite
|
|
120
|
+
# Format specific files
|
|
121
|
+
adamantite format src/utils.ts
|
|
122
122
|
|
|
123
|
-
#
|
|
124
|
-
adamantite
|
|
123
|
+
# Check if files are formatted without writing
|
|
124
|
+
adamantite format --check
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
### `adamantite monorepo`
|
|
@@ -143,6 +143,18 @@ Automatically detects and fixes:
|
|
|
143
143
|
- Unused dependencies
|
|
144
144
|
- Package.json formatting issues
|
|
145
145
|
|
|
146
|
+
### `adamantite typecheck`
|
|
147
|
+
|
|
148
|
+
Run TypeScript type checking using tsgo (TypeScript Go) and the strict preset:
|
|
149
|
+
|
|
150
|
+
```shell
|
|
151
|
+
# Type check all files
|
|
152
|
+
adamantite typecheck
|
|
153
|
+
|
|
154
|
+
# Type check specific files
|
|
155
|
+
adamantite typecheck src/utils.ts
|
|
156
|
+
```
|
|
157
|
+
|
|
146
158
|
### `adamantite update`
|
|
147
159
|
|
|
148
160
|
Keep your dependencies current:
|
|
@@ -154,38 +166,40 @@ adamantite update
|
|
|
154
166
|
|
|
155
167
|
## Presets
|
|
156
168
|
|
|
157
|
-
###
|
|
158
|
-
|
|
159
|
-
Adamantite
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
- **
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
169
|
+
### Linting ([presets/oxlint/](./presets/oxlint/))
|
|
170
|
+
|
|
171
|
+
Adamantite provides comprehensive linting rules for TypeScript and JavaScript:
|
|
172
|
+
|
|
173
|
+
#### Core ([core.json](./presets/oxlint/core.json))
|
|
174
|
+
|
|
175
|
+
Extensive ruleset covering:
|
|
176
|
+
|
|
177
|
+
- **Correctness**: Bug prevention and code correctness enforcement
|
|
178
|
+
- **Performance**: Optimization patterns and performance best practices
|
|
179
|
+
- **Restriction**: Enforcing coding standards and preventing problematic patterns
|
|
180
|
+
- **Suspicious**: Detecting code smells and potential bugs
|
|
181
|
+
- **Pedantic**: Strict code quality and consistency enforcement
|
|
182
|
+
- **Style**: Consistent code formatting and naming conventions
|
|
183
|
+
- **Nursery**: Experimental rules under active development
|
|
184
|
+
|
|
185
|
+
#### Framework Presets
|
|
186
|
+
|
|
187
|
+
Framework-specific presets are available for:
|
|
188
|
+
|
|
189
|
+
- **React** ([react.json](./presets/oxlint/react.json)) - React, React-perf, and JSX-a11y rules
|
|
190
|
+
- **Next.js** ([nextjs.json](./presets/oxlint/nextjs.json)) - Next.js-specific rules
|
|
191
|
+
- **Vue** ([vue.json](./presets/oxlint/vue.json)) - Vue.js rules
|
|
192
|
+
- **Node.js** ([node.json](./presets/oxlint/node.json)) - Node.js-specific rules
|
|
193
|
+
- **Jest** ([jest.json](./presets/oxlint/jest.json)) - Jest testing rules
|
|
194
|
+
- **Vitest** ([vitest.json](./presets/oxlint/vitest.json)) - Vitest testing rules
|
|
195
|
+
|
|
196
|
+
### Formatting ([presets/oxfmt.json](./presets/oxfmt.json))
|
|
197
|
+
|
|
198
|
+
Opinionated code formatting with oxfmt, configured for consistency and readability. Includes automatic import sorting and organization.
|
|
199
|
+
|
|
200
|
+
### TypeScript ([presets/tsconfig.json](./presets/tsconfig.json))
|
|
187
201
|
|
|
188
|
-
|
|
202
|
+
Strict TypeScript configuration for maximum type safety. Catches errors at compile-time that would otherwise cause runtime failures.
|
|
189
203
|
|
|
190
204
|
## 🛠️ Development
|
|
191
205
|
|