Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yaegassy/coc-tighten-lint

tlint (Tighten linter for Laravel) extension for coc.nvim
https://github.com/yaegassy/coc-tighten-lint

blade coc coc-extensions coc-nvim laravel linter neovim php vim

Last synced: 2 months ago
JSON representation

tlint (Tighten linter for Laravel) extension for coc.nvim

Awesome Lists containing this project

README

        

# coc-tighten-lint

[tlint](https://github.com/tighten/tlint) (Tighten linter for Laravel) extension for coc.nvim.

coc-tighten-lint-demo

## Install

**CocInstall**:

```vim
:CocInstall coc-tighten-lint
```

**vim-plug**:

```vim
Plug 'yaegassy/coc-tighten-lint', {'do': 'yarn install --frozen-lockfile'}
```

## Features

- Linter by `tlint lint`
- CodeAction (autoFix) by `tlint format`
- Built-in installer
- Supports `tlint.json` configuration file

## Detect tool: tlint

1. `tighten-lint.toolPath` setting
1. `vendor/bin/tlint` (project)
1. builtin (Installation commands are also provided)
- Mac/Linux: `~/.config/coc/extensions/coc-tighten-lint-data/tlint/vendor/bin/tlint`
- Windows: `~/AppData/Local/coc/extensions/coc-tighten-lint-data/tlint/vendor/bin/tlint`

## Bult-in install

```vim
:CocComannd tighten-lint.install
```

## Activation Events

- `"onLanguage:php"`
- `"onLanguage:blade"`

## Configuration options

- `tighten-lint.enable`: Enable coc-tighten-lint extension, default: `true`
- `tighten-lint.toolPath`: The path to the tlint (Absolute path), default: `""`
- `tighten-lint.lintOnOpen`: Lint file on opening, default: `true`
- `tighten-lint.lintOnChange`: Lint file on change, default: `true`
- `tighten-lint.lintOnSave`: Lint file on save, default: `true`
- `tighten-lint.defaultSeverity`: Severity of violations, valid option `"error", "warning", "info", "hint"`, default: `"error"`
- `tighten-lint.severities`: Source to severity mappings, default: `{}`
- `tighten-lint.only`: Policies to include, default: `[]`

### Example Configuration ("coc-settings.json" or ".vim/coc-settings.json")

```jsonc
{
// ...snip
"tighten-lint.defaultSeverity": "warning",
"tighten-lint.only": [
"AlphabeticalImports",
"NoInlineVarDocs",
"ImportFacades"
],
"tighten-lint.severities": {
"NoInlineVarDocs": "info"
},
// ...snip
}
```

### tlint.json configuration file

If you wish to use a [configuration file](https://github.com/tighten/tlint#configuration) you should place the `tlint.json` file in the root of your project folder in the required format e.g.

**example: tslint.json**

```json
{
"preset": "laravel",
"disabled": ["NoInlineVarDocs"],
"excluded": ["tests/"]
}
```

## Commands

- `tighten-lint.install`: Install tlint

## Code Actions

- `Run: tighten-lint.autoFix`

## Thanks

- [tighten/tlint](https://github.com/tighten/tlint)
- [d9705996/vscode-tighten-lint](https://github.com/d9705996/vscode-tighten-lint)

## License

MIT

---

> This extension is built with [create-coc-extension](https://github.com/fannheyward/create-coc-extension)