Skip to content

Commit fa1e1e5

Browse files
authored
chore: add more ignoring file patterns on formatting (#627)
1 parent 0ea812c commit fa1e1e5

File tree

4 files changed

+30
-13
lines changed

4 files changed

+30
-13
lines changed

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
test/fixtures
2+
/pnpm-lock.yaml
13
# this file doesn't exist, but we use it as a filename that should be ignored
24
# by prettier in the tests
35
ignore-me.js

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
"prettier"
4141
],
4242
"scripts": {
43+
"check": "prettier --check . && pnpm lint",
4344
"format": "prettier --write . && pnpm lint --fix",
4445
"lint": "eslint . --cache -f friendly --max-warnings 10",
4546
"prepare": "simple-git-hooks",
46-
"prerelease": "pnpm format && pnpm test",
47-
"release": "changeset publish",
47+
"release": "pnpm check && pnpm test && changeset publish",
4848
"test": "pnpm lint && mocha"
4949
},
5050
"peerDependencies": {
@@ -80,9 +80,9 @@
8080
"eslint": "^8.56.0",
8181
"eslint-config-prettier": "^9.1.0",
8282
"eslint-formatter-friendly": "^7.0.0",
83-
"eslint-mdx": "^2.2.1",
83+
"eslint-mdx": "^2.3.0",
8484
"eslint-plugin-eslint-plugin": "^5.2.1",
85-
"eslint-plugin-mdx": "^2.2.1",
85+
"eslint-plugin-mdx": "^2.3.0",
8686
"eslint-plugin-n": "^16.5.0",
8787
"eslint-plugin-prettier": "link:.",
8888
"eslint-plugin-pug": "^1.2.5",

pnpm-lock.yaml

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/prettier.js

+15
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ const eslint = new ESLint({
3737
},
3838
extends: 'plugin:prettier/recommended',
3939
overrides: [
40+
{
41+
// `.prettierignore` will be used by default which is unexpected for these test fixtures
42+
files: 'test/fixtures/**/*',
43+
rules: {
44+
'prettier/prettier': [
45+
'error',
46+
{},
47+
{
48+
fileInfoOptions: {
49+
ignorePath: '.eslintignore',
50+
},
51+
},
52+
],
53+
},
54+
},
4055
{
4156
files: ['*.{md,mdx}'],
4257
extends: 'plugin:mdx/recommended',

0 commit comments

Comments
 (0)