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