-
-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Add custom eslint formatter #2138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -166,6 +166,43 @@ compiler.plugin('done', function(stats) { | |
| }); | ||
| ``` | ||
|
|
||
| #### `formatter(results: Object): string` | ||
|
|
||
|
||
| This is an eslint formatter that takes the result generated from eslint and formats the output string | ||
|
|
||
| ```js | ||
| const formatter = require('react-dev-utils/formatter'); | ||
| const webpack = require('webpack'); | ||
|
|
||
| module: { | ||
|
||
| strictExportPresence: true, | ||
| rules: [ | ||
| { parser: { requireEnsure: false } }, | ||
| { | ||
| test: /\.(js|jsx)$/, | ||
| enforce: 'pre', | ||
| use: [ | ||
| { | ||
| // @remove-on-eject-begin | ||
|
||
| // Point ESLint to our predefined config. | ||
| options: { | ||
| formatter, | ||
| baseConfig: { | ||
| extends: ['react-app'], | ||
| }, | ||
| ignore: false, | ||
| useEslintrc: false, | ||
| }, | ||
| // @remove-on-eject-end | ||
| loader: 'eslint-loader', | ||
| }, | ||
| ], | ||
| include: paths.appSrc, | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| #### `getProcessForPort(port: number): string` | ||
|
|
||
| Finds the currently running process on `port`. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make it
eslintFormatterinstead?