Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/patricklx/eslint-plugin-ember-template-lint
https://github.com/patricklx/eslint-plugin-ember-template-lint
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/patricklx/eslint-plugin-ember-template-lint
- Owner: patricklx
- License: isc
- Created: 2023-05-19T11:39:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-22T02:45:15.000Z (11 months ago)
- Last Synced: 2024-04-25T13:00:32.457Z (8 months ago)
- Language: JavaScript
- Size: 1.17 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# eslint-plugin-hbs-template
Provide linting (via [ember-template-lint](https://github.com/ember-template-lint/ember-template-lint)) for hbs templates files, template string literals and gts,gjs (also enables eslint to run its other rules in gts/gjs)
* no extra config file needed* no need to run extra tool for linting
* no need to run extra tool to fix lint issues
* no need to implement & maintain editor support for ember-template-lint
* it also has the advantage that it can know the scope for some template-lint rules, like no-implicit-this, and remove those messages
## Installation
You'll first need to install [ESLint](http://eslint.org):
```
$ npm i eslint --save-dev
```Next, install `eslint-plugin-ember-template-lint`:
```
$ npm install eslint-plugin-ember-template-lint --save-dev
```**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-ember-template-lint` globally.
## Usage
Add `ember-template-lint` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
### 2. Modify your `.eslintrc.js`
you can use the presets from here https://github.com/ember-template-lint/ember-template-lint#presets
like this:
`plugin:ember-template-lint/`to just use the `.template-lintrc.js` config file just use
`plugin:ember-template-lint/config`to load ember-template-lint plugins in eslinrc you need to manually register them:
```js
require('eslint-plugin-ember-template-lint/lib/ember-teplate-lint/config').registerPlugin('ember-template-lint-plugin-prettier');
```## IMPORTANT
Do NOT set parser to anything in your .eslintrc.js as it will override the parser from herefor typescript parser you can extend its base config, then it will work correctly
```js
// .eslintrc.js
// optional:
require('eslint-plugin-ember-template-lint/lib/ember-teplate-lint/config').registerPlugin('ember-template-lint-plugin-prettier');module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/base',
'plugin:ember-template-lint/config',
'plugin:ember-template-lint/recommended',
//optional:
'plugin:ember-template-lint/ember-template-lint-plugin-prettier:recommended'
]
};
```