open-index/open-npm huggingface dataset:
npm package: @guardian/editorial-newsletters-ts
Description: This library exports types and validation functions for the objects published by the Guardian editorial newsletters API.
Latest version: 0.0.1

# editorial-newsletters-ts

This library exports types and validation functions for the objects published by the Guardian editorial newsletters API.

The three type of "newsletter" objects, each with an "is" validation function:

-   `NewsletterData` - the full newsletter data model, as published on the /api/newsletters route
-   `LegacyNewsletter` - the legacy format for newsletter data, still consumed by existing projects and published on /api/legacy/newsletters
-   `LegacyCancelledNewsletter` - a variant the legacy format for newsletter data, representing a newsletter which is cancelled.

## Running unit tests

Run `nx test editorial-newsletters-ts` to execute the unit tests via [Jest](https://jestjs.io).

## Running lint

Run `nx lint editorial-newsletters-ts` to execute the lint via [ESLint](https://eslint.org/).
npm package: @guardian/eslint-config
Description: ESLint config for Guardian JavaScript projects
Latest version: 14.0.1

# `@guardian/eslint-config`

> ESLint configs for Guardian JavaScript and TypeScript projects.

## Installation

```bash
npm install --save-dev @guardian/eslint-config

# or
yarn add --dev @guardian/eslint-config

# or
pnpm install --save-dev @guardian/eslint-config
```

## Usage

#### Example

```js
// eslint.config.js

import guardian from '@guardian/eslint-config';

export default [
	...guardian.configs.recommended,
	...guardian.configs.jest,
	...guardian.configs.react,
	...guardian.configs.storybook,
];
```

### Configs

The package's default export is an object with a `configs` property that provides configs for different projects.

Some of them are single-purpose, and others compose the single-purpose configs into useful presets.

#### [`configs.recommended`](./configs/recommended.js)

Provides a recommended collection of useful configs covering both JavaScript and TypeScript.

Composes:

- `configs.javascript`
- `configs.typescript`
- `configs.imports`
- `configs.comments`

#### [`configs.javascript`](./configs/javascript.js)

_Included in `configs.recommended`._

Provides a collection of configs for checking JavaScript, which are also applied to TypeScript files.

It automatically detects your project type (using `package.json#type`), and uses an appropriate config for each file.

Composes:

- `configs.esm`
- `configs.cjs`

#### [`configs.esm`](./configs/esm.js)

_Included in `configs.javascript`._

Provides a collection of configs for ECMAScript modules.

It assumes everything will be ECMAScript, and will error if you use it on a CommonJS module.

#### [`configs.cjs`](./configs/cjs.js)

_Included in `configs.javascript`._

Provides a collection of configs for CommonJS modules.

It assumes everything will be CommonJS, and will error if you use it on an ECMAScript module.

#### [`configs.typescript`](./configs/typescript.js)

_Included in `configs.recommended`._

Provides a collection of configs for checking TypeScript.

#### [`configs.imports`](./configs/imports.js)

_Included in `configs.recommended`._

Provides a collection of configs ensuring best practice around module imports and exports.

#### [`configs.comments`](./configs/comments.js)

_Included in `configs.recommended`._

Provides a collection of configs ensuring best practice around code comments.

#### [`configs.jest`](./configs/jest.js)

Provides a collection of configs for checking Jest units tests.

#### [`configs.react`](./configs/react.js)

Provides a collection of configs for checking React components.

#### [`configs.storybook`](./configs/storybook.js)

Provides a collection of configs for checking Storybook stories.

When using the storybook config, be sure to also have `eslint-plugin-storybook` and `storybook` installed in your project, otherwise the config will be ignored.
npm package: @guardian/eslint-config-typescript
Description: ESLint config for Guardian TypeScript projects
Latest version: 12.0.0

# `@guardian/eslint-config-typescript`

> ESLint config for Guardian TypeScript projects.

## Installation

```bash
yarn add -D @guardian/eslint-config-typescript
```

or

```bash
npm install --save-dev @guardian/eslint-config-typescript
```

## Usage

```js
// ESLint configuration file
{
    "extends": "@guardian/eslint-config-typescript"
}
```