This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
LSP support, additional linters, `expect()` migration
LSP Support
hhast-lint
's LSP mode is now supported, providing IDE integration for lint errors and auto fixes.
LSP support requires HHVM 3.27.1 or later for stability.
Atom IDE
Install the atom-ide-ui
and ide-hhast
packages.
Nuclide
Install the ide-hhast
package.
Visual Studio Code
Install vscode-hack v1.0 or above:
Implementing in other editors
Execute hhast-lint --mode lsp --from your-editor-name-here
.
initializationOptions.lintMode
can be set to 'whole-project'
or 'open-files'
; whole-project
is the default.
HHAST does not replace hh_client lsp
; editors/plugins should be configured to use both.
New Linters
- Add auto-fixing license header linter: if a
.LICENSE_HEADER.hh.txt
is present, it must be present as a comment in all files in the directory or recursive subdirectories - Add auto-fixing linter banning use statements with a leading backslash (the backslash does not affect the meaning)
- Add auto-fixing linter banning unused parameters, unless they start with an underscore (e.g.
$_
) - Add auto-fixing linter banning unused
use
clauses
Linter Changes
CamelCasedMethodsUnderscoredFunctionsLinter
now requires that methods arelowerCamelCase
UseStatementWithAsLinter
no longer suggests removing the 'as' as a fix; this almost always introduces many errors.
New Migration
Added bin/hhast-migrate --assert-to-expect
to migrate to fbexpect.