@ankhorage/devtools 1.0.0 → 1.0.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/README.md +39 -54
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,78 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# devtools
|
|
2
2
|
|
|
3
|
-
Shared
|
|
3
|
+
Shared ESLint and Prettier configuration for modern TypeScript projects.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## What you get
|
|
6
|
+
- Consistent linting across repos
|
|
7
|
+
- Zero-config Prettier setup
|
|
8
|
+
- Strict TypeScript rules without compromise
|
|
9
|
+
- One source of truth for tooling
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
- Flat ESLint config (latest standard)
|
|
13
|
+
- Preconfigured plugin ecosystem
|
|
14
|
+
- Prettier integration
|
|
15
|
+
- Monorepo-friendly
|
|
6
16
|
|
|
7
17
|
## Installation
|
|
8
18
|
|
|
9
19
|
```bash
|
|
10
|
-
bun add -
|
|
11
|
-
# or
|
|
12
|
-
npm install --save-dev @ankhorage/devtools
|
|
20
|
+
bun add -D @ankhorage/devtools
|
|
13
21
|
```
|
|
14
22
|
|
|
15
|
-
## Features
|
|
16
|
-
|
|
17
|
-
- **One Package, Two Exports**: Access everything via `@ankhorage/devtools/eslint` and `@ankhorage/devtools/prettier`.
|
|
18
|
-
- **Modern Standards**: Built for ESLint 9+ and Prettier 3+.
|
|
19
|
-
- **Type-Safe**: Uses `typescript-eslint`'s recommended type-checked and stylistic rules.
|
|
20
|
-
- **Unified Policy**: Converges all repositories to a single, high-quality linting standard.
|
|
21
|
-
|
|
22
23
|
## Usage
|
|
23
24
|
|
|
24
25
|
### ESLint
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
```javascript
|
|
29
|
-
import path from 'node:path';
|
|
30
|
-
import { fileURLToPath } from 'node:url';
|
|
31
|
-
import { createConfig } from '@ankhorage/devtools/eslint';
|
|
32
|
-
|
|
33
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
27
|
+
```js
|
|
28
|
+
import config from '@ankhorage/devtools/eslint'
|
|
34
29
|
|
|
35
|
-
export default
|
|
36
|
-
tsconfigRootDir: __dirname,
|
|
37
|
-
project: ['./tsconfig.json'],
|
|
38
|
-
files: ['src/**/*.ts'],
|
|
39
|
-
});
|
|
30
|
+
export default config()
|
|
40
31
|
```
|
|
41
32
|
|
|
42
|
-
#### Configuration Options
|
|
43
|
-
|
|
44
|
-
The `createConfig` function accepts the following required options:
|
|
45
|
-
|
|
46
|
-
- `tsconfigRootDir`: The root directory for tsconfig resolution (typically `import.meta.dirname` or equivalent).
|
|
47
|
-
- `project`: An array of paths to your `tsconfig` files (e.g., `['./tsconfig.json']`).
|
|
48
|
-
- `files`: An array of glob patterns for the files you want to lint (e.g., `['src/**/*.{ts,tsx}']`).
|
|
49
|
-
|
|
50
|
-
Optional options:
|
|
51
|
-
|
|
52
|
-
- `allowDefaultProject`: Glob patterns for files to allow in the default project.
|
|
53
|
-
- `additionalIgnores`: Extra glob patterns to ignore.
|
|
54
|
-
- `restrictedImports`: An array of `{ name, message }` objects to append to the default restricted imports.
|
|
55
|
-
- `overrides`: An array of raw ESLint flat config objects to append to the configuration.
|
|
56
|
-
- `includePrettier`: Whether to include the Prettier configuration (defaults to `true`).
|
|
57
|
-
|
|
58
33
|
### Prettier
|
|
59
34
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
module.exports = require('@ankhorage/devtools/prettier');
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"extends": "@ankhorage/devtools/prettier"
|
|
38
|
+
}
|
|
65
39
|
```
|
|
66
40
|
|
|
67
|
-
|
|
41
|
+
## Use Cases
|
|
42
|
+
- Monorepos with shared standards
|
|
43
|
+
- Teams that want strict, predictable linting
|
|
44
|
+
- Projects avoiding duplicated config
|
|
45
|
+
|
|
46
|
+
## Why this exists
|
|
68
47
|
|
|
69
|
-
|
|
48
|
+
Maintaining ESLint + Prettier configs across multiple repositories leads to:
|
|
49
|
+
- duplication
|
|
50
|
+
- inconsistency
|
|
51
|
+
- drift over time
|
|
70
52
|
|
|
71
|
-
|
|
53
|
+
This package centralizes tooling so all projects stay aligned.
|
|
72
54
|
|
|
73
|
-
|
|
74
|
-
- `examples/package/eslint.config.mjs`: For standalone package structures.
|
|
55
|
+
## Scope
|
|
75
56
|
|
|
76
|
-
|
|
57
|
+
Includes:
|
|
58
|
+
- ESLint configuration
|
|
59
|
+
- Prettier configuration
|
|
77
60
|
|
|
78
|
-
|
|
61
|
+
Excludes:
|
|
62
|
+
- runtime code
|
|
63
|
+
- build tooling
|