open-index/open-npm huggingface dataset:
npm package: @reactizer/cookies
Description: Reactizer's cookies.
Latest version: 0.33.1

# @reactizer/cookies

An utility for handling **GDPR** cookie compliance.

## API

Exports an `useCookies` hook, a `CookiesProvider` and a `CookiesConsumer`.

Just hook the `CookiesProvider` up on the client:

```typescript jsx
import { CookiesProvider } from "@reactizer/cookies";

<CookiesProvider>
  <Root />
</CookiesProvider>;
```

Then use the `useCookies` hook:

```typescript
import { useCookies } from "@reactizer/cookies";

const Component = () => {
  const cookies = useCookies();
};
```

Types:

```typescript
export enum Level {
  NECESSARY = "necessary",
  PREFERENCES = "preferences",
  ANALYTICS = "analytics",
  MARKETING = "marketing",
}

export type Settings = {
  preferences: boolean;
  analytics: boolean;
  marketing: boolean;
};

// The context type
export type Cookies = {
  agreed: boolean;
  settings: Settings;
  onAgree: () => void; // marks cookies as agreed
  onChange: (settings: Settings) => void; // changes cookie settings
};
```

## License

MIT
npm package: @reactizer/eslint-config
Description: The best ESlint config.
Author: oreqizer
Latest version: 0.35.5

# @reactizer/eslint-config

The best ESlint config.

## Setup

`yarn add -D eslint @reactizer/eslint-config @babel/eslint-parser`

For `@reactizer/eslint-config/ts`:

- `yarn add -D typescript @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-typescript`

For `@reactizer/eslint-config/jest`:

- `yarn add -D eslint-plugin-jest`

For `@reactizer/eslint-config/react`:

- `yarn add -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y`

Make a `.eslintrc.js` file:

```js
module.exports = {
  extends: [
    "@reactizer",
    "@reactizer/eslint-config/react", // if using React
    "@reactizer/eslint-config/ts", // if using TypeScript
  ],
  overrides: [
    // If using Jest
    {
      files: ["*.spec.js", "*.spec.jsx"], // or .ts, .tsx
      extends: ["@reactizer/eslint-config/jest"],
    },
  ],
};
```

Add to `package.json`:

```json
{
  "scripts": {
    "lint": "eslint ."
  }
}
```

## Prettier

`yarn add prettier`

Prettier rules to avoid conflicts are included, however, `prettier` itself is not.

Install `yarn add prettier -D` separately, create `prettier.config.js` and add the
following scripts to `package.json`:

```json
{
  "scripts": {
    "prettier": "prettier --check . || (echo \"oops 🙀 pls run 'yarn fmt'\" && exit 1)",
    "fmt": "prettier --write ."
  }
}
```

## Development

Benchmark:

- `TIMING=1 eslint ...`

Checking `prettier` conflicts:

- `eslint --print-config index.js | eslint-config-prettier-check`

## License

MIT
npm package: @reactizer/intl
Description: Reactizer's intl.
Latest version: 0.28.0

# @reactizer/intl

A minimalistic `node-polyglot` based **React** hooks-based i18n solution.

## API

API of the `t` function found in the context mirrors `node-polyglot`'s [API](https://airbnb.io/polyglot.js/).

### Core

Mount your provider:
```js
import { IntlProvider } from "@reactizer/intl";

const locale = {
  id: "en-GB",
  translations: {/* ... */},
};

<IntlProvider locale={locale} onChange={id => fetch(/* ... */)}>
  <Root />
</IntlProvider>
```

Use the `useIntl` hook (or `IntlConsumer`):
```js
import { useIntl } from "@reactizer/intl";

const MyComponent = () => {
  const intl = useIntl();
  
  return (
    /* ... */
  );
};
```

### Translate

There's a `Translate` component:

```js
import Translate from "@reactizer/intl/lib/Translate";

<Translate t="lmao" />
```

## License

MIT