-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
recommended.js is a flat config version of the recommended config. It follows the pattern of the legacy recommended config by automatically configuring eslint-config-prettier.
- Loading branch information
Showing
6 changed files
with
70 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
'eslint-plugin-prettier': minor | ||
--- | ||
|
||
Add recommended config for the flat config format. | ||
|
||
If you are using flat config, import the recommended config from `eslint-plugin-prettier/recommended`. Like the legacy format recommended config, this automatically includes the contents of `eslint-config-prettier`. | ||
|
||
```js | ||
// eslint.config.js | ||
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended'); | ||
|
||
module.exports = [ | ||
// Any other config imports go at the top | ||
eslintPluginPrettierRecommended, | ||
]; | ||
``` |
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,5 @@ | ||
import { Linter } from 'eslint'; | ||
|
||
declare const recommendedConfig: Linter.FlatConfig; | ||
|
||
export = recommendedConfig; |
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,17 @@ | ||
const eslintConfigPrettier = require('eslint-config-prettier'); | ||
const eslintPluginPrettier = require('./eslint-plugin-prettier'); | ||
|
||
// Merge the contents of eslint-config-prettier into every | ||
module.exports = { | ||
...eslintConfigPrettier, | ||
plugins: { | ||
...eslintConfigPrettier.plugins, | ||
prettier: eslintPluginPrettier, | ||
}, | ||
rules: { | ||
...eslintConfigPrettier.rules, | ||
'prettier/prettier': 'error', | ||
'arrow-body-style': 'off', | ||
'prefer-arrow-callback': 'off', | ||
}, | ||
}; |