Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielterwiel/prettier-eslint-webpack-plugin
Webpack plugin for prettier-eslint which ESLint's settings is set to JavaScript Standard Style
https://github.com/danielterwiel/prettier-eslint-webpack-plugin
eslint prettier webpack-plugin webpack2
Last synced: 4 months ago
JSON representation
Webpack plugin for prettier-eslint which ESLint's settings is set to JavaScript Standard Style
- Host: GitHub
- URL: https://github.com/danielterwiel/prettier-eslint-webpack-plugin
- Owner: danielterwiel
- Created: 2017-02-19T20:50:50.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-12-02T10:57:34.000Z (about 3 years ago)
- Last Synced: 2024-04-14T05:10:54.816Z (10 months ago)
- Topics: eslint, prettier, webpack-plugin, webpack2
- Language: JavaScript
- Homepage:
- Size: 54.7 KB
- Stars: 23
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Prettier Eslint Webpack Plugin
Webpack 5 plugin for [prettier-eslint](https://github.com/kentcdodds/prettier-eslint)
## DEPRECATED
Nothing to see here anymore :) ... --> try to update ;)
## Installation
```
yarn add prettier-eslint-webpack-plugin --dev
```### Options
#### encoding (?String)
Encoding to use when reading / writing files*Default:* 'utf-8'
#### extensions (?Array)
Only process these file extensions*Default:* ['.js', '.jsx']
... Furthermore the entire [prettier-eslint](https://github.com/kentcdodds/prettier-eslint#options) API is exposed:
#### filePath (?String)
The path of the file being formatted can be used to override eslintConfig (eslint will be used to find the relevant config for the file).*Default:* `undefined`
#### eslintConfig (?Object)
The config to use for formatting with ESLint. Can be overridden with filePath.*Default:* [JavaScript Standard Style](http://standardjs.com/)
#### prettierOptions (?Object)
The options to pass for formatting with prettier. If not provided, `prettier-eslint` will attempt to create the options based on the `eslintConfig` (whether that's provided or derived via `filePath`). You can also provide some of the options and have the remaining options derived via your eslint config. This is useful for options like `parser`.*Default:* `undefined`
#### logLevel (?Enum: ['trace', 'debug', 'info', 'warn', 'error', 'silent'])
prettier-eslint does quite a bit of logging if you want it to. Pass this to set the amount of logs you want to see.*Default: `process.env.LOG_LEVEL`
#### eslintPath (?String)
By default, prettier-eslint will try to find the relevant eslint (and prettier) module based on the filePath. If it cannot find one, then it will use the version that prettier-eslint has installed locally. If you'd like to specify a path to the eslint module you would like to have prettier-eslint use, then you can provide the full path to it with the eslintPath option.*Default:* `undefined`
### Example
Your `webpack.dev.js` file:
```javascript
import { PrettierEslintPlugin } from 'prettier-eslint-webpack-plugin'
import fs from 'fs'...
const eslintConfig = fs.readFileSync('path/to/.eslintrc')
module.exports = {
...
plugins: {
...
new PrettierEslintPlugin({
encoding: ['utf-16'],
extensions: '.jsf00',
eslintConfig: eslintConfig,
logLevel: 'trace',
prettierOptions: {
singleQuote: false,
}
})
...
}
...
}
```### Inspiration
* [prettier-eslint](https://github.com/kentcdodds/prettier-eslint)
* [prettier-webpack-plugin](https://github.com/hawkins/prettier-webpack-plugin)
* [eslint-config-standard](https://github.com/feross/eslint-config-standard)### Licence
MIT