Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: prettier/eslint-plugin-prettier
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.0.0
Choose a base ref
...
head repository: prettier/eslint-plugin-prettier
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.0.1
Choose a head ref
  • 2 commits
  • 3 files changed
  • 4 contributors

Commits on Oct 11, 2023

  1. fix: parserPath type might be undefined on Eslint Flat Config (#588)

    Co-authored-by: JounQin <admin@1stg.me>
    krist7599555 and JounQin authored Oct 11, 2023
    Copy the full SHA
    21a7146 View commit details
  2. chore: release eslint-plugin-prettier (#589)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Oct 11, 2023
    Copy the full SHA
    aa81435 View commit details
Showing with 12 additions and 3 deletions.
  1. +6 −0 CHANGELOG.md
  2. +1 −1 package.json
  3. +5 −2 worker.js
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 5.0.1

### Patch Changes

- [#588](https://github.com/prettier/eslint-plugin-prettier/pull/588) [`21a7146`](https://github.com/prettier/eslint-plugin-prettier/commit/21a7146d78161307dcc7eaa96f41dac51f7ce89f) Thanks [@krist7599555](https://github.com/krist7599555)! - fix: `parserPath` type might be `undefined` on Eslint Falt Config

## 5.0.0

### Major Changes
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-prettier",
"version": "5.0.0",
"version": "5.0.1",
"description": "Runs prettier as an eslint rule",
"repository": "git+https://github.com/prettier/eslint-plugin-prettier.git",
"homepage": "https://github.com/prettier/eslint-plugin-prettier#readme",
7 changes: 5 additions & 2 deletions worker.js
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

/**
* @typedef {import('prettier').FileInfoOptions} FileInfoOptions
* @typedef {import('prettier').Options & { onDiskFilepath: string, parserPath: string, usePrettierrc?: boolean }} Options
* @typedef {import('prettier').Options & { onDiskFilepath: string, parserPath?: string, usePrettierrc?: boolean }} Options
*/

const { runAsWorker } = require('synckit');
@@ -112,7 +112,10 @@ runAsWorker(
// it could be processed by `@ota-meshi/eslint-plugin-svelte`, `eslint-plugin-svelte` or `eslint-plugin-svelte3`
case 'svelte': {
// The `source` would be modified by `eslint-plugin-svelte3`
if (!parserPath.includes('svelte-eslint-parser')) {
if (
typeof parserPath === 'string' &&
!parserPath.includes('svelte-eslint-parser')
) {
// We do not support `eslint-plugin-svelte3`,
// the users should run `prettier` on `.svelte` files manually
return;