Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/natterstefan/plop-action-eslint
A Plop action to lint files with ESLint and automatically format with Prettier.
https://github.com/natterstefan/plop-action-eslint
eslint plop plop-action plop-helper plop-pack plopjs prettier
Last synced: 8 days ago
JSON representation
A Plop action to lint files with ESLint and automatically format with Prettier.
- Host: GitHub
- URL: https://github.com/natterstefan/plop-action-eslint
- Owner: natterstefan
- License: mit
- Created: 2022-03-06T04:49:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-17T18:49:38.000Z (4 months ago)
- Last Synced: 2024-10-16T03:02:58.061Z (22 days ago)
- Topics: eslint, plop, plop-action, plop-helper, plop-pack, plopjs, prettier
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/plop-action-eslint
- Size: 309 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# plop-action-eslint
[![npm version](https://badge.fury.io/js/plop-action-eslint.svg)](https://badge.fury.io/js/plop-action-eslint)
[![GitHub license](https://img.shields.io/github/license/natterstefan/plop-action-eslint.svg)](https://github.com/natterstefan/plop-action-eslint/blob/main/LICENSE)
[![Node CI](https://github.com/natterstefan/plop-action-eslint/actions/workflows/ci.yml/badge.svg)](https://github.com/natterstefan/plop-action-eslint/actions/workflows/ci.yml)A [Plop](https://github.com/plopjs/plop) action to lint files with
[ESLint](https://eslint.org/) and automatically format with
[Prettier](#prettier-support).## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Actions](#actions)
- [Prettier Support](#prettier-support)## Installation
```sh
npm install plop-action-eslint --save-dev# or with yarn
yarn add plop-action-eslint -D
```## Usage
Before you can use `plop-action-eslint`, you have to load it into the `plop`
object by adding the folling to your `plopfile.js`:```javascript
// plopfile.js
module.exports = async plop => {
await plop.load('plop-action-eslint')
}
```Once loaded, you have access the following actions.
### Actions
#### `eslint`
Lints and fixes (autofix is enabled) the file of the given path with your
projects ESLint configuration.```javascript
{
type: "eslint",
path: "src/component/{{pascalCase name}}.js",
}
```You can also pass an array of paths.
```javascript
{
type: "eslint",
path: [
"src/component/{{pascalCase name}}.js",
"src/component/{{pascalCase name}}.test.js",
],
}
```## Prettier Support
In order to automatically format your code with Prettier as well, you have to
use [eslint-config-prettier][1] and [eslint-plugin-prettier][2] in your ESLint
configuration.## How to release
### Manually trigger release
```bash
# generate a new tag
yarn lerna:version# generate a new Changelog entry
npx lerna-changelog --from --to
# add the result manually to CHANGELOG.md and commit it
git add CHANGELOG.md
git commit -m "chore: prepared release"# push the tags
git push --tags# publish the new version
yarn lerna:publish
```## License
[MIT](./LICENSE)
## Contributors ✨
Thanks goes to these wonderful people
([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Stefan Natter
💻
Vytenis
💻
Ivan Holovin
💻
Oliver Lillie
💻
This project follows the
[all-contributors](https://github.com/all-contributors/all-contributors)
specification. Contributions of any kind welcome!## Credits
This plop action is based on the code that was shared in
[plop#80](https://github.com/plopjs/plop/issues/80#issuecomment-645179250) by
[FDiskas](https://github.com/FDiskas).[1]: https://github.com/prettier/eslint-config-prettier
[2]: https://github.com/prettier/eslint-plugin-prettier