-
-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(eslint): fix async support for
formatter
option and TypeScript …
…types (#1389) * fix(eslint): make `formatter` support asynchronous function * fix(eslint): Fix the deprecated `CLIEngine` error type * fix(eslint): additional test cases for asynchronous formatter * chore(eslint): add the correct function type * test(eslint): adding TypeScript test cases * docs(eslint): update formatter type
- Loading branch information
1 parent
6195a50
commit f39e8c9
Showing
6 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { RollupOptions } from 'rollup'; | ||
|
||
import eslintPlugin from '../types'; | ||
|
||
const rollupConfig: RollupOptions = { | ||
input: 'main.js', | ||
output: { | ||
file: 'bundle.js', | ||
format: 'iife' | ||
}, | ||
plugins: [ | ||
eslintPlugin(), | ||
eslintPlugin({}), | ||
eslintPlugin({ | ||
formatter: () => 'json' | ||
}), | ||
eslintPlugin({ | ||
formatter: async () => 'json' | ||
}), | ||
eslintPlugin({ | ||
fix: false, | ||
throwOnWarning: true, | ||
throwOnError: true, | ||
include: 'node_modules/**', | ||
exclude: ['node_modules/foo/**', 'node_modules/bar/**', /node_modules/], | ||
extensions: ['.js', '.coffee'], | ||
formatter: 'json' | ||
}) | ||
] | ||
}; | ||
|
||
export default rollupConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters