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.1.2
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.1.3
Choose a head ref
  • 6 commits
  • 8 files changed
  • 2 contributors

Commits on Dec 24, 2023

  1. Copy the full SHA
    188487b View commit details
  2. Copy the full SHA
    0ea812c View commit details
  3. Copy the full SHA
    fa1e1e5 View commit details

Commits on Dec 26, 2023

  1. Copy the full SHA
    f985718 View commit details

Commits on Jan 10, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    985b33c View commit details
  2. chore: release eslint-plugin-prettier (#636)

    Co-authored-by: JounQin <admin@1stg.me>
    github-actions[bot] and JounQin authored Jan 10, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    248cd17 View commit details
Showing with 96 additions and 36 deletions.
  1. +3 −1 .github/FUNDING.yml
  2. +2 −0 .github/workflows/release.yml
  3. +2 −0 .prettierignore
  4. +5 −1 .prettierrc
  5. +22 −1 CHANGELOG.md
  6. +11 −6 package.json
  7. +25 −15 pnpm-lock.yaml
  8. +26 −12 test/prettier.js
4 changes: 3 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
github:
- JounQin
- prettier-eslint
- 1stG
- rx-ts
- un-ts
patreon: 1stG
patreon: PrettierESLint
open_collective: eslint-plugin-prettier
custom:
- https://opencollective.com/1stG
- https://opencollective.com/rxts
- https://opencollective.com/unts
- https://www.patreon.com/1stG
- https://afdian.net/@JounQin
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -26,7 +26,9 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
commit: 'chore: release eslint-plugin-prettier'
title: 'chore: release eslint-plugin-prettier'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
test/fixtures
/pnpm-lock.yaml
# this file doesn't exist, but we use it as a filename that should be ignored
# by prettier in the tests
ignore-me.js
6 changes: 5 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"arrowParens": "avoid",
"singleQuote": true,
"plugins": ["@prettier/plugin-pug", "prettier-plugin-pkg"],
"plugins": [
"@prettier/plugin-pug",
"prettier-plugin-pkg",
"prettier-plugin-svelte"
],
"overrides": [
{
"files": ".changeset/**/*",
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 5.1.3

### Patch Changes

- [#629](https://github.com/prettier/eslint-plugin-prettier/pull/629) [`985b33c`](https://github.com/prettier/eslint-plugin-prettier/commit/985b33c56f146b2e65ae391a3af57f63b07ecbdf) Thanks [@JounQin](https://github.com/JounQin)! - chore: add `package.json` into `exports` map

## 5.1.2

### Patch Changes
@@ -10,6 +16,21 @@

- [#621](https://github.com/prettier/eslint-plugin-prettier/pull/621) [`2b09e7f`](https://github.com/prettier/eslint-plugin-prettier/commit/2b09e7fc64f38297c8ca39d087dba1f122ef999c) Thanks [@JounQin](https://github.com/JounQin)! - feat: support parsing `markdown` via `eslint-mdx` natively

What means the following is unnecessary anymore when using with `eslint-mdx`/`eslint-plugin-mdx`!

```json5
[
{
files: ['**/*.md'],
rules: { 'prettier/prettier': ['error', { parser: 'markdown' }] },
},
{
files: ['**/*.mdx'],
rules: { 'prettier/prettier': ['error', { parser: 'mdx' }] },
},
]
```

## 5.1.1

### Patch Changes
@@ -26,7 +47,7 @@

```js
// eslint.config.js
const eslintPluginPrettierRecommended = require("eslint-plugin-prettier/recommended");
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');

module.exports = [
// Any other config imports go at the top
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-prettier",
"version": "5.1.2",
"version": "5.1.3",
"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",
@@ -23,7 +23,8 @@
"./recommended": {
"types": "./recommended.d.ts",
"default": "./recommended.js"
}
},
"./package.json": "./package.json"
},
"types": "eslint-plugin-prettier.d.ts",
"files": [
@@ -40,11 +41,11 @@
"prettier"
],
"scripts": {
"check": "prettier --check . && pnpm lint",
"format": "prettier --write . && pnpm lint --fix",
"lint": "eslint . --cache -f friendly --max-warnings 10",
"prepare": "simple-git-hooks",
"prerelease": "pnpm format && pnpm test",
"release": "changeset publish",
"release": "pnpm check && pnpm test && changeset publish",
"test": "pnpm lint && mocha"
},
"peerDependencies": {
@@ -80,9 +81,9 @@
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-formatter-friendly": "^7.0.0",
"eslint-mdx": "^2.2.1",
"eslint-mdx": "^2.3.0",
"eslint-plugin-eslint-plugin": "^5.2.1",
"eslint-plugin-mdx": "^2.2.1",
"eslint-plugin-mdx": "^2.3.0",
"eslint-plugin-n": "^16.5.0",
"eslint-plugin-prettier": "link:.",
"eslint-plugin-pug": "^1.2.5",
@@ -93,13 +94,17 @@
"mocha": "^10.2.0",
"prettier": "^3.1.1",
"prettier-plugin-pkg": "^0.18.0",
"prettier-plugin-svelte": "^3.1.2",
"simple-git-hooks": "^2.9.0",
"svelte": "^4.2.8",
"vue-eslint-parser": "^9.3.2"
},
"pnpm": {
"patchedDependencies": {
"@types/eslint@8.56.0": "patches/@types__eslint@8.56.0.patch"
},
"overrides": {
"prettier": "^3.1.1"
}
}
}
40 changes: 25 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 26 additions & 12 deletions test/prettier.js
Original file line number Diff line number Diff line change
@@ -37,6 +37,21 @@ const eslint = new ESLint({
},
extends: 'plugin:prettier/recommended',
overrides: [
{
// `.prettierignore` will be used by default which is unexpected for these test fixtures
files: 'test/fixtures/**/*',
rules: {
'prettier/prettier': [
'error',
{},
{
fileInfoOptions: {
ignorePath: '.eslintignore',
},
},
],
},
},
{
files: ['*.{md,mdx}'],
extends: 'plugin:mdx/recommended',
@@ -283,20 +298,25 @@ runFixture('*.mdx', [
],
]);

/**
* @see https://github.com/sveltejs/svelte/blob/226bf419f9b9b5f1a6da33bd6403dd70afe58b52/packages/svelte/package.json#L73
*/
const svelteUnsupported = +process.versions.node.split('.')[0] < 16;

runFixture(
'eslint-plugin-svelte/*.svelte',
[
[
{
column: 5,
column: 1,
endColumn: 11,
endLine: 2,
fix: {
range: [13, 19],
text: 'name',
range: [9, 19],
text: ' let name',
},
line: 2,
message: 'Replace `·name·` with `name`',
message: 'Replace `let··name·` with `··let·name`',
messageId: 'replace',
nodeType: null,
ruleId: 'prettier/prettier',
@@ -319,16 +339,10 @@ runFixture(
},
],
],
// FIXME: https://github.com/sveltejs/prettier-plugin-svelte/issues/317
true,
svelteUnsupported,
);

runFixture(
'eslint-plugin-svelte3/*.svelte',
[[], []],
// FIXME: https://github.com/sveltejs/prettier-plugin-svelte/issues/317
true,
);
runFixture('eslint-plugin-svelte3/*.svelte', [[], []], svelteUnsupported);

/**
* The `script` code style actually does not match `prettier`'s,