Skip to content
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

chore: add more ignoring file patterns on formatting #627

Merged
merged 4 commits into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,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": {
Expand Down Expand Up @@ -80,9 +80,9 @@
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-formatter-friendly": "^7.0.0",
"eslint-mdx": "^2.2.1",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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",
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

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

15 changes: 15 additions & 0 deletions test/prettier.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ const eslint = new ESLint({
},
extends: 'plugin:prettier/recommended',
overrides: [
{
// `.prettierignore` will be used by default which is unexpected for there test fixtures
JounQin marked this conversation as resolved.
Show resolved Hide resolved
files: 'test/fixtures/**/*',
rules: {
'prettier/prettier': [
'error',
{},
{
fileInfoOptions: {
ignorePath: '.eslintignore',
},
},
],
},
},
{
files: ['*.{md,mdx}'],
extends: 'plugin:mdx/recommended',
Expand Down