open-index/open-npm huggingface dataset:
npm package: @sldo/use-tree-walker
Description: TreeWalker API hook for react
Author: Sldo
Latest version: 1.0.0

<div align="center">
  <a href="https://www.npmjs.com/package/@sldo/use-tree-walker">
    <img src="logo.png" width="100%" alt="use-tree-walker" />
  </a>
</div>

<div align="center">
  <a href="https://www.npmjs.com/package/@sldo/use-tree-walker">
    <img alt="npm" src="https://img.shields.io/npm/v/@sldo/use-tree-walker.svg?labelColor=49516F&color=e4d9ff" />
  </a>
  <a href="https://npmjs.org/package/@sldo/use-tree-walker">
    <img alt="downloads" src="https://badgen.net/npm/dm/@sldo/use-tree-walker?labelColor=49516F&color=e4d9ff" />
  </a>
  <a href="https://bundlephobia.com/result?p=@sldo/use-tree-walker">
    <img alt="tree-shakeable" src="https://badgen.net/bundlephobia/tree-shaking/@sldo/use-tree-walker?labelColor=49516F&color=e4d9ff" />
  </a>
  <a href="https://npmjs.org/package/@sldo/use-tree-walker">
    <img alt="types included" src="https://badgen.net/npm/types/@sldo/use-tree-walker?labelColor=49516F&color=e4d9ff" />
  </a>
</div>

# useTreeWalker

Easy use of the TreeWalker API

- Small size < 0.5 Kb
- SSR supports

## Install

```sh
yarn add @sldo/use-tree-walker
# or
npm i @sldo/use-tree-walker --save
```

## Docs:

Full usage documentation - https://dom.spec.whatwg.org/#interface-treewalker

## Changelog

https://github.com/SlDo/useTreeWalker/blob/master/CHANGELOG.md
npm package: @sleavely/bitbucket
Description: Client and utils for Bitbucket Cloud REST APIs
Author: Joakim Hedlund
Latest version: 1.0.0

# @sleavely/bitbucket

API client and collection of common utility methods for managing Bitbucket Cloud via their REST API.

## Usage

```sh
npm install @sleavely/bitbucket
```

```typescript
import { BitbucketClient } from '@sleavely/bitbucket'

const bitbucket = new BitbucketClient({
  auth: {
    username: 'foobar',
    password: 'secret', // Create an app password: https://bitbucket.org/account/settings/app-passwords/
  },
})

console.log(await bitbucket.getCurrentUser())
```

## FAQ

### The response type for xyz is wrong

