PHPackages                             hershel-theodore-layton/portable-hack-ast-linters-server - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hershel-theodore-layton/portable-hack-ast-linters-server

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hershel-theodore-layton/portable-hack-ast-linters-server
========================================================

A non-Hack distribution of PhaLinters to allow HTL packages to use portable-hack-ast-linters without circular dependencies.

v0.4.6(2mo ago)015.6k↑55.5%20MITHackCI passing

Since May 24Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/hershel-theodore-layton/portable-hack-ast-linters-server)[ Packagist](https://packagist.org/packages/hershel-theodore-layton/portable-hack-ast-linters-server)[ RSS](/packages/hershel-theodore-layton-portable-hack-ast-linters-server/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (28)Used By (20)

portable-hack-ast-linters-server
================================

[](#portable-hack-ast-linters-server)

*A non-Hack distribution of PhaLinters to allow HTL packages to use portable-hack-ast-linters without circular dependencies.*

### New in 2025, Express Docker Native Setup for HTL development

[](#new-in-2025-express-docker-native-setup-for-htl-development)

HTL containers recently became Docker Native. A simple `docker compose up`will automate a lot of the process described in [how to use](#how-to-use). The `CMD` of the [Dockerfile](./Dockerfile) passes `-s -g -b ...`. This will setup your `.vscode/settings.json` for local development, install the lint server globally (in the Docker container), and only trusts the specified bundle.

If this is your first time developing HTL, VSCode will display this prompt after a restart:

```
Do you want to install the recommended extensions from
pranayagarwal and Hershel Theodore Layton for this repository?

```

[PranayAgarwal](https://github.com/PranayAgarwal) is an ex-Slack developer who wrote [VSCode Hack](https://github.com/slackhq/vscode-hack), the Hack language extension for VSCode. This extension provides rich Hack language and HHVM support to VSCode. A must have extension for syntax highlighting, inline squiggles, auto complete, go to definition, and so much more.

[Hershel Theodore Layton](https://github.com/hershel-theodore-layton/) is a pseudonymous Open Source Software developer who wrote [Portable Hack AST Linters Server](./README.md) and many other Hack Open Source libraries. [This extension](https://open-vsx.org/extension/hershel-theodore-layton/dead-simple-lint-server-integration)[1](#user-content-fn-1-eb9e79ea9ed5cdc53863822c8efe278f)listens to changes in your source code and asks a local hhvm http server for squiggles and autofixes.

After installing those extensions, your development environment is ready.

### How to use

[](#how-to-use)

- Optionally install [the VSCode extension](https://open-vsx.org/extension/hershel-theodore-layton/dead-simple-lint-server-integration)[1](#user-content-fn-1-eb9e79ea9ed5cdc53863822c8efe278f) and configure it in `.vscode/settings.json`.
    - `http://localhost:10641?format=json&action=lint-input` is a good default.
- Launch the server using the CLI instructions below.
- Make sure to configure the port is exposed to the host network in Docker.
- Lint the entire project using `curl http://localhost:10641`.
    - The following query parameters are supported:
        - `format=text/vscode-json`
            - `text` (default) output human readable text.
            - `vscode-json` output json for use with the extension.
        - `directories=src,tests`
            - A comma separated list of directory names relative to the project root.
            - Only effective when `action` is `lint-all`
        - `action=lint-all/lint-input`
            - `lint-all` (default) scan all `directories` for lint errors
            - `lint-input` lint the Hack source text sent in the request body.
- Lint files interactively by opening them in VSCode with the extension installed.

### CLI

[](#cli)

This distribution of [PhaLinters](https://github.com/hershel-theodore-layton/portable-hack-ast-linters)can be spawned using the `vendor/bin/pha-linters-server.sh` script. In the examples below `$SERVER_SH` should expand to the script path above.

```
# Print help text and exit
$SERVER_SH -h

# Interactive setup, scan for the bundle and prompts you to trust it.
# Hosts the http server on port 10641, or the port specified with `-p`.
$SERVER_SH

# ASK setup, will setup `.vscode/settings.json` for local HTL development.
# The installaltion directory is hidden away in `/var/tmp` of the Docker container.
# The hardcoded bundle path is always used.
$SERVER_SH -s -g -b ...

# AFK setup which builds and runs the first portable-hack-ast-server-bundle.resource
# Skips the trust prompt, should only be used if you trust every file in the directory.
$SERVER_SH -t

# AFK setup, point $SERVER_SH to a bundle, skips the prompt.
# Recommended setup for CI pipelines
$SERVER_SH -b "vendor/hershel-theodore-layton/portable-hack-ast-server/bin/portable-hack-ast-server-bundle.resource"
```

When running interactively, you may see the following prompt:

```
Found the following resource file.
./path/to/portable-hack-ast-linters-server-bundled.resource
If you trust the resource above, type 'I trust this resource' to build and run it.

```

When you type `I trust this resource`, you understand the risks involved with compiling and running this resource.

### Dependency hacking

[](#dependency-hacking)

This package depends on `portable-hack-ast(-linters|-extras)` at build time, but the bundled output does not. This bundling process allows `portable-hack-ast`and `portable-hack-ast-extras` to use this package without circular dependencies. This is accomplished by publishing an empty `composer.json` file.

When developing this bundle, you must select the composer file with dependencies. Set the [`COMPOSER`](https://getcomposer.org/doc/03-cli.md#composer) environment variable to `composer.dev.json`.

```
COMPOSER=composer.dev.json composer update
```

This will install the dependencies, whereas `composer update` without the environment variable set will not install anything.

### Developing

[](#developing)

Since the bundle can't depend on any unbundled code, for example `hhvm-autoload`, developing this package requires the ini setting`hhvm.autoload.enabled=true`. Downstream consumers don't need native autoloading, since the bundle includes all the dependencies in a single file.

When you are testing live (not the bundle itself), you can start the server using:

```
hhvm -m server -p 8080 -vServer.AllowRunAsRoot=1 -dhhvm.server.global_document=src/main.hack
```

If you want to test the bundle, use the following command:

```
./build.sh && bin/pha-linters-server.sh -p 8080 \
-b bin/portable-hack-ast-linters-server-bundled.resource
```

This will rebuild, recompile and start the lint-server.

Footnotes
---------

1. This extension is available on open-vsx.org at the time of writing. Stock VSCode is configured to load extensions from the VSCode Marketplace. If you are using VSCode, download and install the `.vsix` file. If you are using a VSCode fork, such as VSCodium, you can find the extension in the extension search tab, since VSCode forks use open-vsx. [↩](#user-content-fnref-1-eb9e79ea9ed5cdc53863822c8efe278f) [↩2](#user-content-fnref-1-2-eb9e79ea9ed5cdc53863822c8efe278f)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance84

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~24 days

Total

27

Last Release

81d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d16d159b7061287c506d4ab44d05ae042bc4ec697116d1bd132a007634d9ff21?d=identicon)[Hershel Theodore Layton](/maintainers/Hershel%20Theodore%20Layton)

---

Top Contributors

[![hershel-theodore-layton](https://avatars.githubusercontent.com/u/81193606?v=4)](https://github.com/hershel-theodore-layton "hershel-theodore-layton (71 commits)")

### Embed Badge

![Health badge](/badges/hershel-theodore-layton-portable-hack-ast-linters-server/health.svg)

```
[![Health](https://phpackages.com/badges/hershel-theodore-layton-portable-hack-ast-linters-server/health.svg)](https://phpackages.com/packages/hershel-theodore-layton-portable-hack-ast-linters-server)
```

###  Alternatives

[hhvm/hsl

The Hack Standard Library

1151.1M55](/packages/hhvm-hsl)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
