open-index/open-npm huggingface dataset:
npm package: @rnzeus/themis
Description: Shared ESLint, Prettier, TypeScript and optional Babel configs used across RNZeus projects
Latest version: 0.1.3

# @rnzeus/themis

Shared ESLint, Prettier, TypeScript **and optional Babel** configuration presets used across RNZeus projects.

The goal of **Themis** is to provide a clean, predictable base configuration that can be reused across multiple projects, while keeping **project-specific structure decisions opt-in**.

---

## Installation

```bash
npm install -D @rnzeus/themis
```

---

## ESLint

### Base config

```js
// eslint.config.js
import base from "@rnzeus/themis/eslint";

export default [...base];
```

### FSD / team preset

```js
// eslint.config.js
import base from "@rnzeus/themis/eslint";
import fsd from "@rnzeus/themis/eslint/fsd";

export default [...base, ...fsd];
```

---

## Prettier

```js
// prettier.config.cjs
module.exports = require("@rnzeus/themis/prettier");
```

---

## TypeScript

### Base

```json
{
  "extends": "@rnzeus/themis/tsconfig/base"
}
```

### React Native

```json
{
  "extends": "@rnzeus/themis/tsconfig/react-native"
}
```

### FSD / team preset

```json
{
  "extends": "@rnzeus/themis/tsconfig/rnfsd"
}
```

---

## ⚠️ Important: `baseUrl` and `paths`

The presets provided by **Themis intentionally do NOT define `baseUrl`**.

This is a conscious design decision:

- `baseUrl` inside a shared preset breaks resolution when used via `extends`
- the value becomes relative to `node_modules/@rnzeus/themis`, not your project
- this causes subtle and hard-to-debug TypeScript resolution issues

### What this means for FSD presets

If you use `rnfsd.json` (or any preset that defines `paths`):

👉 **you must define `baseUrl` in your project tsconfig**

Example:

```json
{
  "extends": "@rnzeus/themis/tsconfig/rnfsd.json",
  "compilerOptions": {
    "baseUrl": "./src"
  }
}
```

---

## Babel (optional)

Babel configuration is **optional** and provided as opt-in presets.
It is useful mainly for React Native projects to keep module aliases in sync with FSD structure.

### Base Babel config

```js
// babel.config.js
const base = require("@rnzeus/themis/babel/base");

module.exports = {
  ...base,
};
```

### FSD module resolver

```js
// babel.config.js
const base = require("@rnzeus/themis/babel/base");
const rnfsd = require("@rnzeus/themis/babel/rnfsd-module-resolver");

module.exports = {
  ...base,
  plugins: [...(base.plugins ?? []), ["module-resolver", rnfsd]],
};
```

### Why aliases are defined in Babel

TypeScript `paths` are used only for type-checking and editor support.
They do **not** rewrite import paths in emitted JavaScript.

Babel (together with Metro) must also understand aliases,
otherwise React Native will fail to resolve modules at runtime.

---

## Peer dependencies

@rnzeus/themis is a configuration-only package.

It expects ESLint, Prettier and TypeScript to be installed in your project.
Refer to `peerDependencies` in `package.json` for the full list.

---

## License

MIT