# eslint-plugin-shopify-zero

> Zero-dependency ESLint plugin for Shopify's JavaScript style guide

Latest version **0.1.7** (published 2023-05-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-shopify-zero
pnpm add eslint-plugin-shopify-zero
yarn add eslint-plugin-shopify-zero
bun add eslint-plugin-shopify-zero
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2023-05-26 |
| First published | 2023-05-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 194.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tyhopp |
| Keywords | eslint, eslint-config, eslint-plugin |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-shopify-zero
- npm.io page: https://npm.io/package/eslint-plugin-shopify-zero

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 0.1.7 (latest) — 2023-05-26
- 0.1.6 — 2023-05-26
- 0.1.5 — 2023-05-26
- 0.1.4 — 2023-05-26
- 0.1.3 — 2023-05-26
- 0.1.2 — 2023-05-26
- 0.1.1 — 2023-05-26
- 0.1.0 — 2023-05-26

## README

# `eslint-plugin-shopify-zero`

Zero-dependency ESLint plugin for [Shopify's JavaScript style guide](https://github.com/Shopify/javascript).

Includes only React and TypeScript plugins.

## Usage

1. `npm install -D eslint`
2. `npm install -D eslint-plugin-shopify-zero`
3. Extend in `.eslintrc`:

```json
{
  "extends": [
    "plugin:eslint-plugin-shopify-zero/typescript",
    "plugin:eslint-plugin-shopify-zero/react"
  ]
}
```

## Custom rules

This plugin provides the following custom rules:

- [binary-assignment-parens](docs/rules/binary-assignment-parens.md): Require (or disallow) assignments of binary, boolean-producing expressions to be wrapped in parentheses.
- [class-property-semi](docs/rules/class-property-semi.md): Require (or disallow) semicolons for class properties.
- [images-no-direct-imports](docs/rules/images-no-direct-imports.md): Prevent images from being directly imported.
- [jsx-no-complex-expressions](docs/rules/jsx-no-complex-expressions.md): Disallow complex expressions embedded in in JSX.
- [jsx-no-hardcoded-content](docs/rules/jsx-no-hardcoded-content.md): Disallow hardcoded content in JSX.
- [jsx-prefer-fragment-wrappers](docs/rules/jsx-prefer-fragment-wrappers.md): Disallow useless wrapping elements in favour of fragment shorthand in JSX.
- [no-namespace-imports](docs/rules/no-namespace-imports.md): Prevent namespace import declarations.
- [no-useless-computed-properties](docs/rules/no-useless-computed-properties.md): Prevent the usage of unnecessary computed properties.
- [prefer-class-properties](docs/rules/prefer-class-properties.md): Prefer class properties to assignment of literals in constructors.
- [prefer-early-return](docs/rules/prefer-early-return.md): Prefer early returns over full-body conditional wrapping in function declarations.
- [no-ancestor-directory-import](docs/rules/no-ancestor-directory-import.md): Prefer imports from within a directory extend to the file from where they are importing without relying on an index file.
- [prefer-module-scope-constants](docs/rules/prefer-module-scope-constants.md): Prefer that screaming snake case variables always be defined using `const`, and always appear at module scope.
- [react-hooks-strict-return](docs/rules/react-hooks-strict-return.md): Restrict the number of returned items from React hooks.
- [react-initialize-state](docs/rules/react-initialize-state.md): Require that React component state be initialized when it has a non-empty type.
- [react-no-multiple-render-methods](docs/rules/react-no-multiple-render-methods.md): Disallow multiple render methods in React component classes.
- [react-prefer-private-members](docs/rules/react-prefer-private-members.md): Prefer all non-React-specific members be marked private in React class components.
- [react-type-state](docs/rules/react-type-state.md): Require that React component state be typed in TypeScript.
- [restrict-full-import](docs/rules/restrict-full-import.md): Prevent importing the entirety of a package.
- [strict-component-boundaries](docs/rules/strict-component-boundaries.md): Prevent module imports between components.
- [typescript/prefer-pascal-case-enums](docs/rules/typescript/prefer-pascal-case-enums.md): Prefer TypeScript enums be defined using Pascal case.
- [typescript/prefer-singular-enums](docs/rules/typescript/prefer-singular-enums.md): Prefer TypeScript enums be singular.
- [typescript/prefer-build-client-schema](docs/rules/typescript/prefer-build-client-schema.md): Prefer buildClientSchema for schema building.

---
_Source: https://npm.io/package/eslint-plugin-shopify-zero · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