The initial types were handcrafted according to the [Bitbucket Cloud REST API reference](https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication) which in turn are likely autogenerated from [their OpenAPI schema](https://api.bitbucket.org/swagger.json). Unfortunately their schema in many cases differs from reality, so discrepancies will occur from time to time. Let me know in an issue (or pull request) and I'll do my best to amend it.

### A feature I need is missing!

I've only added utility methods for things I've personally needed in the past, but I'd be happy to add more. In the meantime the public `client` property acts as an escape hatch to the [`got`](https://github.com/sindresorhus/got/tree/v11.8.6) instance:

```typescript
// List branches and tags without the need for helper utils.
await bitbucket.client('/repositories/{workspace}/{repo_slug}/refs')
  .json<unknown>()
  // or simply `.json()`
```
npm package: @sleavely/eslint-config
Description: Personal preferences
Author: Joakim Hedlund
Latest version: 1.0.2

# @sleavely/eslint-config

My personal crutches and preferences for Javascript and Typescript.

## Usage

```sh
npm i --save-dev @sleavely/eslint-config
```

Regardless of you're using Javascript or Typescript you just have to extend `@sleavely`:

```js
// .eslintrc.cjs
module.exports = {
  extends: ['@sleavely'],
}
```

**Typescript** projects also need to use strict mode:

```jsonc
// tsconfig.json
{
  "compilerOptions": {
    "strict": true
  }
}
```

## Rules

I rely on [`standard`](https://github.com/standard/eslint-config-standard) and [`standard-with-typescript`](https://github.com/standard/eslint-config-standard-with-typescript) to do a lot of the heavy lifting, but I've made a few amendments.

### JS

* `comma-dangle` - `always-multiline` makes for easier changes, code reviews, and merges
* `import/no-cycle` - prevents the most obvious cases of circular dependencies
* all of [`@sleavely/js-rules`](https://github.com/Sleavely/eslint-plugin-js-rules)

### TS

In addition to the JS rules, these apply:

* `@typescript-eslint/no-explicit-any` - Javascript goes in .js, not .ts
* ~~`@typescript-eslint/strict-boolean-expressions`~~ is turned off.
* all of [`@sleavely/ts-rules`](https://github.com/Sleavely/eslint-plugin-ts-rules)
npm package: @sleavely/eslint-plugin-js-rules
Description: Opinionated rules for maintainable projects.
Author: Joakim Hedlund
Latest version: 1.0.1

# @sleavely/eslint-plugin-js-rules

Opinionated rules for maintainable projects.

Typescript-specific rules is a separate plugin; [`@sleavely/eslint-plugin-ts-rules`](https://github.com/Sleavely/eslint-plugin-ts-rules)

## Installing

```sh
npm i --save-dev @sleavely/eslint-plugin-js-rules
```

```js
// .eslintrc.cjs
module.exports = {
  // ..
  plugins: [
    '@sleavely/js-rules',
  ],
  rules: {
    '@sleavely/js-rules/destructure-env': ['error', 'always'],
    '@sleavely/js-rules/uppercase-env': ['error', 'always'],
  }
}
```

## Rules

### js-rules/destructure-env

Environment variables that affect how the application runs should be easy to find.

Setting default values that are strings will ensure that you never have to deal with "possibly undefined" cases.

```js
// ✅ Destructured and have default string values
const {
  ENVIRONMENT = 'dev',
  POTATO = '',
} = process.env
console.log(POTATO)

// ❌ Needs destructuring
console.log(process.env.POTATO)

// ❌ Needs destructuring
const { env } = process
console.log(env.POTATO)

// ❌ Needs destructuring
const { env: renamedEnv } = process
console.log(env.POTATO)

// ❌ Needs destructuring
const env = process.env
console.log(env.POTATO)

// ❌ Needs a default string value
const { POTATO } = process.env
console.log(POTATO)
```

```js
// ✅
import foo from 'foo'
const {
  ENV_VAR = ''
} = process.env
export const foobar = () => foo()

// ❌ Only import/require may appear prior to process.env
import foo from 'foo'
export const foobar = () => foo()
const {
  ENV_VAR = ''
} = process.env

// ❌ process.env must be destructured in root scope
export const logEnv () => {
  const {
    ENV_VAR = ''
  } = process.env
  console.log(ENV_VAR)
}
```

### js-rules/uppercase-env

Environment variables are constants throughout your applications lifecycle. Uppercasing environment variables helps distinguish them from other identifiers.

```js
// ✅
const {
  POTATO = ""
} = process.env

// ✅
console.log(process.env.POTATO)

// ❌
const {
  potato = ""
} = process.env

// ❌
console.log(process.env.potato)
```
npm package: @sleavely/eslint-plugin-ts-rules
Description: ## Installing
Author: Joakim Hedlund
Latest version: 1.0.0

# @sleavely/eslint-plugin-ts-rules

## Installing

```sh
npm i --save-dev @sleavely/eslint-plugin-ts-rules
```

```js
// .eslintrc.cjs
module.exports = {
  // ..
  plugins: [
    '@sleavely/ts-rules',
  ],
  rules: {
    '@sleavely/ts-rules/prefer-inferred-const': ['error', 'always'],
  }
}
```

## Rules

### ts-rules/prefer-inferred-const

A `const` variable should generally never change, and even if it does it should be contained within the same type, so inference can be used.

```ts

// ⛔
const name: string = 'foo'
// ✅
const name = 'foo'

// methods _should_ already define a return type or have an inferrable one
const getBurger = (): string => 'Big Mac'
// ⛔
const burger: string = getBurger()
// ✅
const burger = getBurger()

// Sometimes you may want to assign a custom type such as an enum. Use this approach in those cases:
const name = 'foo' as MyCustomTypeThatIsntAPrimitive

const name = 'foo' as const
```