Skip to content

Commit

Permalink
chore: add more ignoring file patterns on formatting (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin authored Dec 24, 2023
1 parent 0ea812c commit fa1e1e5
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
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",
"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 these test fixtures
files: 'test/fixtures/**/*',
rules: {
'prettier/prettier': [
'error',
{},
{
fileInfoOptions: {
ignorePath: '.eslintignore',
},
},
],
},
},
{
files: ['*.{md,mdx}'],
extends: 'plugin:mdx/recommended',
Expand Down

0 comments on commit fa1e1e5

Please sign in to comment.